Go to the documentation of this file.
9 #ifndef __IPSTDINTERFACETNLP_HPP__
10 #define __IPSTDINTERFACETNLP_HPP__
85 bool& use_x_scaling,
Index n,
87 bool& use_g_scaling,
Index m,
127 Number regularization_size,
const Number * start_z_U_
Pointer to Number array containing starting values for upper bound multipliers.
Bool(* Eval_H_CB)(Index n, Number *x, Bool new_x, Number obj_factor, Index m, Number *lambda, Bool new_lambda, Index nele_hess, Index *iRow, Index *jCol, Number *values, UserDataPtr user_data)
Type defining the callback function for evaluating the Hessian of the Lagrangian function.
virtual bool get_scaling_parameters(Number &obj_scaling, bool &use_x_scaling, Index n, Number *x_scaling, bool &use_g_scaling, Index m, Number *g_scaling)
returns scaling parameters (if nlp_scaling_method is selected as user-scaling).
const Number * start_z_L_
Pointer to Number array containing starting values for lower bound multipliers.
const Index index_style_
Starting value of the iRow and jCol parameters for matrices.
const Index n_var_
Number of variables.
Number Number Number Number Number Number UserDataPtr user_data
Pointer to user data.
Number * non_const_x_
A non-const copy of x - this is kept up-to-date in apply_new_x.
const Number * x_scaling_
Scaling factors for variables (if not NULL)
Class to organize all the data required by the algorithm.
virtual bool eval_grad_f(Index n, const Number *x, bool new_x, Number *grad_f)
evaluates the gradient of the objective for the nlp.
Number Number * x_U
Upper bounds on variables.
const Number * g_L_
Pointer to Number array containing lower bounds for constraints.
Intermediate_CB intermediate_cb
Number * x_L
Lower bounds on variables.
Bool(* Eval_F_CB)(Index n, Number *x, Bool new_x, Number *obj_value, UserDataPtr user_data)
Type defining the callback function for evaluating the value of the objective function.
const Index n_con_
Number of constraints.
void * UserDataPtr
A pointer for anything that is to be passed between the called and individual callback function.
const Number * x_L_
Pointer to Number array containing lower bounds for variables.
Class for all IPOPT specific calculated quantities.
Bool(* Eval_G_CB)(Index n, Number *x, Bool new_x, Index m, Number *g, UserDataPtr user_data)
Type defining the callback function for evaluating the value of the constraint functions.
double Number
Type of all numbers.
Number * x_sol_
Pointers to the user provided vectors for solution.
const Number * start_x_
Pointer to Number array containing starting point for variables.
StdInterfaceTNLP(Index n_var, const Number *x_L, const Number *x_U, Index n_con, const Number *g_L, const Number *g_U, Index nele_jac, Index nele_hess, Index index_style, const Number *start_x, const Number *start_lam, const Number *start_z_L, const Number *start_z_U, Eval_F_CB eval_f, Eval_G_CB eval_g, Eval_Grad_F_CB eval_grad_f, Eval_Jac_G_CB eval_jac_g, Eval_H_CB eval_h, Intermediate_CB intermediate_cb, Number *x_sol, Number *z_L_sol, Number *z_U_sol, Number *g_sol, Number *lam_sol, Number *obj_sol, UserDataPtr user_data, Number obj_scaling=1, const Number *x_scaling=NULL, const Number *g_scaling=NULL)
Constructor, given dimensions of problem, function pointers for evaluation callback functions,...
Number Number Index Number * g_L
Lower bounds on constraints.
const Index nele_hess_
Number of non-zero elements in the Hessian.
Number * x
Input: Starting point Output: Optimal solution.
const Number * g_scaling_
Scaling factors for constraints (if not NULL)
Number Number Index Number Number Index Index nele_hess
Number of non-zero elements in Hessian of Lagrangian.
Eval_F_CB eval_f_
Pointer to callback function evaluating value of objective function.
Number Number Index Number Number Index nele_jac
Number of non-zero elements in constraint Jacobian.
int Index
Type of all indices of vectors, matrices etc.
SmartPtr< const Journalist > jnlst_
Journlist.
Bool(* Eval_Jac_G_CB)(Index n, Number *x, Bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values, UserDataPtr user_data)
Type defining the callback function for evaluating the Jacobian of the constrant functions.
virtual bool eval_f(Index n, const Number *x, bool new_x, Number &obj_value)
evaluates the objective value for the nlp.
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)
provides a starting point for the nlp variables.
virtual bool eval_g(Index n, const Number *x, bool new_x, Index m, Number *g)
evaluates the constraint residuals for the nlp.
Template class for Smart Pointers.
Number obj_scaling_
Objective scaling factor.
Bool(* Intermediate_CB)(Index alg_mod, Index iter_count, 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, UserDataPtr user_data)
Type defining the callback function for giving intermediate execution control to the user.
StdInterfaceTNLP(const StdInterfaceTNLP &)
Copy Constructor.
const Number * g_U_
Pointer to Number array containing upper bounds for constraints.
StdInterfaceTNLP()
Default Constructor.
const Index nele_jac_
Number of non-zero elements in the constraint Jacobian.
const Number * start_lam_
Poitner to Number array containing starting values for constraint multipliers.
Eval_Grad_F_CB eval_grad_f_
Pointer to callback function evaluating gradient of objective function.
Intermediate_CB intermediate_cb_
Pointer to intermediate callback function giving control to user.
Base class for all NLP's that use standard triplet matrix form and dense vectors.
Number Number Number * g_scaling
UserDataPtr user_data_
Pointer to user data.
const Number * x_U_
Pointer to Number array containing upper bounds for variables.
Bool(* Eval_Grad_F_CB)(Index n, Number *x, Bool new_x, Number *grad_f, UserDataPtr user_data)
Type defining the callback function for evaluating the gradient of the objective function.
Number Number * g
Values of constraint at final point (output only - ignored if set to NULL)
IndexStyleEnum
overload this method to return the number of variables and constraints, and the number of non-zeros i...
Implementation of a TNLP for the Standard C interface.
Eval_H_CB eval_h_
Pointer to callback function evaluating Hessian of Lagrangian.
void operator=(const StdInterfaceTNLP &)
Overloaded Equals Operator.
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)
specifies the structure of the hessian of the lagrangian (if values is NULL) and evaluates the values...
Number Number Index Number Number * g_U
Upper bounds on constraints.
virtual bool get_bounds_info(Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u)
returns bounds of the nlp.
virtual ~StdInterfaceTNLP()
Default destructor.
SolverReturn
enum for the return from the optimize algorithm (obviously we need to add more)
virtual bool get_nlp_info(Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, IndexStyleEnum &index_style)
returns dimensions of the nlp.
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)
Intermediate Callback method for the user.
DECLARE_STD_EXCEPTION(SUFFIX_EMPTY)
Number Number Index Number Number Index Index Index index_style
indexing style for iRow & jCol, 0 for C style, 1 for Fortran style
void apply_new_x(bool new_x, Index n, const Number *x)
Internal function to update the internal and ampl state if the x value changes.
Eval_G_CB eval_g_
Pointer to callback function evaluating value of constraints.
AlgorithmMode
enum to indicate the mode in which the algorithm is
virtual bool eval_jac_g(Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values)
specifies the jacobian structure (if values is NULL) and evaluates the jacobian values (if values is ...
Number Number * x_scaling
Number Number Index m
Number of constraints.
Eval_Jac_G_CB eval_jac_g_
Pointer to callback function evaluating Jacobian of constraints.
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 when the algorithm is complete so the TNLP can store/write the solution.