#include <IpNLPScaling.hpp>
It is repsonsible for determining the scaling factors and mapping quantities in and out of scaled and unscaled versions
Public Member Functions | |
bool | Initialize (const Journalist &jnlst, const OptionsList &options, const std::string &prefix) |
Method to initialize the options. | |
virtual void | DetermineScaling (const SmartPtr< const VectorSpace > x_space, const SmartPtr< const VectorSpace > c_space, const SmartPtr< const VectorSpace > d_space, const SmartPtr< const MatrixSpace > jac_c_space, const SmartPtr< const MatrixSpace > jac_d_space, const SmartPtr< const SymMatrixSpace > h_space, SmartPtr< const MatrixSpace > &new_jac_c_space, SmartPtr< const MatrixSpace > &new_jac_d_space, SmartPtr< const SymMatrixSpace > &new_h_space)=0 |
This method is called by the IpoptNLP's at a convenient time to compute and/or read scaling factors. | |
Constructors/Destructors | |
NLPScalingObject () | |
Default destructor. | |
virtual | ~NLPScalingObject () |
Default destructor. | |
virtual Number | apply_obj_scaling (const Number &f)=0 |
Methods to map scaled and unscaled matrices. | |
virtual Number | unapply_obj_scaling (const Number &f)=0 |
Returns an obj-unscaled version of the given scalar. | |
virtual SmartPtr< Vector > | apply_vector_scaling_x_NonConst (const SmartPtr< const Vector > &v)=0 |
Returns an x-scaled version of the given vector. | |
virtual SmartPtr< const Vector > | apply_vector_scaling_x (const SmartPtr< const Vector > &v)=0 |
Returns an x-scaled version of the given vector. | |
virtual SmartPtr< Vector > | unapply_vector_scaling_x_NonConst (const SmartPtr< const Vector > &v)=0 |
Returns an x-unscaled version of the given vector. | |
virtual SmartPtr< const Vector > | unapply_vector_scaling_x (const SmartPtr< const Vector > &v)=0 |
Returns an x-unscaled version of the given vector. | |
virtual SmartPtr< const Vector > | apply_vector_scaling_c (const SmartPtr< const Vector > &v)=0 |
Returns an c-scaled version of the given vector. | |
virtual SmartPtr< const Vector > | unapply_vector_scaling_c (const SmartPtr< const Vector > &v)=0 |
Returns an c-unscaled version of the given vector. | |
virtual SmartPtr< Vector > | apply_vector_scaling_c_NonConst (const SmartPtr< const Vector > &v)=0 |
Returns an c-scaled version of the given vector. | |
virtual SmartPtr< Vector > | unapply_vector_scaling_c_NonConst (const SmartPtr< const Vector > &v)=0 |
Returns an c-unscaled version of the given vector. | |
virtual SmartPtr< const Vector > | apply_vector_scaling_d (const SmartPtr< const Vector > &v)=0 |
Returns an d-scaled version of the given vector. | |
virtual SmartPtr< const Vector > | unapply_vector_scaling_d (const SmartPtr< const Vector > &v)=0 |
Returns an d-unscaled version of the given vector. | |
virtual SmartPtr< Vector > | apply_vector_scaling_d_NonConst (const SmartPtr< const Vector > &v)=0 |
Returns an d-scaled version of the given vector. | |
virtual SmartPtr< Vector > | unapply_vector_scaling_d_NonConst (const SmartPtr< const Vector > &v)=0 |
Returns an d-unscaled version of the given vector. | |
virtual SmartPtr< const Matrix > | apply_jac_c_scaling (SmartPtr< const Matrix > matrix)=0 |
Returns a scaled version of the jacobian for c. | |
virtual SmartPtr< const Matrix > | apply_jac_d_scaling (SmartPtr< const Matrix > matrix)=0 |
Returns a scaled version of the jacobian for d If the overloaded method does not create a new matrix, make sure to set the matrix ptr passed in to NULL. | |
virtual SmartPtr< const SymMatrix > | apply_hessian_scaling (SmartPtr< const SymMatrix > matrix)=0 |
Returns a scaled version of the hessian of the lagrangian If the overloaded method does not create a new matrix, make sure to set the matrix ptr passed in to NULL. | |
SmartPtr< Vector > | apply_vector_scaling_x_LU_NonConst (const Matrix &Px_LU, const SmartPtr< const Vector > &lu, const VectorSpace &x_space) |
Methods for scaling bounds - these wrap those above. | |
SmartPtr< const Vector > | apply_vector_scaling_x_LU (const Matrix &Px_LU, const SmartPtr< const Vector > &lu, const VectorSpace &x_space) |
Returns an x-scaled vector in the x_L or x_U space. | |
SmartPtr< Vector > | apply_vector_scaling_d_LU_NonConst (const Matrix &Pd_LU, const SmartPtr< const Vector > &lu, const VectorSpace &d_space) |
Returns an d-scaled vector in the d_L or d_U space. | |
SmartPtr< const Vector > | apply_vector_scaling_d_LU (const Matrix &Pd_LU, const SmartPtr< const Vector > &lu, const VectorSpace &d_space) |
Returns an d-scaled vector in the d_L or d_U space. | |
SmartPtr< Vector > | unapply_vector_scaling_d_LU_NonConst (const Matrix &Pd_LU, const SmartPtr< const Vector > &lu, const VectorSpace &d_space) |
Returns an d-unscaled vector in the d_L or d_U space. | |
SmartPtr< const Vector > | unapply_vector_scaling_d_LU (const Matrix &Pd_LU, const SmartPtr< const Vector > &lu, const VectorSpace &d_space) |
Returns an d-unscaled vector in the d_L or d_U space. | |
virtual SmartPtr< Vector > | apply_grad_obj_scaling_NonConst (const SmartPtr< const Vector > &v) |
Methods for scaling the gradient of the objective - wraps the virtual methods above. | |
virtual SmartPtr< const Vector > | apply_grad_obj_scaling (const SmartPtr< const Vector > &v) |
Returns a grad_f scaled version (d_f * D_x^{-1}) of the given vector. | |
virtual SmartPtr< Vector > | unapply_grad_obj_scaling_NonConst (const SmartPtr< const Vector > &v) |
Returns a grad_f unscaled version (d_f * D_x^{-1}) of the given vector. | |
virtual SmartPtr< const Vector > | unapply_grad_obj_scaling (const SmartPtr< const Vector > &v) |
Returns a grad_f unscaled version (d_f * D_x^{-1}) of the given vector. | |
Methods for determining whether scaling for entities is | |
done | |
virtual bool | have_x_scaling ()=0 |
Returns true if the primal x variables are scaled. | |
virtual bool | have_c_scaling ()=0 |
Returns true if the equality constraints are scaled. | |
virtual bool | have_d_scaling ()=0 |
Returns true if the inequality constraints are scaled. | |
Protected Member Functions | |
virtual bool | InitializeImpl (const OptionsList &options, const std::string &prefix)=0 |
Implementation of the initialization method that has to be overloaded by for each derived class. | |
const Journalist & | Jnlst () const |
Accessor method for the journalist. |
NLPScalingObject | ( | ) | [inline] |
Default destructor.
virtual ~NLPScalingObject | ( | ) | [inline, virtual] |
Default destructor.
bool Initialize | ( | const Journalist & | jnlst, | |
const OptionsList & | options, | |||
const std::string & | prefix | |||
) | [inline] |
Methods to map scaled and unscaled matrices.
Returns an obj-scaled version of the given scalar
Implemented in StandardScalingBase.
Referenced by NLPScalingObject::apply_grad_obj_scaling(), and NLPScalingObject::apply_grad_obj_scaling_NonConst().
Returns an obj-unscaled version of the given scalar.
Implemented in StandardScalingBase.
Referenced by NLPScalingObject::unapply_grad_obj_scaling(), and NLPScalingObject::unapply_grad_obj_scaling_NonConst().
virtual SmartPtr<Vector> apply_vector_scaling_x_NonConst | ( | const SmartPtr< const Vector > & | v | ) | [pure virtual] |
Returns an x-scaled version of the given vector.
Implemented in StandardScalingBase.
Referenced by NLPScalingObject::apply_vector_scaling_x_LU_NonConst(), and NLPScalingObject::unapply_grad_obj_scaling_NonConst().
virtual SmartPtr<const Vector> apply_vector_scaling_x | ( | const SmartPtr< const Vector > & | v | ) | [pure virtual] |
Returns an x-scaled version of the given vector.
Implemented in StandardScalingBase.
Referenced by NLPScalingObject::unapply_grad_obj_scaling().
virtual SmartPtr<Vector> unapply_vector_scaling_x_NonConst | ( | const SmartPtr< const Vector > & | v | ) | [pure virtual] |
Returns an x-unscaled version of the given vector.
Implemented in StandardScalingBase.
Referenced by NLPScalingObject::apply_grad_obj_scaling_NonConst().
virtual SmartPtr<const Vector> unapply_vector_scaling_x | ( | const SmartPtr< const Vector > & | v | ) | [pure virtual] |
Returns an x-unscaled version of the given vector.
Implemented in StandardScalingBase.
Referenced by NLPScalingObject::apply_grad_obj_scaling().
virtual SmartPtr<Vector> apply_vector_scaling_d_NonConst | ( | const SmartPtr< const Vector > & | v | ) | [pure virtual] |
Returns an d-scaled version of the given vector.
Implemented in StandardScalingBase.
Referenced by NLPScalingObject::apply_vector_scaling_d_LU_NonConst().
virtual SmartPtr<Vector> unapply_vector_scaling_d_NonConst | ( | const SmartPtr< const Vector > & | v | ) | [pure virtual] |
Returns an d-unscaled version of the given vector.
Implemented in StandardScalingBase.
Referenced by NLPScalingObject::unapply_vector_scaling_d_LU_NonConst().
virtual SmartPtr<const Matrix> apply_jac_c_scaling | ( | SmartPtr< const Matrix > | matrix | ) | [pure virtual] |
Returns a scaled version of the jacobian for c.
If the overloaded method does not make a new matrix, make sure to set the matrix ptr passed in to NULL.
Implemented in StandardScalingBase.
virtual SmartPtr<const Matrix> apply_jac_d_scaling | ( | SmartPtr< const Matrix > | matrix | ) | [pure virtual] |
Returns a scaled version of the jacobian for d If the overloaded method does not create a new matrix, make sure to set the matrix ptr passed in to NULL.
Implemented in StandardScalingBase.
virtual SmartPtr<const SymMatrix> apply_hessian_scaling | ( | SmartPtr< const SymMatrix > | matrix | ) | [pure virtual] |
Returns a scaled version of the hessian of the lagrangian If the overloaded method does not create a new matrix, make sure to set the matrix ptr passed in to NULL.
Implemented in StandardScalingBase.
SmartPtr< Vector > apply_vector_scaling_x_LU_NonConst | ( | const Matrix & | Px_LU, | |
const SmartPtr< const Vector > & | lu, | |||
const VectorSpace & | x_space | |||
) |
Methods for scaling bounds - these wrap those above.
Returns an x-scaled vector in the x_L or x_U space
References NLPScalingObject::apply_vector_scaling_x_NonConst(), Ipopt::ConstPtr(), NLPScalingObject::have_x_scaling(), VectorSpace::MakeNew(), Matrix::MultVector(), and Matrix::TransMultVector().
Referenced by NLPScalingObject::apply_vector_scaling_x_LU().
SmartPtr< const Vector > apply_vector_scaling_x_LU | ( | const Matrix & | Px_LU, | |
const SmartPtr< const Vector > & | lu, | |||
const VectorSpace & | x_space | |||
) |
Returns an x-scaled vector in the x_L or x_U space.
References NLPScalingObject::apply_vector_scaling_x_LU_NonConst(), Ipopt::ConstPtr(), and NLPScalingObject::have_x_scaling().
SmartPtr< Vector > apply_vector_scaling_d_LU_NonConst | ( | const Matrix & | Pd_LU, | |
const SmartPtr< const Vector > & | lu, | |||
const VectorSpace & | d_space | |||
) |
Returns an d-scaled vector in the d_L or d_U space.
References NLPScalingObject::apply_vector_scaling_d_NonConst(), Ipopt::ConstPtr(), NLPScalingObject::have_d_scaling(), VectorSpace::MakeNew(), Matrix::MultVector(), and Matrix::TransMultVector().
Referenced by NLPScalingObject::apply_vector_scaling_d_LU().
SmartPtr< const Vector > apply_vector_scaling_d_LU | ( | const Matrix & | Pd_LU, | |
const SmartPtr< const Vector > & | lu, | |||
const VectorSpace & | d_space | |||
) |
Returns an d-scaled vector in the d_L or d_U space.
References NLPScalingObject::apply_vector_scaling_d_LU_NonConst(), Ipopt::ConstPtr(), and NLPScalingObject::have_d_scaling().
SmartPtr< Vector > unapply_vector_scaling_d_LU_NonConst | ( | const Matrix & | Pd_LU, | |
const SmartPtr< const Vector > & | lu, | |||
const VectorSpace & | d_space | |||
) |
Returns an d-unscaled vector in the d_L or d_U space.
References Ipopt::ConstPtr(), NLPScalingObject::have_d_scaling(), VectorSpace::MakeNew(), Matrix::MultVector(), Matrix::TransMultVector(), and NLPScalingObject::unapply_vector_scaling_d_NonConst().
Referenced by NLPScalingObject::unapply_vector_scaling_d_LU().
SmartPtr< const Vector > unapply_vector_scaling_d_LU | ( | const Matrix & | Pd_LU, | |
const SmartPtr< const Vector > & | lu, | |||
const VectorSpace & | d_space | |||
) |
Returns an d-unscaled vector in the d_L or d_U space.
References Ipopt::ConstPtr(), NLPScalingObject::have_d_scaling(), and NLPScalingObject::unapply_vector_scaling_d_LU_NonConst().
Methods for scaling the gradient of the objective - wraps the virtual methods above.
Returns a grad_f scaled version (d_f * D_x^{-1}) of the given vector
References NLPScalingObject::apply_obj_scaling(), and NLPScalingObject::unapply_vector_scaling_x_NonConst().
Referenced by NLPScalingObject::apply_grad_obj_scaling().
Returns a grad_f scaled version (d_f * D_x^{-1}) of the given vector.
References NLPScalingObject::apply_grad_obj_scaling_NonConst(), NLPScalingObject::apply_obj_scaling(), Ipopt::ConstPtr(), and NLPScalingObject::unapply_vector_scaling_x().
SmartPtr< Vector > unapply_grad_obj_scaling_NonConst | ( | const SmartPtr< const Vector > & | v | ) | [virtual] |
Returns a grad_f unscaled version (d_f * D_x^{-1}) of the given vector.
References NLPScalingObject::apply_vector_scaling_x_NonConst(), and NLPScalingObject::unapply_obj_scaling().
Referenced by NLPScalingObject::unapply_grad_obj_scaling().
Returns a grad_f unscaled version (d_f * D_x^{-1}) of the given vector.
References NLPScalingObject::apply_vector_scaling_x(), Ipopt::ConstPtr(), NLPScalingObject::unapply_grad_obj_scaling_NonConst(), and NLPScalingObject::unapply_obj_scaling().
virtual bool have_x_scaling | ( | ) | [pure virtual] |
Returns true if the primal x variables are scaled.
Implemented in StandardScalingBase.
Referenced by NLPScalingObject::apply_vector_scaling_x_LU(), and NLPScalingObject::apply_vector_scaling_x_LU_NonConst().
virtual bool have_c_scaling | ( | ) | [pure virtual] |
virtual bool have_d_scaling | ( | ) | [pure virtual] |
Returns true if the inequality constraints are scaled.
Implemented in StandardScalingBase.
Referenced by NLPScalingObject::apply_vector_scaling_d_LU(), NLPScalingObject::apply_vector_scaling_d_LU_NonConst(), NLPScalingObject::unapply_vector_scaling_d_LU(), and NLPScalingObject::unapply_vector_scaling_d_LU_NonConst().
virtual void DetermineScaling | ( | const SmartPtr< const VectorSpace > | x_space, | |
const SmartPtr< const VectorSpace > | c_space, | |||
const SmartPtr< const VectorSpace > | d_space, | |||
const SmartPtr< const MatrixSpace > | jac_c_space, | |||
const SmartPtr< const MatrixSpace > | jac_d_space, | |||
const SmartPtr< const SymMatrixSpace > | h_space, | |||
SmartPtr< const MatrixSpace > & | new_jac_c_space, | |||
SmartPtr< const MatrixSpace > & | new_jac_d_space, | |||
SmartPtr< const SymMatrixSpace > & | new_h_space | |||
) | [pure virtual] |
This method is called by the IpoptNLP's at a convenient time to compute and/or read scaling factors.
Implemented in StandardScalingBase.
virtual bool InitializeImpl | ( | const OptionsList & | options, | |
const std::string & | prefix | |||
) | [protected, pure virtual] |
Implementation of the initialization method that has to be overloaded by for each derived class.
Implemented in GradientScaling, and StandardScalingBase.
Referenced by NLPScalingObject::Initialize().
const Journalist& Jnlst | ( | ) | const [inline, protected] |
Accessor method for the journalist.
Referenced by StandardScalingBase::DetermineScaling(), and GradientScaling::DetermineScalingParametersImpl().