Ipopt  3.12.12
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Attributes | List of all members
Ipopt::NLPBoundsRemover Class Reference

This is an adaper for an NLP that converts variable bound constraints to inequality constraints. More...

#include <IpNLPBoundsRemover.hpp>

+ Inheritance diagram for Ipopt::NLPBoundsRemover:

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. More...
 
SmartPtr< NLPnlp ()
 Accessor method to the original NLP. More...
 
Constructors/Destructors
 NLPBoundsRemover (NLP &nlp, bool allow_twosided_inequalities=false)
 The constructor is given the NLP of which the bounds are to be replaced by inequality constriants. More...
 
virtual ~NLPBoundsRemover ()
 Default destructor. More...
 
NLP Initialization (overload in

derived classes).

virtual bool ProcessOptions (const OptionsList &options, const std::string &prefix)
 Overload if you want the chance to process options or parameters that may be specific to the NLP. More...
 
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)
 Method for creating the derived vector / matrix types. More...
 
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)
 Method for obtaining the bounds information. More...
 
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)
 Method for obtaining the starting point for all the iterates. More...
 
virtual bool GetWarmStartIterate (IteratesVector &warm_start_iterate)
 Method for obtaining an entire iterate as a warmstart point. More...
 
NLP evaluation routines (overload

in derived classes.

virtual bool Eval_f (const Vector &x, Number &f)
 
virtual bool Eval_grad_f (const Vector &x, Vector &g_f)
 
virtual bool Eval_c (const Vector &x, Vector &c)
 
virtual bool Eval_jac_c (const Vector &x, Matrix &jac_c)
 
virtual bool Eval_d (const Vector &x, Vector &d)
 
virtual bool Eval_jac_d (const Vector &x, Matrix &jac_d)
 
virtual bool Eval_h (const Vector &x, Number obj_factor, const Vector &yc, const Vector &yd, SymMatrix &h)
 
NLP solution routines. Have default dummy

implementations that can be overloaded.

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)
 This method is called at the very end of the optimization. More...
 
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, const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq)
 This method is called once per iteration, after the iteration summary output has been printed. More...
 
virtual void GetScalingParameters (const SmartPtr< const VectorSpace > x_space, const SmartPtr< const VectorSpace > c_space, const SmartPtr< const VectorSpace > d_space, Number &obj_scaling, SmartPtr< Vector > &x_scaling, SmartPtr< Vector > &c_scaling, SmartPtr< Vector > &d_scaling) const
 Routines to get the scaling parameters. More...
 
- Public Member Functions inherited from Ipopt::NLP
 NLP ()
 Default constructor. More...
 
virtual ~NLP ()
 Default destructor. More...
 
 DECLARE_STD_EXCEPTION (USER_SCALING_NOT_IMPLEMENTED)
 Exceptions. More...
 
 DECLARE_STD_EXCEPTION (INVALID_NLP)
 
- 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.

 NLPBoundsRemover ()
 Default Constructor. More...
 
 NLPBoundsRemover (const NLPBoundsRemover &)
 Copy Constructor. More...
 
void operator= (const NLPBoundsRemover &)
 Overloaded Equals Operator. More...
 

Private Attributes

SmartPtr< NLPnlp_
 Pointer to the original NLP. More...
 
SmartPtr< const MatrixPx_l_orig_
 Pointer to the expansion matrix for the lower x bounds. More...
 
SmartPtr< const MatrixPx_u_orig_
 Pointer to the expansion matrix for the upper x bounds. More...
 
SmartPtr< const VectorSpaced_space_orig_
 Pointer to the original d space. More...
 
bool allow_twosided_inequalities_
 Flag indicating whether twosided inequality constraints are allowed. More...
 

Detailed Description

This is an adaper for an NLP that converts variable bound constraints to inequality constraints.

This is necessary for the version of Ipopt that uses iterative linear solvers. At this point, none of the original inequality constraints is allowed to have both lower and upper bounds. The NLP visible to Ipopt via this adapter will not have any bounds on variables, but have equivalent inequality constraints.

Definition at line 24 of file IpNLPBoundsRemover.hpp.

Constructor & Destructor Documentation

Ipopt::NLPBoundsRemover::NLPBoundsRemover ( NLP nlp,
bool  allow_twosided_inequalities = false 
)

The constructor is given the NLP of which the bounds are to be replaced by inequality constriants.

virtual Ipopt::NLPBoundsRemover::~NLPBoundsRemover ( )
inlinevirtual

Default destructor.

Definition at line 34 of file IpNLPBoundsRemover.hpp.

Ipopt::NLPBoundsRemover::NLPBoundsRemover ( )
private

