CppAD: A C++ Algorithmic Differentiation Package  20171217
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CppAD::ipopt::solve_callback< Dvector, ADvector, FG_eval > Class Template Reference

Class that Ipopt uses for obtaining information about this problem. More...

Inheritance diagram for CppAD::ipopt::solve_callback< Dvector, ADvector, FG_eval >:

Public Member Functions

virtual bool eval_f (Index n, const Number *x, bool new_x, Number &obj_value)
 Evaluate the objective fucntion f(x). More...
 
virtual bool eval_g (Index n, const Number *x, bool new_x, Index m, Number *g)
 Evaluate the function g(x). More...
 
virtual bool eval_grad_f (Index n, const Number *x, bool new_x, Number *grad_f)
 Evaluate the gradient of f(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)
 Evaluate the Hessian of the Lagragian. 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)
 Evaluate the Jacobian of g(x). More...
 
virtual void finalize_solution (Ipopt::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 Ipopt::IpoptData *ip_data, Ipopt::IpoptCalculatedQuantities *ip_cq)
 Pass solution information from Ipopt to users solution structure. More...
 
virtual bool get_bounds_info (Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u)
 Return bound information about optimization problem. More...
 
virtual bool get_nlp_info (Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, IndexStyleEnum &index_style)
 Return dimension information about optimization problem. 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)
 Return initial x value where optimiation is started. More...
 
 solve_callback (size_t nf, size_t nx, size_t ng, const Dvector &xi, const Dvector &xl, const Dvector &xu, const Dvector &gl, const Dvector &gu, FG_eval &fg_eval, bool retape, bool sparse_forward, bool sparse_reverse, solve_result< Dvector > &solution)
 Constructor for the interface between ipopt::solve and Ipopt. More...
 

Private Types

typedef Ipopt::Index Index
 An index value used by Ipopt. More...
 
typedef Ipopt::TNLP::IndexStyleEnum IndexStyleEnum
 Indexing style used in Ipopt sparsity structure. More...
 
typedef Ipopt::Number Number
 A Scalar value used by Ipopt. More...
 

Private Member Functions

void cache_new_x (const Number *x)
 Cache information for a new value of x. More...
 

Private Attributes

CppAD::ADFun< double > adfun_
 AD function object that evaluates x -> [ f(x) , g(x) ] If retape is false, this object is initialzed by constructor otherwise it is set by cache_new_x each time it is called. More...
 
CppAD::vector< size_t > col_hes_
 Column indices of Hessian left triangle in same order as row_hes_. (Set by constructor and not changed.) More...
 
CppAD::vector< size_t > col_jac_
 Column indices for Jacobian of g(x), same order as row_jac_. (Set by constructor and not changed.) More...
 
CppAD::vector< size_t > col_order_jac_
 col_order_jac_ sorts row_jac_ and col_jac_ in column order. (Set by constructor and not changed.) More...
 
Dvector fg0_
 value of fg corresponding to previous new_x More...
 
FG_eval & fg_eval_
 object that evaluates f(x) and g(x) More...
 
const Dvector & gl_
 lower limit for g(x) More...
 
const Dvector & gu_
 upper limit for g(x) More...
 
const size_t nf_
 dimension of the range space for f(x). The objective is sum_i f_i (x). Note that, at this point, there is no advantage having nf_ > 1. More...
 
const size_t ng_
 dimension of the range space for g(x) More...
 
const size_t nx_
 dimension of the domain space for f(x) and g(x) More...
 
CppAD::vectorBool pattern_hes_
 Sparsity pattern for Hessian of Lagragian

\[ L(x) = \sigma \sum_i f_i (x) + \sum_i \lambda_i g_i (x) \]

If sparse is true, this pattern set by constructor and does not change. Otherwise this vector has size zero. More...

 
CppAD::vectorBool pattern_jac_
 Sparsity pattern for Jacobian of [f(x), g(x) ]. If sparse is true, this pattern set by constructor and does not change. Otherwise this vector has size zero. More...
 
bool retape_
 should operation sequence be retaped for each new x. More...
 
CppAD::vector< size_t > row_hes_
 Row indices of Hessian lower left triangle in row order. (Set by constructor and not changed.) More...
 
CppAD::vector< size_t > row_jac_
 Row indices of [f(x), g(x)] for Jacobian of g(x) in row order. (Set by constructor and not changed.) More...
 
solve_result< Dvector > & solution_
 final results are returned to this structure More...
 
bool sparse_forward_
 Should sparse methods be used to compute Jacobians and Hessians with forward mode used for Jacobian. More...
 
bool sparse_reverse_
 Should sparse methods be used to compute Jacobians and Hessians with reverse mode used for Jacobian. More...
 
CppAD::sparse_hessian_work work_hes_
 Work vector used by SparseJacobian, stored here to avoid recalculation. More...
 
CppAD::sparse_jacobian_work work_jac_
 Work vector used by SparseJacobian, stored here to avoid recalculation. More...
 
Dvector x0_
 value of x corresponding to previous new_x More...
 
const Dvector & xi_
 initial value for x More...
 
const Dvector & xl_
 lower limit for x More...
 
const Dvector & xu_
 upper limit for x More...
 

Detailed Description

template<class Dvector, class ADvector, class FG_eval>
class CppAD::ipopt::solve_callback< Dvector, ADvector, FG_eval >

Class that Ipopt uses for obtaining information about this problem.

Evaluation Methods

The set of evaluation methods for this class is

     { eval_f, eval_grad_f, eval_g, eval_jac_g, eval_h }

Note that the bool return flag for the evaluations methods does not appear in the Ipopt documentation. Looking at the code, it seems to be a flag telling Ipopt to abort when the flag is false.

Definition at line 42 of file solve_callback.hpp.


The documentation for this class was generated from the following file: