40 #ifndef __MODENAMODEL_H__ 41 #define __MODENAMODEL_H__ 76 virtual const char* what()
const throw()
78 return "Modena Exception";
100 const std::string& name
106 if(modena_error_occurred())
112 inputs_ = modena_inputs_new(model_);
113 outputs_ = modena_outputs_new(model_);
120 modena_inputs_destroy(inputs_);
121 modena_outputs_destroy(outputs_);
127 inline size_t inputs_size()
const 132 inline size_t outputs_size()
const 137 inline size_t parameters_size()
const 142 inline size_t inputs_argPos(
const std::string& name)
const 147 inline size_t outputs_argPos(
const std::string& name)
const 152 inline void inputs_set(
const size_t i,
double x)
const 154 modena_inputs_set(inputs_, i, x);
157 inline double outputs_get(
const size_t i)
const 159 return modena_outputs_get(outputs_, i);
162 inline void argPos_check()
const 167 inline std::vector<std::string> inputs_names()
const 169 std::vector<std::string> v;
174 v.push_back(std::string(iNames[i]));
180 inline std::vector<std::string> outputs_names()
const 182 std::vector<std::string> v;
187 v.push_back(std::string(oNames[i]));
193 inline std::vector<std::string> parameters_names()
const 195 std::vector<std::string> v;
200 v.push_back(std::string(pNames[i]));
206 inline void call()
const 210 if(modena_error_occurred())
char ** modena_model_parameters_names(const modena_model_t *self)
Function returning the names of the parameters.
char ** modena_model_inputs_names(const modena_model_t *self)
Function returning the names of the inputs.
size_t modena_model_inputs_argPos(const modena_model_t *self, const char *name)
Function determining position of an argument in the input vector.
size_t modena_model_inputs_size(const modena_model_t *self)
Function returning the size of the input vector.
size_t modena_model_outputs_size(const modena_model_t *self)
Function returning the size of the output vector.
modena_model_t * modena_model_new(const char *modelId)
Function fetching a surrogate model from MongoDB.
int modena_model_call(modena_model_t *self, modena_inputs_t *inputs, modena_outputs_t *outputs)
Function calling the surrogate model and checking for errors.
void modena_model_destroy(modena_model_t *self)
Function deallocating the memory allocated for the surrogate model.
size_t modena_model_parameters_size(const modena_model_t *self)
Function returning the size of the parameter vector.
size_t modena_model_outputs_argPos(const modena_model_t *self, const char *name)
Function determining position of a result in the output vector.
void modena_model_argPos_check(const modena_model_t *self)
Function checking that the user has queried all input positions.
char ** modena_model_outputs_names(const modena_model_t *self)
Function returning the names of the outputs.