Internal class to create a TNLP object, required for Ipopt minimization in c++, every method is overloaded to pass the information to Ipopt solvers.
Definition at line 99 of file IpoptMinimizer.h.
|
| InternalTNLP (IpoptMinimizer *minimizer) |
|
virtual | ~InternalTNLP () |
| default destructor More...
|
|
virtual bool | eval_f (Index n, const Number *x, bool new_x, Number &obj_value) |
| Return the value of the objective function at the point \( x\). More...
|
|
virtual bool | eval_g (Index n, const Number *x, bool new_x, Index m, Number *g) |
| Return the value of the constraint function at the point \( x\). More...
|
|
virtual bool | eval_grad_f (Index n, const Number *x, bool new_x, Number *grad_f) |
| Return the gradient of the objective function at the point \( x\). More...
|
|
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) |
| Return either the sparsity structure of the Hessian of the Lagrangian, or the values of the Hessian of the Lagrangian (9) for the given values for \( x\), \( \sigma_f\), and \( \lambda\). More...
|
|
virtual bool | eval_jac_g (Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values) |
| Return either the sparsity structure of the Jacobian of the constraints, or the values for the Jacobian of the constraints at the point \( x\). More...
|
|
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) |
| This method is called by IPOPT after the algorithm has finished (successfully or even with most errors). More...
|
|
virtual bool | get_bounds_info (Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u) |
| Give IPOPT the value of the bounds on the variables and constraints. More...
|
|
virtual bool | get_nlp_info (Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, IndexStyleEnum &index_style) |
| Give IPOPT the information about the size of the problem (and hence, the size of the arrays that it needs to allocate). More...
|
|
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) |
| Give IPOPT the starting point before it begins iterating. More...
|
|
virtual bool ROOT::Math::IpoptMinimizer::InternalTNLP::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 |
Return either the sparsity structure of the Hessian of the Lagrangian, or the values of the Hessian of the Lagrangian (9) for the given values for \( x\), \( \sigma_f\), and \( \lambda\).
- Parameters
-
n | (in), the number of variables in the problem (dimension of \( x\)). |
x | (in), the values for the primal variables, \( x\), at which the Hessian is to be evaluated. |
new_x | (in), false if any evaluation method was previously called with the same values in x, true otherwise. |
obj_factor | (in), factor in front of the objective term in the Hessian, \( \sigma_f\). |
m | (in), the number of constraints in the problem (dimension of \( g(x)\)). |
lambda | (in), the values for the constraint multipliers, \( \lambda\), at which the Hessian is to be evaluated. |
new_lambda | (in), false if any evaluation method was previously called with the same values in lambda, true otherwise. |
nele_hess | (in), the number of nonzero elements in the Hessian (dimension of iRow, jCol, and values). |
iRow | (out), the row indices of entries in the Hessian. |
jCol | (out), the column indices of entries in the Hessian. |
values | (out), the values of the entries in the Hessian. |
The Hessian matrix that IPOPT uses is defined in (9). See Appendix A for a discussion of the sparse symmetric matrix format used in this method.
If the iRow and jCol arguments are not NULL, then IPOPT wants you to fill in the sparsity structure of the Hessian (the row and column indices for the lower or upper triangular part only). In this case, the x, lambda, and values arrays will be NULL.
- Returns
- true if everything is right, false in other case.
virtual bool ROOT::Math::IpoptMinimizer::InternalTNLP::eval_jac_g |
( |
Index |
n, |
|
|
const Number * |
x, |
|
|
bool |
new_x, |
|
|
Index |
m, |
|
|
Index |
nele_jac, |
|
|
Index * |
iRow, |
|
|
Index * |
jCol, |
|
|
Number * |
values |
|
) |
| |
|
virtual |
Return either the sparsity structure of the Jacobian of the constraints, or the values for the Jacobian of the constraints at the point \( x\).
- Parameters
-
n | (in), the number of variables in the problem (dimension of \( x\)). |
x | (in), the values for the primal variables, \( x\), at which the constraint Jacobian, \( \nabla g(x)^T\), is to be evaluated. |
new_x | (in), false if any evaluation method was previously called with the same values in x, true otherwise. |
m | (in), the number of constraints in the problem (dimension of \( g(x)\)). |
n_ele_jac | (in), the number of nonzero elements in the Jacobian (dimension of iRow, jCol, and values). |
iRow | (out), the row indices of entries in the Jacobian of the constraints. |
jCol | (out), the column indices of entries in the Jacobian of the constraints. |
values | (out), the values of the entries in the Jacobian of the constraints. The Jacobian is the matrix of derivatives where the derivative of constraint \( g^{(i)}\) with respect to variable \( x^{(j)}\) is placed in row \( i\) and column \( j\). See Appendix A for a discussion of the sparse matrix format used in this method. |
If the iRow and jCol arguments are not NULL, then IPOPT wants you to fill in the sparsity structure of the Jacobian (the row and column indices only). At this time, the x argument and the values argument will be NULL.
If the x argument and the values argument are not NULL, then IPOPT wants you to fill in the values of the Jacobian as calculated from the array x (using the same order as you used when specifying the sparsity structure). At this time, the iRow and jCol arguments will be NULL;
The boolean variable new_x will be false if the last call to any of the evaluation methods (eval_*) used the same \( x\) values. This can be helpful when users have efficient implementations that calculate multiple outputs at once. IPOPT internally caches results from the TNLP and generally, this flag can be ignored.
The variables n, m, and nele_jac are passed in for your convenience. These arguments will have the same values you specified in get_nlp_info.
- Returns
- true if everything is right, false in other case.
virtual bool ROOT::Math::IpoptMinimizer::InternalTNLP::get_bounds_info |
( |
Index |
n, |
|
|
Number * |
x_l, |
|
|
Number * |
x_u, |
|
|
Index |
m, |
|
|
Number * |
g_l, |
|
|
Number * |
g_u |
|
) |
| |
|
virtual |
Give IPOPT the value of the bounds on the variables and constraints.
The values of n and m that you specified in get_nlp_info are passed to you for debug checking. Setting a lower bound to a value less than or equal to the value of the option nlp_lower_bound_inf will cause IPOPT to assume no lower bound. Likewise, specifying the upper bound above or equal to the value of the option nlp_upper_bound_inf will cause IPOPT to assume no upper bound. These options, nlp_lower_bound_inf and nlp_upper_bound_inf, are set to \( -10^{19}\) and \( 10^{19}\), respectively, by default.
- Parameters
-
n | (in), the number of variables in the problem (dimension of \( x\)). |
x_l | (out) the lower bounds \( x^L\) for \( x\). |
x_u | (out) the upper bounds \( x^U\) for \( x\). |
m | (in), the number of constraints in the problem (dimension of \( g(x)\)). |
g_l | (out) the lower bounds \( g^L\) for \( g(x)\). |
g_u | (out) the upper bounds \( g^U\) for \( g(x)\). |
- Returns
- true if everything is right, false in other case.
virtual bool ROOT::Math::IpoptMinimizer::InternalTNLP::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 |
|
) |
| |
|
virtual |
Give IPOPT the starting point before it begins iterating.
The variables n and m are passed in for your convenience. These variables will have the same values you specified in get_nlp_info. Depending on the options that have been set, IPOPT may or may not require bounds for the primal variables \( x\), the bound multipliers \( z^L\) and \( z^U\), and the constraint multipliers \( \lambda \). The boolean flags init_x, init_z, and init_lambda tell you whether or not you should provide initial values for \( x\), \( z^L\), \( z^U\), or \( \lambda \) respectively. The default options only require an initial value for the primal variables \( x\). Note, the initial values for bound multiplier components for ``infinity'' bounds ( \( x_L^{(i)}=-\infty \) or \( x_U^{(i)}=\infty \)) are ignored.
- Parameters
-
n | (in), the number of variables in the problem (dimension of \( x\)). |
init_x | (in), if true, this method must provide an initial value for \( x\). |
x | (out), the initial values for the primal variables, \( x\). |
init_z | (in), if true, this method must provide an initial value for the bound multipliers \( z^L\) and \( z^U\). |
z_L | (out), the initial values for the bound multipliers, \( z^L\). |
z_U | (out), the initial values for the bound multipliers, \( z^U\). |
m | (in), the number of constraints in the problem (dimension of \( g(x)\)). |
init_lambda | (in), if true, this method must provide an initial value for the constraint multipliers, \( \lambda\). |
lambda | (out), the initial values for the constraint multipliers, \( \lambda\). |
- Returns
- true if everything is right, false in other case.