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

Traditional NLP. More...

#include <IpNLP.hpp>

+ Inheritance diagram for Ipopt::NLP:

Public Member Functions

virtual void GetQuasiNewtonApproximationSpaces (SmartPtr< VectorSpace > &approx_space, SmartPtr< Matrix > &P_approx)
 Method for obtaining the subspace in which the limited-memory Hessian approximation should be done.
 
Constructors/Destructors
 NLP ()
 Default constructor.
 
virtual ~NLP ()
 Default destructor.
 
 DECLARE_STD_EXCEPTION (USER_SCALING_NOT_IMPLEMENTED)
 Exceptions.
 
 DECLARE_STD_EXCEPTION (INVALID_NLP)
 
NLP Initialization (overload in derived classes).
virtual bool ProcessOptions (const OptionsList &, const std::string &)
 Overload if you want the chance to process options or parameters that may be specific to the NLP.
 
virtual bool 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
 Method for creating the derived vector / matrix types.
 
virtual bool GetBoundsInformation (const Matrix &Px_L, Vector &x_L, const Matrix &Px_U, Vector &x_U, const Matrix &Pd_L, Vector &d_L, const Matrix &Pd_U, Vector &d_U)=0
 Method for obtaining the bounds information.
 
virtual bool GetStartingPoint (SmartPtr< Vector > x, bool need_x, SmartPtr< Vector > y_c, bool need_y_c, SmartPtr< Vector > y_d, bool need_y_d, SmartPtr< Vector > z_L, bool need_z_L, SmartPtr< Vector > z_U, bool need_z_U)=0
 Method for obtaining the starting point for all the iterates.
 
virtual bool GetWarmStartIterate (IteratesVector &)
 Method for obtaining an entire iterate as a warmstart point.
 
NLP evaluation routines (overload in derived classes).
virtual bool Eval_f (const Vector &x, Number &f)=0
 
virtual bool Eval_grad_f (const Vector &x, Vector &g_f)=0
 
virtual bool Eval_c (const Vector &x, Vector &c)=0
 
virtual bool Eval_jac_c (const Vector &x, Matrix &jac_c)=0
 
virtual bool Eval_d (const Vector &x, Vector &d)=0
 
virtual bool Eval_jac_d (const Vector &x, Matrix &jac_d)=0
 
virtual bool Eval_h (const Vector &x, Number obj_factor, const Vector &yc, const Vector &yd, SymMatrix &h)=0
 
NLP solution routines.

Have default dummy implementations that can be overloaded.

virtual void FinalizeSolution (SolverReturn, const Vector &, const Vector &, const Vector &, const Vector &, const Vector &, const Vector &, const Vector &, Number, const IpoptData *, IpoptCalculatedQuantities *)
 This method is called at the very end of the optimization.
 
virtual bool IntermediateCallBack (AlgorithmMode, Index, Number, Number, Number, Number, Number, Number, Number, Number, Index, const IpoptData *, IpoptCalculatedQuantities *)
 This method is called once per iteration, after the iteration summary output has been printed.
 
virtual void GetScalingParameters (const SmartPtr< const VectorSpace >, const SmartPtr< const VectorSpace >, const SmartPtr< const VectorSpace >, Number &, SmartPtr< Vector > &, SmartPtr< Vector > &, SmartPtr< Vector > &) const
 Routines to get the scaling parameters.
 
- 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.

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

Detailed Description

Traditional NLP.

Represents NLPs of the form

\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.

A prominent implementation of a NLP is TNLPAdapter.

A traditional NLP is wrapper into a IpoptNLP, e.g., OrigIpoptNLP.

Definition at line 41 of file IpNLP.hpp.

Constructor & Destructor Documentation

◆ NLP() [1/2]

Ipopt::NLP::NLP ( )
inline

Default constructor.

Definition at line 47 of file IpNLP.hpp.

◆ ~NLP()

virtual Ipopt::NLP::~NLP ( )
inlinevirtual

Default destructor.

Definition at line 51 of file IpNLP.hpp.

◆ NLP() [2/2]

Ipopt::NLP::NLP ( const NLP )
private

Copy Constructor.

Member Function Documentation

◆ DECLARE_STD_EXCEPTION() [1/2]

Ipopt::NLP::DECLARE_STD_EXCEPTION ( USER_SCALING_NOT_IMPLEMENTED  )

Exceptions.

◆ DECLARE_STD_EXCEPTION() [2/2]

Ipopt::NLP::DECLARE_STD_EXCEPTION ( INVALID_NLP  )

◆ ProcessOptions()

virtual bool Ipopt::NLP::ProcessOptions ( const OptionsList ,
const std::string &   
)
inlinevirtual

Overload if you want the chance to process options or parameters that may be specific to the NLP.

Reimplemented in Ipopt::NLPBoundsRemover, and Ipopt::TNLPAdapter.

Definition at line 64 of file IpNLP.hpp.

◆ GetSpaces()

virtual bool Ipopt::NLP::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

Method for creating the derived vector / matrix types.

The Hess_lagrangian_space pointer can be NULL if a quasi-Newton options is chosen.

Implemented in Ipopt::NLPBoundsRemover, and Ipopt::TNLPAdapter.

◆ GetBoundsInformation()

virtual bool Ipopt::NLP::GetBoundsInformation ( const Matrix Px_L,
Vector x_L,
const Matrix Px_U,
Vector x_U,
const Matrix Pd_L,
Vector d_L,
const Matrix Pd_U,
Vector d_U 
)
pure virtual

Method for obtaining the bounds information.

Implemented in Ipopt::NLPBoundsRemover, and Ipopt::TNLPAdapter.

