Ipopt Documentation  
 
Loading...
Searching...
No Matches
Ipopt::IpoptNLP Class Referenceabstract

This is the abstract base class for classes that map the traditional NLP into something that is more useful for Ipopt. More...

#include <IpIpoptNLP.hpp>

+ Inheritance diagram for Ipopt::IpoptNLP:

Public Member Functions

virtual bool Initialize (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Initialization method.
 
virtual bool InitializeStructures (SmartPtr< Vector > &x, bool init_x, SmartPtr< Vector > &y_c, bool init_y_c, SmartPtr< Vector > &y_d, bool init_y_d, SmartPtr< Vector > &z_L, bool init_z_L, SmartPtr< Vector > &z_U, bool init_z_U, SmartPtr< Vector > &v_L, SmartPtr< Vector > &v_U)=0
 Initialize (create) structures for the iteration data.
 
virtual bool GetWarmStartIterate (IteratesVector &warm_start_iterate)=0
 Method accessing the GetWarmStartIterate of the NLP.
 
virtual void GetSpaces (SmartPtr< const VectorSpace > &x_space, SmartPtr< const VectorSpace > &c_space, SmartPtr< const VectorSpace > &d_space, SmartPtr< const VectorSpace > &x_l_space, SmartPtr< const MatrixSpace > &px_l_space, SmartPtr< const VectorSpace > &x_u_space, SmartPtr< const MatrixSpace > &px_u_space, SmartPtr< const VectorSpace > &d_l_space, SmartPtr< const MatrixSpace > &pd_l_space, SmartPtr< const VectorSpace > &d_u_space, SmartPtr< const MatrixSpace > &pd_u_space, SmartPtr< const MatrixSpace > &Jac_c_space, SmartPtr< const MatrixSpace > &Jac_d_space, SmartPtr< const SymMatrixSpace > &Hess_lagrangian_space)=0
 Accessor method for vector/matrix spaces pointers.
 
virtual void AdjustVariableBounds (const Vector &new_x_L, const Vector &new_x_U, const Vector &new_d_L, const Vector &new_d_U)=0
 Method for adapting the variable bounds.
 
SmartPtr< NLPScalingObjectNLP_scaling () const
 Returns the scaling strategy object.
 
Constructors/Destructors
 IpoptNLP (const SmartPtr< NLPScalingObject > nlp_scaling)
 
virtual ~IpoptNLP ()
 Destructor.
 
Possible Exceptions
 DECLARE_STD_EXCEPTION (Eval_Error)
 thrown if there is any error evaluating values from the nlp
 
virtual Number f (const Vector &x)=0
 Accessor methods for model data.
 
virtual SmartPtr< const Vectorgrad_f (const Vector &x)=0
 Gradient of the objective.
 
virtual SmartPtr< const Vectorc (const Vector &x)=0
 Equality constraint residual.
 
virtual SmartPtr< const Matrixjac_c (const Vector &x)=0
 Jacobian Matrix for equality constraints.
 
virtual SmartPtr< const Vectord (const Vector &x)=0
 Inequality constraint residual (reformulated as equalities with slacks.
 
virtual SmartPtr< const Matrixjac_d (const Vector &x)=0
 Jacobian Matrix for inequality constraints.
 
virtual SmartPtr< const SymMatrixh (const Vector &x, Number obj_factor, const Vector &yc, const Vector &yd)=0
 Hessian of the Lagrangian.
 
virtual SmartPtr< const Vectorx_L () const =0
 Lower bounds on x.
 
virtual SmartPtr< const MatrixPx_L () const =0
 Permutation matrix (x_L_ -> x)
 
virtual SmartPtr< const Vectorx_U () const =0
 Upper bounds on x.
 
virtual SmartPtr< const MatrixPx_U () const =0
 Permutation matrix (x_U_ -> x.
 
virtual SmartPtr< const Vectord_L () const =0
 Lower bounds on d.
 
virtual SmartPtr< const MatrixPd_L () const =0
 Permutation matrix (d_L_ -> d)
 
virtual SmartPtr< const Vectord_U () const =0
 Upper bounds on d.
 
virtual SmartPtr< const MatrixPd_U () const =0
 Permutation matrix (d_U_ -> d.
 
virtual SmartPtr< const VectorSpacex_space () const =0
 x_space
 
virtual SmartPtr< const SymMatrixSpaceHessianMatrixSpace () const =0
 Accessor method to obtain the MatrixSpace for the Hessian matrix (or it's approximation)
 
Counters for the number of function evaluations.
virtual Index f_evals () const =0
 
virtual Index grad_f_evals () const =0
 
virtual Index c_evals () const =0
 
virtual Index jac_c_evals () const =0
 
virtual Index d_evals () const =0
 
virtual Index jac_d_evals () const =0
 
virtual Index h_evals () const =0
 
Special method for dealing with the fact that the

restoration phase objective function depends on the barrier parameter

virtual bool objective_depends_on_mu () const
 Method for telling the IpoptCalculatedQuantities class whether the objective function depends on the barrier function.
 
virtual Number f (const Vector &x, Number mu)=0
 Replacement for the default objective function method which knows about the barrier parameter.
 
virtual SmartPtr< const Vectorgrad_f (const Vector &x, Number mu)=0
 Replacement for the default objective gradient method which knows about the barrier parameter.
 
virtual SmartPtr< const SymMatrixh (const Vector &x, Number obj_factor, const Vector &yc, const Vector &yd, Number mu)=0
 Replacement for the default Lagrangian Hessian method which knows about the barrier parameter.
 
virtual SmartPtr< const SymMatrixuninitialized_h ()=0
 Provides a Hessian matrix from the correct matrix space with uninitialized values.
 
solution routines
virtual void FinalizeSolution (SolverReturn status, const Vector &x, const Vector &z_L, const Vector &z_U, const Vector &c, const Vector &d, const Vector &y_c, const Vector &y_d, Number obj_value, const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq)=0
 
virtual bool IntermediateCallBack (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, SmartPtr< const IpoptData > ip_data, SmartPtr< IpoptCalculatedQuantities > ip_cq)=0
 
- Public Member Functions inherited from Ipopt::ReferencedObject
 ReferencedObject ()
 
virtual ~ReferencedObject ()
 
Index ReferenceCount () const
 
void AddRef (const Referencer *referencer) const
 
void ReleaseRef (const Referencer *referencer) const
 

Private Member Functions

Default Compiler Generated Methods

(Hidden to avoid implicit creation/calling).

These methods are not implemented and we do not want the compiler to implement them for us, so we declare them private and do not define them. This ensures that they will not be implicitly created/called.

 IpoptNLP (const IpoptNLP &)
 Copy Constructor.
 
void operator= (const IpoptNLP &)
 Default Assignment Operator.
 

Private Attributes

SmartPtr< NLPScalingObjectnlp_scaling_
 

Detailed Description

This is the abstract base class for classes that map the traditional NLP into something that is more useful for Ipopt.

As for NLP, the represented NLP is

\begin{eqnarray*} \mathrm{min} && f(x), \\ \mathrm{s.t.} && c(x) = 0, &\qquad y_c\\ && d_L \leq d(x) \leq d_U, &\qquad y_d \\ && x_L \leq x \leq x_U, &\qquad z_L, z_U \end{eqnarray*}

where \(y_c\), \(y_d\), \(z_L\), \(z_U\) name the dual variables of the corresponding constraints.

This class takes care of storing the calculated model results, handles caching, scaling, and (some day) takes care of addition of slacks.

Definition at line 35 of file IpIpoptNLP.hpp.

Constructor & Destructor Documentation

◆ IpoptNLP() [1/2]

Ipopt::IpoptNLP::IpoptNLP ( const SmartPtr< NLPScalingObject nlp_scaling)
inline

Definition at line 40 of file IpIpoptNLP.hpp.

◆ ~IpoptNLP()

virtual Ipopt::IpoptNLP::~IpoptNLP ( )
inlinevirtual

Destructor.

Definition at line 47 of file IpIpoptNLP.hpp.

◆ IpoptNLP() [2/2]

Ipopt::IpoptNLP::IpoptNLP ( const IpoptNLP )
private

Copy Constructor.

Member Function Documentation

◆ Initialize()

virtual bool Ipopt::IpoptNLP::Initialize ( const Journalist jnlst,
const OptionsList options,
const std::string &  prefix 
)
inlinevirtual

Initialization method.

Set the internal options and initialize internal data structures.

Reimplemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

Definition at line 55 of file IpIpoptNLP.hpp.

◆ DECLARE_STD_EXCEPTION()

Ipopt::IpoptNLP::DECLARE_STD_EXCEPTION ( Eval_Error  )

thrown if there is any error evaluating values from the nlp

◆ InitializeStructures()

virtual bool Ipopt::IpoptNLP::InitializeStructures ( SmartPtr< Vector > &  x,
bool  init_x,
SmartPtr< Vector > &  y_c,
bool  init_y_c,
SmartPtr< Vector > &  y_d,
bool  init_y_d,
SmartPtr< Vector > &  z_L,
bool  init_z_L,
SmartPtr< Vector > &  z_U,
bool  init_z_U,
SmartPtr< Vector > &  v_L,
SmartPtr< Vector > &  v_U 
)
pure virtual

Initialize (create) structures for the iteration data.

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ GetWarmStartIterate()

virtual bool Ipopt::IpoptNLP::GetWarmStartIterate ( IteratesVector warm_start_iterate)
pure virtual

Method accessing the GetWarmStartIterate of the NLP.

Implemented in Ipopt::RestoIpoptNLP, and Ipopt::OrigIpoptNLP.

◆ f() [1/2]

virtual Number Ipopt::IpoptNLP::f ( const Vector x)
pure virtual

Accessor methods for model data.

Objective value

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ grad_f() [1/2]

virtual SmartPtr< const Vector > Ipopt::IpoptNLP::grad_f ( const Vector x)
pure virtual

Gradient of the objective.

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ c()

virtual SmartPtr< const Vector > Ipopt::IpoptNLP::c ( const Vector x)
pure virtual

Equality constraint residual.

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ jac_c()

virtual SmartPtr< const Matrix > Ipopt::IpoptNLP::jac_c ( const Vector x)
pure virtual

Jacobian Matrix for equality constraints.

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ d()

virtual SmartPtr< const Vector > Ipopt::IpoptNLP::d ( const Vector x)
pure virtual

Inequality constraint residual (reformulated as equalities with slacks.

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ jac_d()

virtual SmartPtr< const Matrix > Ipopt::IpoptNLP::jac_d ( const Vector x)
pure virtual

Jacobian Matrix for inequality constraints.

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ h() [1/2]

virtual SmartPtr< const SymMatrix > Ipopt::IpoptNLP::h ( const Vector x,
Number  obj_factor,
const Vector yc,
const Vector yd 
)
pure virtual

Hessian of the Lagrangian.

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ x_L()

virtual SmartPtr< const Vector > Ipopt::IpoptNLP::x_L ( ) const
pure virtual

Lower bounds on x.

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ Px_L()

virtual SmartPtr< const Matrix > Ipopt::IpoptNLP::Px_L ( ) const
pure virtual

Permutation matrix (x_L_ -> x)

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ x_U()

virtual SmartPtr< const Vector > Ipopt::IpoptNLP::x_U ( ) const
pure virtual

Upper bounds on x.

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ Px_U()

virtual SmartPtr< const Matrix > Ipopt::IpoptNLP::Px_U ( ) const
pure virtual

Permutation matrix (x_U_ -> x.

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ d_L()

virtual SmartPtr< const Vector > Ipopt::IpoptNLP::d_L ( ) const
pure virtual

Lower bounds on d.

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ Pd_L()

virtual SmartPtr< const Matrix > Ipopt::IpoptNLP::Pd_L ( ) const
pure virtual

Permutation matrix (d_L_ -> d)

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ d_U()

virtual SmartPtr< const Vector > Ipopt::IpoptNLP::d_U ( ) const
pure virtual

Upper bounds on d.

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ Pd_U()

virtual SmartPtr< const Matrix > Ipopt::IpoptNLP::Pd_U ( ) const
pure virtual

Permutation matrix (d_U_ -> d.

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ x_space()

virtual SmartPtr< const VectorSpace > Ipopt::IpoptNLP::x_space ( ) const
pure virtual

x_space

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ HessianMatrixSpace()

virtual SmartPtr< const SymMatrixSpace > Ipopt::IpoptNLP::HessianMatrixSpace ( ) const
pure virtual

Accessor method to obtain the MatrixSpace for the Hessian matrix (or it's approximation)

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ GetSpaces()

virtual void Ipopt::IpoptNLP::GetSpaces ( SmartPtr< const VectorSpace > &  x_space,
SmartPtr< const VectorSpace > &  c_space,
SmartPtr< const VectorSpace > &  d_space,
SmartPtr< const VectorSpace > &  x_l_space,
SmartPtr< const MatrixSpace > &  px_l_space,
SmartPtr< const VectorSpace > &  x_u_space,
SmartPtr< const MatrixSpace > &  px_u_space,
SmartPtr< const VectorSpace > &  d_l_space,
SmartPtr< const MatrixSpace > &  pd_l_space,
SmartPtr< const VectorSpace > &  d_u_space,
SmartPtr< const MatrixSpace > &  pd_u_space,
SmartPtr< const MatrixSpace > &  Jac_c_space,
SmartPtr< const MatrixSpace > &  Jac_d_space,
SmartPtr< const SymMatrixSpace > &  Hess_lagrangian_space 
)
pure virtual

Accessor method for vector/matrix spaces pointers.

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ AdjustVariableBounds()

virtual void Ipopt::IpoptNLP::AdjustVariableBounds ( const Vector new_x_L,
const Vector new_x_U,
const Vector new_d_L,
const Vector new_d_U 
)
pure virtual

Method for adapting the variable bounds.

This is called if slacks are becoming too small

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ f_evals()

virtual Index Ipopt::IpoptNLP::f_evals ( ) const
pure virtual

◆ grad_f_evals()

virtual Index Ipopt::IpoptNLP::grad_f_evals ( ) const
pure virtual

◆ c_evals()

virtual Index Ipopt::IpoptNLP::c_evals ( ) const
pure virtual

◆ jac_c_evals()

virtual Index Ipopt::IpoptNLP::jac_c_evals ( ) const
pure virtual

◆ d_evals()

virtual Index Ipopt::IpoptNLP::d_evals ( ) const
pure virtual

◆ jac_d_evals()

virtual Index Ipopt::IpoptNLP::jac_d_evals ( ) const
pure virtual

◆ h_evals()

virtual Index Ipopt::IpoptNLP::h_evals ( ) const
pure virtual

◆ objective_depends_on_mu()

virtual bool Ipopt::IpoptNLP::objective_depends_on_mu ( ) const
inlinevirtual

Method for telling the IpoptCalculatedQuantities class whether the objective function depends on the barrier function.

This is only used for the restoration phase NLP formulation. Probably only RestoIpoptNLP should overwrite this.

Reimplemented in Ipopt::RestoIpoptNLP.

Definition at line 220 of file IpIpoptNLP.hpp.

◆ f() [2/2]

virtual Number Ipopt::IpoptNLP::f ( const Vector x,
Number  mu 
)
pure virtual

Replacement for the default objective function method which knows about the barrier parameter.

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ grad_f() [2/2]

virtual SmartPtr< const Vector > Ipopt::IpoptNLP::grad_f ( const Vector x,
Number  mu 
)
pure virtual

Replacement for the default objective gradient method which knows about the barrier parameter.

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ h() [2/2]

virtual SmartPtr< const SymMatrix > Ipopt::IpoptNLP::h ( const Vector x,
Number  obj_factor,
const Vector yc,
const Vector yd,
Number  mu 
)
pure virtual

Replacement for the default Lagrangian Hessian method which knows about the barrier parameter.

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ uninitialized_h()

virtual SmartPtr< const SymMatrix > Ipopt::IpoptNLP::uninitialized_h ( )
pure virtual

Provides a Hessian matrix from the correct matrix space with uninitialized values.

This can be used in LeastSquareMults to obtain a "zero Hessian".

Implemented in Ipopt::OrigIpoptNLP, and Ipopt::RestoIpoptNLP.

◆ FinalizeSolution()

virtual void Ipopt::IpoptNLP::FinalizeSolution ( SolverReturn  status,
const Vector x,
const Vector z_L,
const Vector z_U,
const Vector c,
const Vector d,
const Vector y_c,
const Vector y_d,
Number  obj_value,
const IpoptData ip_data,
IpoptCalculatedQuantities ip_cq 
)
pure virtual

◆ IntermediateCallBack()

virtual bool Ipopt::IpoptNLP::IntermediateCallBack ( 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,
SmartPtr< const IpoptData ip_data,
SmartPtr< IpoptCalculatedQuantities ip_cq 
)
pure virtual

◆ NLP_scaling()

SmartPtr< NLPScalingObject > Ipopt::IpoptNLP::NLP_scaling ( ) const
inline

Returns the scaling strategy object.

Definition at line 294 of file IpIpoptNLP.hpp.

◆ operator=()

void Ipopt::IpoptNLP::operator= ( const IpoptNLP )
private

Default Assignment Operator.

Member Data Documentation

◆ nlp_scaling_

SmartPtr<NLPScalingObject> Ipopt::IpoptNLP::nlp_scaling_
private

Definition at line 323 of file IpIpoptNLP.hpp.


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