This class maps the traditional NLP into something that is more useful for Ipopt. More...
#include <IpOrigIpoptNLP.hpp>
Static Public Member Functions | |
static void | RegisterOptions (SmartPtr< RegisteredOptions > roptions) |
Called to register the options. | |
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. | |
OrigIpoptNLP (const OrigIpoptNLP &) | |
Copy Constructor. | |
void | operator= (const OrigIpoptNLP &) |
Overloaded Assignment Operator. | |
auxiliary functions | |
void | relax_bounds (Number bound_relax_factor, Vector &bounds) |
relax the bounds by a relative move of relax_bound_factor. | |
SmartPtr< const Vector > | get_unscaled_x (const Vector &x) |
Method for getting the unscaled version of the x vector. | |
Private Attributes | |
SmartPtr< const Journalist > | jnlst_ |
Journalist. | |
SmartPtr< NLP > | nlp_ |
Pointer to the NLP. | |
bool | initialized_ |
Flag indicating if initialization method has been called. | |
SmartPtr< const VectorSpace > | x_space_ |
Necessary Vector/Matrix spaces. | |
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 > | h_space_ |
SmartPtr< const MatrixSpace > | scaled_jac_c_space_ |
SmartPtr< const MatrixSpace > | scaled_jac_d_space_ |
SmartPtr< const SymMatrixSpace > | scaled_h_space_ |
Storage for Model Quantities | |
CachedResults< Number > | f_cache_ |
Objective function. | |
CachedResults< SmartPtr< const Vector > > | grad_f_cache_ |
Gradient of the objective function. | |
CachedResults< SmartPtr< const Vector > > | c_cache_ |
Equality constraint residuals. | |
CachedResults< SmartPtr< const Matrix > > | jac_c_cache_ |
Jacobian Matrix for equality constraints (current iteration) | |
CachedResults< SmartPtr< const Vector > > | d_cache_ |
Inequality constraint residual (reformulated as equalities with slacks. | |
CachedResults< SmartPtr< const Matrix > > | jac_d_cache_ |
Jacobian Matrix for inequality constraints (current iteration) | |
CachedResults< SmartPtr< const SymMatrix > > | h_cache_ |
Hessian of the lagrangian (current iteration) | |
CachedResults< SmartPtr< const Vector > > | unscaled_x_cache_ |
Unscaled version of x vector. | |
SmartPtr< const Vector > | x_L_ |
Lower bounds on x. | |
SmartPtr< const Matrix > | Px_L_ |
Permutation matrix (x_L_ -> x) | |
SmartPtr< const Vector > | x_U_ |
Upper bounds on x. | |
SmartPtr< const Matrix > | Px_U_ |
Permutation matrix (x_U_ -> x) | |
SmartPtr< const Vector > | d_L_ |
Lower bounds on d. | |
SmartPtr< const Matrix > | Pd_L_ |
Permutation matrix (d_L_ -> d) | |
SmartPtr< const Vector > | d_U_ |
Upper bounds on d. | |
SmartPtr< const Matrix > | Pd_U_ |
Permutation matrix (d_U_ -> d) | |
SmartPtr< const Vector > | orig_x_L_ |
Original unmodified lower bounds on x. | |
SmartPtr< const Vector > | orig_x_U_ |
Original unmodified upper bounds on x. | |
SmartPtr< const Vector > | orig_d_L_ |
Original unmodified lower bounds on d. | |
SmartPtr< const Vector > | orig_d_U_ |
Original unmodified upper bounds on d. | |
Algorithmic parameters | |
Number | bound_relax_factor_ |
relaxation factor for the bounds | |
Number | constr_viol_tol_ |
constraint violation tolerance (from OptimalityErrorConvergenceCheck) | |
bool | honor_original_bounds_ |
Flag indicating whether the primal variables should be projected back into original bounds are optimization. | |
bool | warm_start_same_structure_ |
Flag indicating whether the TNLP with identical structure has already been solved before. | |
HessianApproximationType | hessian_approximation_ |
Flag indicating what Hessian information is to be used. | |
HessianApproximationSpace | hessian_approximation_space_ |
Flag indicating in which space Hessian is to be approximated. | |
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. | |
bool | grad_f_constant_ |
Flag indicating if we need to ask for objective Gradient only once. | |
bool | jac_c_constant_ |
Flag indicating if we need to ask for equality constraint Jacobians only once. | |
bool | jac_d_constant_ |
Flag indicating if we need to ask for inequality constraint Jacobians only once. | |
bool | hessian_constant_ |
Flag indicating if we need to ask for Hessian only once. | |
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_ |
Timing statistics for the function evaluations. | |
TimingStatistics & | timing_statistics_ |
This class maps the traditional NLP into something that is more useful for Ipopt.
This class takes care of storing the calculated model results, handles caching, scaling, and (some day) takes care of addition of slacks.
Given a NLP
\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*}
and (invertible diagonal) scaling matrices \(s_o\), \(s_c\), \(s_d\), \(s_x\), this class represents the NLP
\begin{eqnarray*} \mathrm{min} && s_o f(s_x^{-1} \tilde x), \\ \mathrm{s.t.} && s_c c(s_x^{-1} \tilde x) = 0, &\qquad \tilde y_c \\ && s_d d_L \leq s_d d(s_x^{-1} \tilde x) \leq s_d d_U, &\qquad \tilde y_d \\ && s_x x_L \leq \tilde x \leq s_x x_U, &\qquad \tilde z_L, z_U \end{eqnarray*}
where \(\tilde x\), \(\tilde y_c\), \(\tilde y_d\), \(\tilde z_L\), \(\tilde z_U\), are the primal and dual variables of the scaled problem (though, Ipopt adds slack variables additionally).
The correspondence between a scaled and its corresponding unscaled solution is
\begin{eqnarray*} x && = s_x^{-1} \tilde x \\ y_c && = s_o^{-1} s_c \tilde y_c \\ y_d && = s_o^{-1} s_d \tilde y_d \\ z_L && = s_o^{-1} s_x \tilde z_L \\ z_U && = s_o^{-1} s_x \tilde z_U \end{eqnarray*}
Definition at line 65 of file IpOrigIpoptNLP.hpp.
Ipopt::OrigIpoptNLP::OrigIpoptNLP | ( | const SmartPtr< const Journalist > & | jnlst, |
const SmartPtr< NLP > & | nlp, | ||
const SmartPtr< NLPScalingObject > & | nlp_scaling, | ||
TimingStatistics & | timing_statistics | ||
) |
Constructor.
jnlst | Journalist |
nlp | NLP |
nlp_scaling | NLP scaling |
timing_statistics | Timing statistics |
|
virtual |
Destructor.
|
private |
Default Constructor.
|
private |
Copy Constructor.
|
virtual |
Initialization method.
Set the internal options and initialize internal data structures.
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 105 of file IpOrigIpoptNLP.hpp.
Objective value (depending in mu) - incorrect version for OrigIpoptNLP.
Implements Ipopt::IpoptNLP.
Gradient of the objective.
Implements Ipopt::IpoptNLP.
|
virtual |
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.
Scaled lower bounds on x.
Implements Ipopt::IpoptNLP.
Definition at line 189 of file IpOrigIpoptNLP.hpp.
Permutation matrix (x_L_ -> x)
Implements Ipopt::IpoptNLP.
Definition at line 195 of file IpOrigIpoptNLP.hpp.
Original unscaled lower bounds on x.
Returns NULL if bounds are not relaxed.
Definition at line 205 of file IpOrigIpoptNLP.hpp.
Scaled upper bounds on x.
Implements Ipopt::IpoptNLP.
Definition at line 211 of file IpOrigIpoptNLP.hpp.
Permutation matrix (x_U_ -> x)
Implements Ipopt::IpoptNLP.
Definition at line 217 of file IpOrigIpoptNLP.hpp.
Original unscaled upper bounds on x.
Returns NULL if bounds are not relaxed.
Definition at line 227 of file IpOrigIpoptNLP.hpp.
Scaled lower bounds on d.
Implements Ipopt::IpoptNLP.
Definition at line 233 of file IpOrigIpoptNLP.hpp.
Permutation matrix (d_L_ -> d)
Implements Ipopt::IpoptNLP.
Definition at line 239 of file IpOrigIpoptNLP.hpp.
Original unscaled lower bounds on d.
Returns NULL if bounds are not relaxed.
Definition at line 249 of file IpOrigIpoptNLP.hpp.
Scaled upper bounds on d.
Implements Ipopt::IpoptNLP.
Definition at line 255 of file IpOrigIpoptNLP.hpp.
Permutation matrix (d_U_ -> d)
Implements Ipopt::IpoptNLP.
Definition at line 261 of file IpOrigIpoptNLP.hpp.
Original unscaled upper bounds on d.
Returns NULL if bounds are not relaxed.
Definition at line 271 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 276 of file IpOrigIpoptNLP.hpp.
|
inlinevirtual |
|
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.
Implements Ipopt::IpoptNLP.
Definition at line 316 of file IpOrigIpoptNLP.hpp.
Implements Ipopt::IpoptNLP.
Definition at line 320 of file IpOrigIpoptNLP.hpp.
Implements Ipopt::IpoptNLP.
Definition at line 324 of file IpOrigIpoptNLP.hpp.
Implements Ipopt::IpoptNLP.
Definition at line 328 of file IpOrigIpoptNLP.hpp.
Implements Ipopt::IpoptNLP.
Definition at line 332 of file IpOrigIpoptNLP.hpp.
Implements Ipopt::IpoptNLP.
Definition at line 336 of file IpOrigIpoptNLP.hpp.
Implements Ipopt::IpoptNLP.
Definition at line 340 of file IpOrigIpoptNLP.hpp.
|
virtual |
Solution Routines - overloaded from IpoptNLP.
Implements Ipopt::IpoptNLP.
|
virtual |
Implements Ipopt::IpoptNLP.
|
static |
Called to register the options.
Accessor method to the underlying NLP.
Definition at line 385 of file IpOrigIpoptNLP.hpp.
|
private |
Overloaded Assignment 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 |
Definition at line 392 of file IpOrigIpoptNLP.hpp.
Pointer to the NLP.
Definition at line 395 of file IpOrigIpoptNLP.hpp.
|
private |
Necessary Vector/Matrix spaces.
Definition at line 399 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 400 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 401 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 402 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 403 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 404 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 405 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 406 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 407 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 408 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 409 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 410 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 411 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 412 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 414 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 415 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 416 of file IpOrigIpoptNLP.hpp.
|
private |
Objective function.
Definition at line 422 of file IpOrigIpoptNLP.hpp.
|
private |
Gradient of the objective function.
Definition at line 425 of file IpOrigIpoptNLP.hpp.
|
private |
Equality constraint residuals.
Definition at line 428 of file IpOrigIpoptNLP.hpp.
|
private |
Jacobian Matrix for equality constraints (current iteration)
Definition at line 433 of file IpOrigIpoptNLP.hpp.
|
private |
Inequality constraint residual (reformulated as equalities with slacks.
Definition at line 438 of file IpOrigIpoptNLP.hpp.
|
private |
Jacobian Matrix for inequality constraints (current iteration)
Definition at line 443 of file IpOrigIpoptNLP.hpp.
|
private |
Hessian of the lagrangian (current iteration)
Definition at line 448 of file IpOrigIpoptNLP.hpp.
|
private |
Unscaled version of x vector.
Definition at line 451 of file IpOrigIpoptNLP.hpp.
Lower bounds on x.
Definition at line 454 of file IpOrigIpoptNLP.hpp.
Permutation matrix (x_L_ -> x)
Definition at line 457 of file IpOrigIpoptNLP.hpp.
Upper bounds on x.
Definition at line 460 of file IpOrigIpoptNLP.hpp.
Permutation matrix (x_U_ -> x)
Definition at line 463 of file IpOrigIpoptNLP.hpp.
Lower bounds on d.
Definition at line 466 of file IpOrigIpoptNLP.hpp.
Permutation matrix (d_L_ -> d)
Definition at line 469 of file IpOrigIpoptNLP.hpp.
Upper bounds on d.
Definition at line 472 of file IpOrigIpoptNLP.hpp.
Permutation matrix (d_U_ -> d)
Definition at line 475 of file IpOrigIpoptNLP.hpp.
Original unmodified lower bounds on x.
Definition at line 478 of file IpOrigIpoptNLP.hpp.
Original unmodified upper bounds on x.
Definition at line 481 of file IpOrigIpoptNLP.hpp.
Original unmodified lower bounds on d.
Definition at line 484 of file IpOrigIpoptNLP.hpp.
Original unmodified upper bounds on d.
Definition at line 487 of file IpOrigIpoptNLP.hpp.
|
private |
relaxation factor for the bounds
Definition at line 536 of file IpOrigIpoptNLP.hpp.
|
private |
constraint violation tolerance (from OptimalityErrorConvergenceCheck)
Definition at line 539 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating whether the primal variables should be projected back into original bounds are optimization.
Definition at line 544 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating whether the TNLP with identical structure has already been solved before.
Definition at line 549 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating what Hessian information is to be used.
Definition at line 552 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating in which space Hessian is to be approximated.
Definition at line 555 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 560 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating if we need to ask for objective Gradient only once.
Definition at line 565 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating if we need to ask for equality constraint Jacobians only once.
Definition at line 570 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating if we need to ask for inequality constraint Jacobians only once.
Definition at line 575 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating if we need to ask for Hessian only once.
Definition at line 578 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 583 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 584 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 585 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 586 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 587 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 588 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 589 of file IpOrigIpoptNLP.hpp.
|
private |
Flag indicating if initialization method has been called.
Definition at line 593 of file IpOrigIpoptNLP.hpp.
|
private |
Definition at line 597 of file IpOrigIpoptNLP.hpp.