◆ GetStartingPoint()

virtual bool Ipopt::NLP::GetStartingPoint ( SmartPtr< Vector x,
bool  need_x,
SmartPtr< Vector y_c,
bool  need_y_c,
SmartPtr< Vector y_d,
bool  need_y_d,
SmartPtr< Vector z_L,
bool  need_z_L,
SmartPtr< Vector z_U,
bool  need_z_U 
)
pure virtual

Method for obtaining the starting point for all the iterates.

Implemented in Ipopt::NLPBoundsRemover, and Ipopt::TNLPAdapter.

◆ GetWarmStartIterate()

virtual bool Ipopt::NLP::GetWarmStartIterate ( IteratesVector )
inlinevirtual

Method for obtaining an entire iterate as a warmstart point.

The incoming IteratesVector has to be filled. The default dummy implementation returns false.

Reimplemented in Ipopt::NLPBoundsRemover, and Ipopt::TNLPAdapter.

Definition at line 125 of file IpNLP.hpp.

◆ Eval_f()

virtual bool Ipopt::NLP::Eval_f ( const Vector x,
Number f 
)
pure virtual

◆ Eval_grad_f()

virtual bool Ipopt::NLP::Eval_grad_f ( const Vector x,
Vector g_f 
)
pure virtual

◆ Eval_c()

virtual bool Ipopt::NLP::Eval_c ( const Vector x,
Vector c 
)
pure virtual

◆ Eval_jac_c()

virtual bool Ipopt::NLP::Eval_jac_c ( const Vector x,
Matrix jac_c 
)
pure virtual

◆ Eval_d()

virtual bool Ipopt::NLP::Eval_d ( const Vector x,
Vector d 
)
pure virtual

◆ Eval_jac_d()

virtual bool Ipopt::NLP::Eval_jac_d ( const Vector x,
Matrix jac_d 
)
pure virtual

◆ Eval_h()

virtual bool Ipopt::NLP::Eval_h ( const Vector x,
Number  obj_factor,
const Vector yc,
const Vector yd,
SymMatrix h 
)
pure virtual

◆ FinalizeSolution()

virtual void Ipopt::NLP::FinalizeSolution ( SolverReturn  ,
const Vector ,
const Vector ,
const Vector ,
const Vector ,
const Vector ,
const Vector ,
const Vector ,
Number  ,
const IpoptData ,
IpoptCalculatedQuantities  
)
inlinevirtual

This method is called at the very end of the optimization.

It provides the final iterate to the user, so that it can be stored as the solution. The status flag indicates the outcome of the optimization, where SolverReturn is defined in IpAlgTypes.hpp.

Reimplemented in Ipopt::NLPBoundsRemover, and Ipopt::TNLPAdapter.

Definition at line 184 of file IpNLP.hpp.

◆ IntermediateCallBack()

virtual bool Ipopt::NLP::IntermediateCallBack ( AlgorithmMode  ,
Index  ,
Number  ,
Number  ,
Number  ,
Number  ,
Number  ,
Number  ,
Number  ,
Number  ,
Index  ,
const IpoptData ,
IpoptCalculatedQuantities  
)
inlinevirtual

This method is called once per iteration, after the iteration summary output has been printed.

It provides the current information to the user to do with it anything she wants. It also allows the user to ask for a premature termination of the optimization by returning false, in which case Ipopt will terminate with a corresponding return status. The basic information provided in the argument list has the quantities values printed in the iteration summary line. If more information is required, a user can obtain it from the IpData and IpCalculatedQuantities objects. However, note that the provided quantities are all for the problem that Ipopt sees, i.e., the quantities might be scaled, fixed variables might be sorted out, etc. The status indicates things like whether the algorithm is in the restoration phase... In the restoration phase, the dual variables are probably not not changing.

Reimplemented in Ipopt::NLPBoundsRemover, and Ipopt::TNLPAdapter.

Definition at line 217 of file IpNLP.hpp.

◆ GetScalingParameters()

virtual void Ipopt::NLP::GetScalingParameters ( const SmartPtr< const VectorSpace ,
const SmartPtr< const VectorSpace ,
const SmartPtr< const VectorSpace ,
Number ,
SmartPtr< Vector > &  ,
SmartPtr< Vector > &  ,
SmartPtr< Vector > &   
) const
inlinevirtual

Routines to get the scaling parameters.

These do not need to be overloaded unless the options are set for user scaling.

Reimplemented in Ipopt::NLPBoundsRemover, and Ipopt::TNLPAdapter.

Definition at line 242 of file IpNLP.hpp.

◆ GetQuasiNewtonApproximationSpaces()

virtual void Ipopt::NLP::GetQuasiNewtonApproximationSpaces ( SmartPtr< VectorSpace > &  approx_space,
SmartPtr< Matrix > &  P_approx 
)
inlinevirtual

Method for obtaining the subspace in which the limited-memory Hessian approximation should be done.

This is only called if the limited-memory Hessian approximation is chosen. Since the Hessian is zero in the space of all variables that appear in the problem functions only linearly, this allows the user to provide a VectorSpace for all nonlinear variables, and an ExpansionMatrix to lift from this VectorSpace to the VectorSpace of the primal variables x. If the returned values are NULL, it is assumed that the Hessian is to be approximated in the space of all x variables. The default instantiation of this method returns NULL, and a user only has to overwrite this method if the approximation is to be done only in a subspace.

Reimplemented in Ipopt::NLPBoundsRemover, and Ipopt::TNLPAdapter.

Definition at line 273 of file IpNLP.hpp.

◆ operator=()

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

Default Assignment Operator.


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