Ipopt
3.11.9
|
This class maps the traditional NLP into something that is more useful by Ipopt. More...
#include <IpOrigIpoptNLP.hpp>
Public Member Functions | |
Constructors/Destructors | |
OrigIpoptNLP (const SmartPtr< const Journalist > &jnlst, const SmartPtr< NLP > &nlp, const SmartPtr< NLPScalingObject > &nlp_scaling) | |
virtual | ~OrigIpoptNLP () |
Default destructor. More... | |
virtual bool | Initialize (const Journalist &jnlst, const OptionsList &options, const std::string &prefix) |
Initialize - overloaded from IpoptNLP. More... | |
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) |
Initialize (create) structures for the iteration data. More... | |
virtual bool | GetWarmStartIterate (IteratesVector &warm_start_iterate) |
Method accessing the GetWarmStartIterate of the NLP. More... | |
virtual Number | f (const Vector &x) |
Accessor methods for model data. More... | |
virtual Number | f (const Vector &x, Number mu) |
Objective value (depending in mu) - incorrect version for OrigIpoptNLP. More... | |
virtual SmartPtr< const Vector > | grad_f (const Vector &x) |
Gradient of the objective. More... | |
virtual SmartPtr< const Vector > | grad_f (const Vector &x, Number mu) |
Gradient of the objective (depending in mu) - incorrect version for OrigIpoptNLP. More... | |
virtual SmartPtr< const Vector > | c (const Vector &x) |
Equality constraint residual. More... | |
virtual SmartPtr< const Matrix > | jac_c (const Vector &x) |
Jacobian Matrix for equality constraints. More... | |
virtual SmartPtr< const Vector > | d (const Vector &x) |
Inequality constraint residual (reformulated as equalities with slacks. More... | |
virtual SmartPtr< const Matrix > | jac_d (const Vector &x) |
Jacobian Matrix for inequality constraints. More... | |
virtual SmartPtr< const SymMatrix > | h (const Vector &x, Number obj_factor, const Vector &yc, const Vector &yd) |
Hessian of the Lagrangian. More... | |
virtual SmartPtr< const SymMatrix > | h (const Vector &x, Number obj_factor, const Vector &yc, const Vector &yd, Number mu) |
Hessian of the Lagrangian (depending in mu) - incorrect version for OrigIpoptNLP. More... | |
virtual SmartPtr< const SymMatrix > | uninitialized_h () |
Provides a Hessian matrix from the correct matrix space with uninitialized values. More... | |
virtual SmartPtr< const Vector > | x_L () const |
Lower bounds on x. More... | |
virtual SmartPtr< const Matrix > | Px_L () const |
Permutation matrix (x_L_ -> x) More... | |
virtual SmartPtr< const Vector > | x_U () const |
Upper bounds on x. More... | |
virtual SmartPtr< const Matrix > | Px_U () const |
Permutation matrix (x_U_ -> x. More... | |
virtual SmartPtr< const Vector > | d_L () const |
Lower bounds on d. More... | |
virtual SmartPtr< const Matrix > | Pd_L () const |
Permutation matrix (d_L_ -> d) More... | |
virtual SmartPtr< const Vector > | d_U () const |
Upper bounds on d. More... | |
virtual SmartPtr< const Matrix > | Pd_U () const |
Permutation matrix (d_U_ -> d. More... | |
virtual SmartPtr< const SymMatrixSpace > | HessianMatrixSpace () const |
Accessor method to obtain the MatrixSpace for the Hessian matrix (or it's approximation) More... | |
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) |
Accessor method for vector/matrix spaces pointers. More... | |
virtual void | AdjustVariableBounds (const Vector &new_x_L, const Vector &new_x_U, const Vector &new_d_L, const Vector &new_d_U) |
Method for adapting the variable bounds. More... | |
Counters for the number of function evaluations. | |
virtual Index | f_evals () const |
virtual Index | grad_f_evals () const |
virtual Index | c_evals () const |
virtual Index | jac_c_evals () const |
virtual Index | d_evals () const |
virtual Index | jac_d_evals () const |
virtual Index | h_evals () const |
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) |
Solution Routines - overloaded from IpoptNLP. More... | |
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) |
![]() | |
IpoptNLP (const SmartPtr< NLPScalingObject > nlp_scaling) | |
virtual | ~IpoptNLP () |
Default destructor. More... | |
DECLARE_STD_EXCEPTION (Eval_Error) | |
thrown if there is any error evaluating values from the nlp More... | |
virtual bool | objective_depends_on_mu () const |
Method for telling the IpoptCalculatedQuantities class whether the objective function depends on the barrier function. More... | |
SmartPtr< NLPScalingObject > | NLP_scaling () const |
Returns the scaling strategy object. More... | |
![]() | |
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. | |
OrigIpoptNLP () | |
Default Constructor. More... | |
OrigIpoptNLP (const OrigIpoptNLP &) | |
Copy Constructor. More... | |
void | operator= (const OrigIpoptNLP &) |
Overloaded Equals Operator. More... | |
auxilliary functions | |
void | relax_bounds (Number bound_relax_factor, Vector &bounds) |
relax the bounds by a relative move of relax_bound_factor. More... | |
SmartPtr< const Vector > | get_unscaled_x (const Vector &x) |
Method for getting the unscaled version of the x vector. More... | |
Private Attributes | |
Storage for Model Quantities | |
CachedResults< Number > | f_cache_ |
Objective function. More... | |
CachedResults< SmartPtr< const Vector > > | grad_f_cache_ |
Gradient of the objective function. More... | |
CachedResults< SmartPtr< const Vector > > | c_cache_ |
Equality constraint residuals. More... | |
CachedResults< SmartPtr< const Matrix > > | jac_c_cache_ |
Jacobian Matrix for equality constraints (current iteration) More... | |
CachedResults< SmartPtr< const Vector > > | d_cache_ |
Inequality constraint residual (reformulated as equalities with slacks. More... | |
CachedResults< SmartPtr< const Matrix > > | jac_d_cache_ |
Jacobian Matrix for inequality constraints (current iteration) More... | |
CachedResults< SmartPtr< const SymMatrix > > | h_cache_ |
Hessian of the lagrangian (current iteration) More... | |
CachedResults< SmartPtr< const Vector > > | unscaled_x_cache_ |
Unscaled version of x vector. More... | |
SmartPtr< const Vector > | x_L_ |
Lower bounds on x. More... | |
SmartPtr< const Matrix > | Px_L_ |
Permutation matrix (x_L_ -> x) More... | |
SmartPtr< const Vector > | x_U_ |
Upper bounds on x. More... | |
SmartPtr< const Matrix > | Px_U_ |
Permutation matrix (x_U_ -> x. More... | |
SmartPtr< const Vector > | d_L_ |
Lower bounds on d. More... | |
SmartPtr< const Matrix > | Pd_L_ |
Permutation matrix (d_L_ -> d) More... | |
SmartPtr< const Vector > | d_U_ |
Upper bounds on d. More... | |
SmartPtr< const Matrix > | Pd_U_ |
Permutation matrix (d_U_ -> d. More... | |
SmartPtr< const Vector > | orig_x_L_ |
Original unmodified lower bounds on x. More... | |
SmartPtr< const Vector > | orig_x_U_ |
Original unmodified upper bounds on x. More... | |
Algorithmic parameters | |
Number | bound_relax_factor_ |
relaxation factor for the bounds More... | |
bool | honor_original_bounds_ |
Flag indicating whether the primal variables should be projected back into original bounds are optimization. More... | |
bool | warm_start_same_structure_ |
Flag indicating whether the TNLP with identical structure has already been solved before. More... | |
HessianApproximationType | hessian_approximation_ |
Flag indicating what Hessian information is to be used. More... | |
HessianApproximationSpace | hessian_approximation_space_ |
Flag indicating in which space Hessian is to be approximated. More... | |
bool | check_derivatives_for_naninf_ |
Flag indicating whether it is desired to check if there are Nan or Inf entries in first and second derivative matrices. More... | |
bool | jac_c_constant_ |
Flag indicating if we need to ask for equality constraint Jacobians only once. More... | |
bool | jac_d_constant_ |
Flag indicating if we need to ask for inequality constraint Jacobians only once. More... | |
bool | hessian_constant_ |
Flag indicating if we need to ask for Hessian only once. More... | |
Counters for the function evaluations | |
Index | f_evals_ |
Index | grad_f_evals_ |
Index | c_evals_ |
Index | jac_c_evals_ |
Index | d_evals_ |
Index | jac_d_evals_ |
Index | h_evals_ |
bool | initialized_ |
Flag indicating if initialization method has been called. More... | |
Timing statistics for the function evaluations. | |
TimedTask | f_eval_time_ |
TimedTask | grad_f_eval_time_ |
TimedTask | c_eval_time_ |
TimedTask | jac_c_eval_time_ |
TimedTask | d_eval_time_ |
TimedTask | jac_d_eval_time_ |
TimedTask | h_eval_time_ |
Methods for IpoptType | |
SmartPtr< NLP > | nlp () |
Accessor method to the underlying NLP. More... | |
static void | RegisterOptions (SmartPtr< RegisteredOptions > roptions) |
Called by IpoptType to register the options. More... | |
This class maps the traditional NLP into something that is more useful by Ipopt.
This class takes care of storing the calculated model results, handles caching, and (some day) takes care of addition of slacks.
Definition at line 37 of file IpOrigIpoptNLP.hpp.
Ipopt::OrigIpoptNLP::OrigIpoptNLP | ( | const SmartPtr< const Journalist > & | jnlst, |
const SmartPtr< NLP > & | nlp, | ||
const SmartPtr< NLPScalingObject > & | nlp_scaling | ||
) |
|
virtual |
Default destructor.
|
private |
Default Constructor.
|
private |
Copy Constructor.
|
virtual |
Initialize - overloaded from IpoptNLP.
Reimplemented from Ipopt::IpoptNLP.
|
virtual |
Initialize (create) structures for the iteration data.
Implements Ipopt::IpoptNLP.
|
inlinevirtual |
Method accessing the GetWarmStartIterate of the NLP.
Implements Ipopt::IpoptNLP.
Definition at line 72 of file IpOrigIpoptNLP.hpp.
Objective value (depending in mu) - incorrect version for OrigIpoptNLP.
Implements Ipopt::IpoptNLP.
Gradient of the objective.
Implements Ipopt::IpoptNLP.
Gradient of the objective (depending in mu) - incorrect version for OrigIpoptNLP.
Implements Ipopt::IpoptNLP.
Equality constraint residual.
Implements Ipopt::IpoptNLP.
Jacobian Matrix for equality constraints.
Implements Ipopt::IpoptNLP.
Inequality constraint residual (reformulated as equalities with slacks.
Implements Ipopt::IpoptNLP.
Jacobian Matrix for inequality constraints.
Implements Ipopt::IpoptNLP.
|
virtual |
Hessian of the Lagrangian.
Implements Ipopt::IpoptNLP.
|
virtual |
Hessian of the Lagrangian (depending in mu) - incorrect version for OrigIpoptNLP.
Implements Ipopt::IpoptNLP.
Provides a Hessian matrix from the correct matrix space with uninitialized values.
This can be used in LeastSquareMults to obtain a "zero Hessian".
Implements Ipopt::IpoptNLP.
Permutation matrix (x_L_ -> x)
Implements Ipopt::IpoptNLP.
Definition at line 132 of file IpOrigIpoptNLP.hpp.
Permutation matrix (x_U_ -> x.
Implements Ipopt::IpoptNLP.
Definition at line 144 of file IpOrigIpoptNLP.hpp.
Permutation matrix (d_L_ -> d)
Implements Ipopt::IpoptNLP.
Definition at line 156 of file IpOrigIpoptNLP.hpp.
Permutation matrix (d_U_ -> d.
Implements Ipopt::IpoptNLP.
Definition at line 168 of file IpOrigIpoptNLP.hpp.
|
inlinevirtual |
Accessor method to obtain the MatrixSpace for the Hessian matrix (or it's approximation)
Implements Ipopt::IpoptNLP.
Definition at line 173 of file IpOrigIpoptNLP.hpp.
|
virtual |
Accessor method for vector/matrix spaces pointers.
Implements Ipopt::IpoptNLP.
|
virtual |
Method for adapting the variable bounds.
This is called if slacks are becoming too small
Implements Ipopt::IpoptNLP.
|
inlinevirtual |
Implements Ipopt::IpoptNLP.
Definition at line 204 of file IpOrigIpoptNLP.hpp.
|
inlinevirtual |
Implements Ipopt::IpoptNLP.
Definition at line 208 of file IpOrigIpoptNLP.hpp.
|
inlinevirtual |
Implements Ipopt::IpoptNLP.
Definition at line 212 of file IpOrigIpoptNLP.hpp.
|
inlinevirtual |
Implements Ipopt::IpoptNLP.
Definition at line 216 of file IpOrigIpoptNLP.hpp.
|
inlinevirtual |
Implements Ipopt::IpoptNLP.
Definition at line 220 of file IpOrigIpoptNLP.hpp.
|
inlinevirtual |
Implements Ipopt::IpoptNLP.
Definition at line 224 of file IpOrigIpoptNLP.hpp.
|
inlinevirtual |
Implements Ipopt::IpoptNLP.
Definition at line 228 of file IpOrigIpoptNLP.hpp.
|
virtual |
Solution Routines - overloaded from IpoptNLP.
Implements Ipopt::IpoptNLP.
|
virtual |
Implements Ipopt::IpoptNLP.
|
static |
Called by IpoptType to register the options.
Accessor method to the underlying NLP.
Definition at line 261 of file IpOrigIpoptNLP.hpp.
void Ipopt::OrigIpoptNLP::ResetTimes | ( | ) |
Reset the timing statistics.
void Ipopt::OrigIpoptNLP::PrintTimingStatistics | ( | Journalist & | jnlst, |
EJournalLevel | level, | ||
EJournalCategory | category | ||
) | const |
|
inline |
Definition at line 276 of file IpOrigIpoptNLP.hpp.
|
inline |
Definition at line 280 of file IpOrigIpoptNLP.hpp.
|
inline |
Definition at line 284 of file IpOrigIpoptNLP.hpp.
|
inline |
Definition at line 288 of file IpOrigIpoptNLP.hpp.
|
inline |
Definition at line 292 of file IpOrigIpoptNLP.hpp.
|
inline |
Definition at line 296 of file IpOrigIpoptNLP.hpp.
|
inline |
Definition at line 300 of file IpOrigIpoptNLP.hpp.
Number Ipopt::OrigIpoptNLP::TotalFunctionEvaluationCpuTime | ( | ) | const |
Number Ipopt::OrigIpoptNLP::TotalFunctionEvaluationSysTime | ( | ) | const |
Number Ipopt::OrigIpoptNLP::TotalFunctionEvaluationWallclockTime | ( | ) | const |
|
private |
Overloaded Equals Operator.
relax the bounds by a relative move of relax_bound_factor.
Here, relax_bound_factor should be negative (or zero) for lower bounds, and positive (or zero) for upper bounds.
Method for getting the unscaled version of the x vector.
|
private |
journalist
Definition at line 312 of file IpOrigIpoptNLP.hpp.
Pointer to the NLP.
Definition at line 315 of file IpOrigIpoptNLP.hpp.
|
private |
Necessary Vector/Matrix spaces.
Definition at line 319 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 320 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 321 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 322 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 323 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 324 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 325 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 326 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 327 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 328 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 329 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 330 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 331 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 332 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 334 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 335 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 336 of file IpOrigIpoptNLP.hpp.
|
private |
Objective function.
Definition at line 341 of file IpOrigIpoptNLP.hpp.
|
private |
Gradient of the objective function.
Definition at line 344 of file IpOrigIpoptNLP.hpp.
|
private |
Equality constraint residuals.
Definition at line 347 of file IpOrigIpoptNLP.hpp.
|
private |
Jacobian Matrix for equality constraints (current iteration)
Definition at line 351 of file IpOrigIpoptNLP.hpp.
|
private |
Inequality constraint residual (reformulated as equalities with slacks.
Definition at line 355 of file IpOrigIpoptNLP.hpp.
|
private |
Jacobian Matrix for inequality constraints (current iteration)
Definition at line 359 of file IpOrigIpoptNLP.hpp.
|
private |
Hessian of the lagrangian (current iteration)
Definition at line 363 of file IpOrigIpoptNLP.hpp.
|
private |
Unscaled version of x vector.
Definition at line 366 of file IpOrigIpoptNLP.hpp.
Lower bounds on x.
Definition at line 369 of file IpOrigIpoptNLP.hpp.
Permutation matrix (x_L_ -> x)
Definition at line 372 of file IpOrigIpoptNLP.hpp.
Upper bounds on x.
Definition at line 375 of file IpOrigIpoptNLP.hpp.
Permutation matrix (x_U_ -> x.
Definition at line 378 of file IpOrigIpoptNLP.hpp.
Lower bounds on d.
Definition at line 381 of file IpOrigIpoptNLP.hpp.
Permutation matrix (d_L_ -> d)
Definition at line 384 of file IpOrigIpoptNLP.hpp.
Upper bounds on d.
Definition at line 387 of file IpOrigIpoptNLP.hpp.
Permutation matrix (d_U_ -> d.
Definition at line 390 of file IpOrigIpoptNLP.hpp.
Original unmodified lower bounds on x.
Definition at line 393 of file IpOrigIpoptNLP.hpp.
Original unmodified upper bounds on x.
Definition at line 396 of file IpOrigIpoptNLP.hpp.
|
private |
relaxation factor for the bounds
Definition at line 431 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating whether the primal variables should be projected back into original bounds are optimization.
Definition at line 434 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating whether the TNLP with identical structure has already been solved before.
Definition at line 437 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating what Hessian information is to be used.
Definition at line 439 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating in which space Hessian is to be approximated.
Definition at line 441 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating whether it is desired to check if there are Nan or Inf entries in first and second derivative matrices.
Definition at line 444 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating if we need to ask for equality constraint Jacobians only once.
Definition at line 447 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating if we need to ask for inequality constraint Jacobians only once.
Definition at line 450 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating if we need to ask for Hessian only once.
Definition at line 452 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 457 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 458 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 459 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 460 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 461 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 462 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 463 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating if initialization method has been called.
Definition at line 467 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 471 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 472 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 473 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 474 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 475 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 476 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 477 of file IpOrigIpoptNLP.hpp.