7 #ifndef __IPSTDINTERFACETNLP_HPP__ 8 #define __IPSTDINTERFACETNLP_HPP__ 67 const Number* x_scaling = NULL,
68 const Number* g_scaling = NULL
174 Number regularization_size,
227 Number* nlp_constraint_violation,
231 return TNLP::get_curr_violations(
ip_data_,
ip_cq_, scaled, n, x_L_violation, x_U_violation, compl_x_L, compl_x_U, grad_lag_x, m, nlp_constraint_violation, compl_g);
const Number * x_U_
Pointer to Number array containing upper bounds for variables.
const Index nele_hess_
Number of non-zero elements in the Hessian.
Implementation of a TNLP for the Standard C interface.
Class for all IPOPT specific calculated quantities.
StdInterfaceTNLP()
Default Constructor.
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)
Method to request either the sparsity structure or the values of the Hessian of the Lagrangian...
Eval_F_CB eval_f_
Pointer to callback function evaluating value of objective function.
const Number * start_z_U_
Pointer to Number array containing starting values for upper bound multipliers.
const Index index_style_
Starting value of the iRow and jCol parameters for matrices.
const IpoptData * ip_data_
const Number * x_scaling_
Scaling factors for variables (if not NULL)
Number * non_const_x_
A non-const copy of x - this is kept up-to-date in apply_new_x.
const Number * start_x_
Pointer to Number array containing starting point for variables.
virtual bool eval_g(Index n, const Number *x, bool new_x, Index m, Number *g)
Method to request the constraint values.
AlgorithmMode
enum to indicate the mode in which the algorithm is
DECLARE_STD_EXCEPTION(FATAL_ERROR_IN_LINEAR_SOLVER)
bool(* Eval_Jac_G_CB)(ipindex n, ipnumber *x, bool new_x, ipindex m, ipindex nele_jac, ipindex *iRow, ipindex *jCol, ipnumber *values, UserDataPtr user_data)
Type defining the callback function for evaluating the Jacobian of the constrant functions.
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)
Method to request scaling parameters.
const Index nele_jac_
Number of non-zero elements in the constraint Jacobian.
bool get_curr_violations(bool scaled, Index n, Number *x_L_violation, Number *x_U_violation, Number *compl_x_L, Number *compl_x_U, Number *grad_lag_x, Index m, Number *nlp_constraint_violation, Number *compl_g) const
get_curr_violations() to be called by GetIpoptCurrentViolations()
bool(* Eval_F_CB)(ipindex n, ipnumber *x, bool new_x, ipnumber *obj_value, UserDataPtr user_data)
Type defining the callback function for evaluating the value of the objective function.
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 has finished (successfully or not) so the TNLP can digest th...
IpoptCalculatedQuantities * ip_cq_
ipindex Index
Type of all indices of vectors, matrices etc.
This file contains a base class for all exceptions and a set of macros to help with exceptions...
bool(* Intermediate_CB)(ipindex alg_mod, ipindex iter_count, ipnumber obj_value, ipnumber inf_pr, ipnumber inf_du, ipnumber mu, ipnumber d_norm, ipnumber regularization_size, ipnumber alpha_du, ipnumber alpha_pr, ipindex ls_trials, UserDataPtr user_data)
Type defining the callback function for giving intermediate execution control to the user...
bool(* Eval_H_CB)(ipindex n, ipnumber *x, bool new_x, ipnumber obj_factor, ipindex m, ipnumber *lambda, bool new_lambda, ipindex nele_hess, ipindex *iRow, ipindex *jCol, ipnumber *values, UserDataPtr user_data)
Type defining the callback function for evaluating the Hessian of the Lagrangian function.
Template class for Smart Pointers.
Number obj_scaling_
Objective scaling factor.
const Number * g_U_
Pointer to Number array containing upper bounds for constraints.
Eval_G_CB eval_g_
Pointer to callback function evaluating value of constraints.
SolverReturn
enum for the return from the optimize algorithm
virtual bool eval_jac_g(Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values)
Method to request either the sparsity structure or the values of the Jacobian of the constraints...
const Index n_con_
Number of constraints.
const Number * start_lam_
Pointer to Number array containing starting values for constraint multipliers.
bool get_curr_iterate(Bool scaled, Index n, Number *x, Number *z_L, Number *z_U, Index m, Number *g, Number *lambda) const
get_curr_iterate() to be called by GetIpoptCurrentIterate()
SmartPtr< const Journalist > jnlst_
Journalist.
Eval_Grad_F_CB eval_grad_f_
Pointer to callback function evaluating gradient of objective function.
Class to organize all the data required by the algorithm.
ipnumber Number
Type of all numbers.
virtual bool eval_grad_f(Index n, const Number *x, bool new_x, Number *grad_f)
Method to request the gradient of the objective function.
virtual bool get_bounds_info(Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u)
Method to request bounds on the variables and constraints.
Eval_Jac_G_CB eval_jac_g_
Pointer to callback function evaluating Jacobian of constraints.
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)
Method to request the starting point before iterating.
bool get_curr_iterate(const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq, bool scaled, Index n, Number *x, Number *z_L, Number *z_U, Index m, Number *g, Number *lambda) const
Get primal and dual variable values of the current iterate.
virtual bool eval_f(Index n, const Number *x, bool new_x, Number &obj_value)
Method to request the value of the objective function.
const Index n_var_
Number of variables.
Intermediate_CB intermediate_cb_
Pointer to intermediate callback function giving control to user.
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.
bool Bool
define a boolean type for C
virtual bool get_nlp_info(Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, IndexStyleEnum &index_style)
Method to request the initial information about the problem.
const Number * g_L_
Pointer to Number array containing lower bounds for constraints.
UserDataPtr user_data_
Pointer to user data.
Base class for all NLP's that use standard triplet matrix form and dense vectors. ...
void * UserDataPtr
A pointer for anything that is to be passed between the called and individual callback function...
Eval_H_CB eval_h_
Pointer to callback function evaluating Hessian of Lagrangian.
void apply_new_x(bool new_x, Index n, const Number *x)
Update the internal state if the x value changes.
const Number * x_L_
Pointer to Number array containing lower bounds for variables.
const Number * g_scaling_
Scaling factors for constraints (if not NULL)
void operator=(const StdInterfaceTNLP &)
Default Assignment Operator.
const Number * start_z_L_
Pointer to Number array containing starting values for lower bound multipliers.
bool(* Eval_Grad_F_CB)(ipindex n, ipnumber *x, bool new_x, ipnumber *grad_f, UserDataPtr user_data)
Type defining the callback function for evaluating the gradient of the objective function.
bool get_curr_violations(const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq, bool scaled, Index n, Number *x_L_violation, Number *x_U_violation, Number *compl_x_L, Number *compl_x_U, Number *grad_lag_x, Index m, Number *nlp_constraint_violation, Number *compl_g) const
Get primal and dual infeasibility of the current iterate.
bool(* Eval_G_CB)(ipindex n, ipnumber *x, bool new_x, ipindex m, ipnumber *g, UserDataPtr user_data)
Type defining the callback function for evaluating the value of the constraint functions.
virtual ~StdInterfaceTNLP()
Default destructor.