Default Constructor.

Ipopt::NLPBoundsRemover::NLPBoundsRemover ( const NLPBoundsRemover )
private

Copy Constructor.

Member Function Documentation

virtual bool Ipopt::NLPBoundsRemover::ProcessOptions ( const OptionsList options,
const std::string &  prefix 
)
inlinevirtual

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

Reimplemented from Ipopt::NLP.

Definition at line 43 of file IpNLPBoundsRemover.hpp.

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

Method for creating the derived vector / matrix types.

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

Implements Ipopt::NLP.

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

Method for obtaining the bounds information.

Implements Ipopt::NLP.

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

Method for obtaining the starting point for all the iterates.

ToDo it might not make sense to ask for initial values for v_L and v_U?

Implements Ipopt::NLP.

virtual bool Ipopt::NLPBoundsRemover::GetWarmStartIterate ( IteratesVector warm_start_iterate)
inlinevirtual

Method for obtaining an entire iterate as a warmstart point.

The incoming IteratesVector has to be filled. This has not yet been implemented for this adapter.

Reimplemented from Ipopt::NLP.

Definition at line 94 of file IpNLPBoundsRemover.hpp.

virtual bool Ipopt::NLPBoundsRemover::Eval_f ( const Vector x,
Number f 
)
inlinevirtual

Implements Ipopt::NLP.

Definition at line 103 of file IpNLPBoundsRemover.hpp.

virtual bool Ipopt::NLPBoundsRemover::Eval_grad_f ( const Vector x,
Vector g_f 
)
inlinevirtual

Implements Ipopt::NLP.

Definition at line 108 of file IpNLPBoundsRemover.hpp.

virtual bool Ipopt::NLPBoundsRemover::Eval_c ( const Vector x,
Vector c 
)
inlinevirtual

Implements Ipopt::NLP.

Definition at line 113 of file IpNLPBoundsRemover.hpp.

virtual bool Ipopt::NLPBoundsRemover::Eval_jac_c ( const Vector x,
Matrix jac_c 
)
inlinevirtual

Implements Ipopt::NLP.

Definition at line 118 of file IpNLPBoundsRemover.hpp.

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

Implements Ipopt::NLP.

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

Implements Ipopt::NLP.

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

Implements Ipopt::NLP.

virtual void Ipopt::NLPBoundsRemover::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 
)
virtual

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 from Ipopt::NLP.

virtual bool Ipopt::NLPBoundsRemover::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,
const IpoptData ip_data,
IpoptCalculatedQuantities ip_cq 
)
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 from Ipopt::NLP.

Definition at line 166 of file IpNLPBoundsRemover.hpp.

virtual void Ipopt::NLPBoundsRemover::GetScalingParameters ( const SmartPtr< const VectorSpace x_space,
const SmartPtr< const VectorSpace c_space,
const SmartPtr< const VectorSpace d_space,
Number obj_scaling,
SmartPtr< Vector > &  x_scaling,
SmartPtr< Vector > &  c_scaling,
SmartPtr< Vector > &  d_scaling 
) const
virtual

Routines to get the scaling parameters.

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

Reimplemented from Ipopt::NLP.

virtual void Ipopt::NLPBoundsRemover::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 from Ipopt::NLP.

Definition at line 211 of file IpNLPBoundsRemover.hpp.

SmartPtr<NLP> Ipopt::NLPBoundsRemover::nlp ( )
inline

Accessor method to the original NLP.

Definition at line 218 of file IpNLPBoundsRemover.hpp.

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

Overloaded Equals Operator.

Member Data Documentation

SmartPtr<NLP> Ipopt::NLPBoundsRemover::nlp_
private

Pointer to the original NLP.

Definition at line 242 of file IpNLPBoundsRemover.hpp.

SmartPtr<const Matrix> Ipopt::NLPBoundsRemover::Px_l_orig_
private

Pointer to the expansion matrix for the lower x bounds.

Definition at line 245 of file IpNLPBoundsRemover.hpp.

SmartPtr<const Matrix> Ipopt::NLPBoundsRemover::Px_u_orig_
private

Pointer to the expansion matrix for the upper x bounds.

Definition at line 248 of file IpNLPBoundsRemover.hpp.

SmartPtr<const VectorSpace> Ipopt::NLPBoundsRemover::d_space_orig_
private

Pointer to the original d space.

Definition at line 251 of file IpNLPBoundsRemover.hpp.

bool Ipopt::NLPBoundsRemover::allow_twosided_inequalities_
private

Flag indicating whether twosided inequality constraints are allowed.

Definition at line 255 of file IpNLPBoundsRemover.hpp.


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