|
| Opt (ThreadManager *MTHREAD_h) |
| Constructor. More...
|
|
| ~Opt () |
|
virtual bool | intermediate_callback (AlgorithmMode mode, Index iter, Number obj_value, Number inf_pr, Number inf_du, Number mu, Number d_norm, Number regularization_size, Number alpha_du, Number alpha_pr, Index ls_trials, const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq) |
|
virtual void | generate_tapes (Index n, Index m, Index &nnz_jac_g, Index &nnz_h_lag) |
|
void | declareVariables () |
| declare the variables, their domains and their bounds More...
|
|
void | declareVariable (const string &name, const int &domain, const string &desc="", const double &l_bound=0.0, const double &u_bound=UBOUND_MAX, const string &l_bound_var="", const string &u_bound_var="") |
| Declare a single variable, its domain and its bounds. More...
|
|
void | declareConstrains () |
| declare the constrains, their domain, their direction and their associated evaluation function More...
|
|
void | cacheInitialPosition () |
| cache the initial positions of the variables and the constrains More...
|
|
void | calculateNumberVariablesConstrains () |
| calculate the number of variables and constrains More...
|
|
void | cachePositions () |
| cache the exact position index (initial+f(r1,r2,p,r2To) for each variable and constrain More...
|
|
int | getDomainElements (int domain) |
| return the number of elements of a domain More...
|
|
template<class T > |
vector< vector< vector< vector< int > > > > | buildPositionVector (const T &v_or_c, int dType) |
| build the matrix of the positions for a given variable or contrain More...
|
|
int | getVarInstances (const string &varName) |
| build the matrix of the positions for a given variable or contrain More...
|
|
void | calculateSparsityPatternJ () |
|
void | calculateSparsityPatternH () |
|
const Number & | mymax (const Number &a, const Number &b) |
|
const adouble & | mymax (const adouble &a, const adouble &b) |
|
|
virtual bool | get_nlp_info (Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, IndexStyleEnum &index_style) |
|
virtual bool | get_bounds_info (Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u) |
|
virtual bool | get_starting_point (Index n, bool init_x, Number *x, bool init_z, Number *z_L, Number *z_U, Index m, bool init_lambda, Number *lambda) |
|
template<class T > |
bool | eval_obj (Index n, const T *x, T &obj_value) |
|
template<class T > |
bool | eval_constraints (Index n, const T *x, Index m, T *g) |
|
virtual bool | eval_f (Index n, const Number *x, bool new_x, Number &obj_value) |
|
virtual bool | eval_grad_f (Index n, const Number *x, bool new_x, Number *grad_f) |
|
virtual bool | eval_g (Index n, const Number *x, bool new_x, Index m, Number *g) |
|
virtual bool | eval_jac_g (Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values) |
|
virtual bool | eval_h (Index n, const Number *x, bool new_x, Number obj_factor, Index m, const Number *lambda, bool new_lambda, Index nele_hess, Index *iRow, Index *jCol, Number *values) |
|
|
virtual void | finalize_solution (SolverReturn status, Index n, const Number *x, const Number *z_L, const Number *z_U, Index m, const Number *g, const Number *lambda, Number obj_value, const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq) |
|
| BaseClass () |
|
| ~BaseClass () |
|
void | msgOut (const int &msgCode_h, const string &msg_h, const bool &refreshGUI_h=true) const |
| Overloaded function to print the output log. More...
|
|
void | msgOut (const int &msgCode_h, const int &msg_h, const bool &refreshGUI_h=true) const |
| Overloaded function to print the output log. More...
|
|
void | msgOut (const int &msgCode_h, const double &msg_h, const bool &refreshGUI_h=true) const |
| Overloaded function to print the output log. More...
|
|
int | s2i (const string &string_h) const |
| string to integer conversion More...
|
|
double | s2d (const string &string_h) const |
| string to double conversion More...
|
|
double | s2d (const string &string_h, const bool &replaceComma) const |
| string to double conversion More...
|
|
bool | s2b (const string &string_h) const |
| string to bool conversion More...
|
|
string | i2s (const int &int_h) const |
| integer to string conversion More...
|
|
string | d2s (const double &double_h) const |
| double to string conversion More...
|
|
string | b2s (const bool &bool_h) const |
| bool to string conversion More...
|
|
vector< int > | s2i (const vector< string > &string_h) const |
| string to integer conversion (vector) More...
|
|
vector< double > | s2d (const vector< string > &string_h, const bool &replaceComma=false) const |
| string to double conversion (vector) More...
|
|
vector< bool > | s2b (const vector< string > &string_h) const |
| string to bool conversion (vector) More...
|
|
vector< string > | i2s (const vector< int > &int_h) const |
| integer to string conversion (vector) More...
|
|
vector< string > | d2s (const vector< double > &double_h) const |
| double to string conversion (vector) More...
|
|
vector< string > | b2s (const vector< bool > &bool_h) const |
| bool to string conversion (vector) More...
|
|
int | getType (const string &type_h) const |
| Return a type according to enum TYPE_* from a string (eg: "string" -> TYPE_STRING (2)) More...
|
|
void | refreshGUI () const |
| Ping to periodically return the control to the GUI. More...
|
|
template<typename T > |
string | toString (const T &x) const |
|
template<typename T > |
T | stringTo (const std::string &s) const |
|
int | vSum (const vector< int > &vector_h) const |
|
double | vSum (const vector< double > &vector_h) const |
|
int | vSum (const vector< vector< int > > &vector_h) const |
|
double | vSum (const vector< vector< double > > &vector_h) const |
|
void | tokenize (const string &str, vector< string > &tokens, const string &delimiter=" ") const |
| Tokenize a string using a delimiter (default is space) More...
|
|
void | untokenize (string &str, vector< string > &tokens, const string &delimiter=" ") const |
|
template<typename K , typename V > |
V | findMap (const map< K, V > &mymap, const K &key, const int &error_level=MSG_CRITICAL_ERROR, const V ¬FoundValue=numeric_limits< V >::min()) const |
| Lookup a map for a value. Return the value starting from the key. More...
|
|
template<typename K , typename V > |
void | changeMapValue (map< K, V > &mymap, const K &key, const V &value, const int &error_level=MSG_CRITICAL_ERROR) |
| Change the value stored in a map given the key and the new value. More...
|
|
template<typename K , typename V > |
void | incrMapValue (map< K, V > &mymap, const K &key, const V &value, const int &error_level=MSG_CRITICAL_ERROR) |
| Increments a value stored in a map of the specified value, given the key. More...
|
|
template<typename K , typename V > |
void | incrOrAddMapValue (map< K, V > &mymap, const K &key, const V &value) |
| Increments a value stored in a map of the specified value, given the key. More...
|
|
template<typename K , typename V > |
void | resetMapValues (map< K, V > &mymap, const V &value) |
| Reset all values stored in a map to the specified one. More...
|
|
template<typename K , typename V > |
map< K, V > | vectorToMap (const vector< K > &keys, const V &value=0.0) |
| Returns a map built using the given vector and the given (scalar) value as keys/values pairs. More...
|
|
template<typename T > |
vector< T > | positionsToContent (const vector< T > &vector_h, const vector< int > &positions) |
| Return a vector of content from a vector and a vector of positions (int) More...
|
|
template<typename V > |
void | debugMap (const map< iisskey, V > &mymap) |
| Debug a map. More...
|
|
template<typename K , typename V > |
void | debugMap (const map< K, V > &mymap, const K &key) |
|
template<typename K > |
int | getMaxPos (const vector< K > &v) |
| Returns the position of the maximum element in the vector (the last one in case of multiple equivalent maxima) More...
|
|
template<typename K > |
int | getMinPos (const vector< K > &v) |
| Returns the position of the minimum element in the vector (the first one in case of multiple equivalent minima) More...
|
|
template<typename K > |
K | getMax (const vector< K > &v) |
| Returns the value of the maximum element in the vector (the last one in case of multiple equivalent maxima) More...
|
|
template<typename K > |
K | getMin (const vector< K > &v) |
| Returns the value of the minimum element in the vector (the first one in case of multiple equivalent minima) More...
|
|
template<typename K > |
double | getAvg (const vector< K > &v) |
| Returns the average of the elements in the vector. More...
|
|
template<typename K > |
double | getSd (const vector< K > &v, bool sample=true) |
|
template<typename K > |
int | getPos (const K &element, const vector< K > &v, const int &msgCode_h=MSG_CRITICAL_ERROR) |
|
template<typename K > |
bool | inVector (const K &element, const vector< K > &v) |
|
double | normSample (const double &avg, const double &stdev, const double &minval=NULL, const double &maxval=NULL) const |
| Sample from a normal distribution with bounds. Slower (double time, but still you see the diff only after milion of loops). More...
|
|
template<typename K > |
K | normSample (normal_distribution< K > &d, std::mt19937 &gen, const K &minval=NULL, const K &maxval=NULL) const |
| Sample from a normal distribution with bounds. Faster (half time) as the normal_distribution is made only once. More...
|
|
template<typename T > |
std::string | toString (const T &x) const |
|
|
const double | gpd (const string &type_h, const int ®Id_h, const string &prodId_h, const int &year=DATA_NOW, const string &freeDim_h="") const |
|
const double | gfd (const string &type_h, const int ®Id_h, const string &forType_h, const string &diamClass_h, const int &year=DATA_NOW) const |
|
void | spd (const double &value_h, const string &type_h, const int ®Id_h, const string &prodId_h, const int &year=DATA_NOW, const bool &allowCreate=false, const string &freeDim_h="") const |
|
void | sfd (const double &value_h, const string &type_h, const int ®Id_h, const string &forType_h, const string &diamClass_h, const int &year=DATA_NOW, const bool &allowCreate=false) const |
|
bool | app (const string &prod_h, const string &forType_h, const string &dClass_h) const |
|
const int | gip (const string &varName) const |
| Get the initial index position of a given variable in the concatenated array. More...
|
|
const int | gip (const int &cn) const |
| Return the initial index position of a certain constrain. More...
|
|
template<class T > |
const int | gix_uncached (const T &v_or_c, int r1Ix, int r2Ix, int prIx, int r2IxTo=0) |
| Get the index in the concatenated array gived a certain var name (string) or constrain index (int), the reg lev1 index, the reg lev2 index and the prod. index. More...
|
|
const int | gix (const string &varName, const int &r1Ix, const int &r2Ix, const int &prIx, const int &r2IxTo=0) const |
| Get the index in the concatenated array gived a certain var name, the reg lev1 index, the reg lev2 index and the prod. index. More...
|
|
const int | gix (const int &cn, const int &r1Ix, const int &r2Ix, const int &prIx, const int &r2IxTo=0) const |
| Get the index in the concatenated array gived a certain constrain, the reg lev1 index, the reg lev2 index and the prod. index. More...
|
|
const int | gdt (const string &varName) |
| Get the domain type of a given variable. More...
|
|
const int | gdt (const int &cn) |
| Get the domain type of a given constrain. More...
|
|
int | getConstrainDirectionByIndex (int idx) |
| Return the direction of a given constrain. More...
|
|
double | getBoundByIndex (const int &bound_type, const int &idx) |
| Return the bound of a given variable (by index) More...
|
|
double | getDetailedBoundByVarAndIndex (const endvar &var, const int &idx, const int &bType) |
| Return the bound of a given variable given the variable and the required index. Called by getBoundByIndex(). More...
|
|
constrain * | getConstrainByIndex (int idx) |
|
void | unpack (int ix_h, int domain, int initial, int &r1_h, int &r2_h, int &p_h, int &r2to_h, bool fullp=false) |
| Return the dimensions given a certain index, domain type and initial position. More...
|
|
int | getConNumber (constrain *con) |
| Return the position in the cons vector. More...
|
|
void | copyInventoryResourses () |
| Copy the inventoried resources in the in vector for better performances. More...
|
|
void | tempDebug () |
|
void | debugPrintParameters () |
|