8 #ifndef _LIBROM_INTERFACE_H_
9 #define _LIBROM_INTERFACE_H_
12 #define _ROM_MODE_NONE_ "none"
14 #define _ROM_MODE_TRAIN_ "train"
16 #define _ROM_MODE_PREDICT_ "predict"
19 #define _ROM_MODE_INITIAL_GUESS_ "initial_guess"
22 #define _ROM_COMP_MODE_MONOLITHIC_ "monolithic"
24 #define _ROM_COMP_MODE_COMPONENTWISE_ "component-wise"
30 #include <linalg/Vector.h>
76 define( a_s, a_nsims, a_rank, a_nproc, a_dt );
80 void define(
void*,
int,
int,
int,
double);
85 for (
int i = 0; i <
m_rom.size(); i++)
delete m_rom[i];
87 for (
int i = 0; i <
m_U.size(); i++)
delete m_U[i];
94 inline const std::string&
mode()
const {
return m_mode; }
105 void takeSample(
void* a_s,
const double a_t );
114 void predict(
void* a_s,
const double a_t)
const;
117 void saveROM(
const std::string& a_fname_root=
"")
const;
120 void loadROM(
const std::string& a_fname_root=
"");
126 void copyToHyPar(
const CAROM::Vector&,
void*,
int )
const;
129 void copyToHyPar(
const CAROM::Vector&,
void*,
int,
int )
const;
151 std::vector<CAROM::Vector*>
m_U;
std::vector< int > m_ncomps
std::vector< int > m_vec_size
libROMInterface(void *a_s, int a_nsims, int a_rank, int a_nproc, double a_dt)
void projectInitialSolution(void *a_s)
void saveROM(const std::string &a_fname_root="") const
std::vector< CAROM::Vector * > m_U
void loadROM(const std::string &a_fname_root="")
struct timeval m_train_end
std::vector< ROMObject * > m_rom
Base class for a libROM object.
void copyFromHyPar(std::vector< CAROM::Vector * > &, void *)
int samplingFrequency() const
double predictWallclockTime() const
void define(void *, int, int, int, double)
Class implementing interface with libROM.
const std::string & componentMode() const
struct timeval m_predict_end
void copyToHyPar(const CAROM::Vector &, void *, int) const
double trainWallclockTime() const
struct timeval m_train_start
void predict(void *a_s, const double a_t) const
struct timeval m_predict_start
void takeSample(void *a_s, const double a_t)
const std::string & mode() const
const std::string & type() const