#include <IpNLPScaling.hpp>
The overloaded classes only need to provide the scaling parameters
Public Member Functions | |
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) |
This method is called by the IpoptNLP's at a convenient time to compute and/or read scaling factors. | |
Constructors/Destructors | |
StandardScalingBase () | |
Default destructor. | |
virtual | ~StandardScalingBase () |
Default destructor. | |
virtual Number | apply_obj_scaling (const Number &f) |
Methods to map scaled and unscaled matrices. | |
virtual Number | unapply_obj_scaling (const Number &f) |
Returns an obj-unscaled version of the given scalar. | |
virtual SmartPtr< Vector > | apply_vector_scaling_x_NonConst (const SmartPtr< const Vector > &v) |
Returns an x-scaled version of the given vector. | |
virtual SmartPtr< const Vector > | apply_vector_scaling_x (const SmartPtr< const Vector > &v) |
Returns an x-scaled version of the given vector. | |
virtual SmartPtr< Vector > | unapply_vector_scaling_x_NonConst (const SmartPtr< const Vector > &v) |
Returns an x-unscaled version of the given vector. | |
virtual SmartPtr< const Vector > | unapply_vector_scaling_x (const SmartPtr< const Vector > &v) |
Returns an x-unscaled version of the given vector. | |
virtual SmartPtr< const Vector > | apply_vector_scaling_c (const SmartPtr< const Vector > &v) |
Returns an c-scaled version of the given vector. | |
virtual SmartPtr< const Vector > | unapply_vector_scaling_c (const SmartPtr< const Vector > &v) |
Returns an c-unscaled version of the given vector. | |
virtual SmartPtr< Vector > | apply_vector_scaling_c_NonConst (const SmartPtr< const Vector > &v) |
Returns an c-scaled version of the given vector. | |
virtual SmartPtr< Vector > | unapply_vector_scaling_c_NonConst (const SmartPtr< const Vector > &v) |
Returns an c-unscaled version of the given vector. | |
virtual SmartPtr< const Vector > | apply_vector_scaling_d (const SmartPtr< const Vector > &v) |
Returns an d-scaled version of the given vector. | |
virtual SmartPtr< const Vector > | unapply_vector_scaling_d (const SmartPtr< const Vector > &v) |
Returns an d-unscaled version of the given vector. | |
virtual SmartPtr< Vector > | apply_vector_scaling_d_NonConst (const SmartPtr< const Vector > &v) |
Returns an d-scaled version of the given vector. | |
virtual SmartPtr< Vector > | unapply_vector_scaling_d_NonConst (const SmartPtr< const Vector > &v) |
Returns an d-unscaled version of the given vector. | |
virtual SmartPtr< const Matrix > | apply_jac_c_scaling (SmartPtr< const Matrix > matrix) |
Returns a scaled version of the jacobian for c. | |
virtual SmartPtr< const Matrix > | apply_jac_d_scaling (SmartPtr< const Matrix > matrix) |
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) |
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. | |
Methods for determining whether scaling for entities is | |
done | |
virtual bool | have_x_scaling () |
Returns true if the primal x variables are scaled. | |
virtual bool | have_c_scaling () |
Returns true if the equality constraints are scaled. | |
virtual bool | have_d_scaling () |
Returns true if the inequality constraints are scaled. | |
Static Public Member Functions | |
static void | RegisterOptions (SmartPtr< RegisteredOptions > roptions) |
Methods for IpoptType. | |
Protected Member Functions | |
virtual bool | InitializeImpl (const OptionsList &options, const std::string &prefix) |
Overloaded initialization method. | |
virtual void | DetermineScalingParametersImpl (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, Number &df, SmartPtr< Vector > &dx, SmartPtr< Vector > &dc, SmartPtr< Vector > &dd)=0 |
This is the method that has to be overloaded by a particular scaling method that somehow computes the scaling vectors dx, dc, and dd. |
StandardScalingBase | ( | ) | [inline] |
Default destructor.
virtual ~StandardScalingBase | ( | ) | [inline, virtual] |
Default destructor.
Methods to map scaled and unscaled matrices.
Returns an obj-scaled version of the given scalar
Implements NLPScalingObject.
Returns an x-scaled version of the given vector.
Implements NLPScalingObject.
References DBG_PRINT, DBG_START_METH, and Ipopt::IsValid().
Referenced by StandardScalingBase::apply_vector_scaling_x().
Returns an x-scaled version of the given vector.
Implements NLPScalingObject.
References StandardScalingBase::apply_vector_scaling_x_NonConst(), Ipopt::ConstPtr(), and Ipopt::IsValid().
SmartPtr< Vector > unapply_vector_scaling_x_NonConst | ( | const SmartPtr< const Vector > & | v | ) | [virtual] |
Returns an x-unscaled version of the given vector.
Implements NLPScalingObject.
References DBG_PRINT, DBG_START_METH, and Ipopt::IsValid().
Referenced by StandardScalingBase::unapply_vector_scaling_x().
Returns an x-unscaled version of the given vector.
Implements NLPScalingObject.
References Ipopt::ConstPtr(), Ipopt::IsValid(), and StandardScalingBase::unapply_vector_scaling_x_NonConst().
Returns an c-scaled version of the given vector.
Implements NLPScalingObject.
References StandardScalingBase::apply_vector_scaling_c_NonConst(), Ipopt::ConstPtr(), and Ipopt::IsValid().
Returns an c-unscaled version of the given vector.
Implements NLPScalingObject.
References Ipopt::ConstPtr(), Ipopt::IsValid(), and StandardScalingBase::unapply_vector_scaling_c_NonConst().
Returns an c-scaled version of the given vector.
Implements NLPScalingObject.
References DBG_PRINT, DBG_START_METH, and Ipopt::IsValid().
Referenced by StandardScalingBase::apply_vector_scaling_c().
SmartPtr< Vector > unapply_vector_scaling_c_NonConst | ( | const SmartPtr< const Vector > & | v | ) | [virtual] |
Returns an c-unscaled version of the given vector.
Implements NLPScalingObject.
References DBG_PRINT, DBG_START_METH, and Ipopt::IsValid().
Referenced by StandardScalingBase::unapply_vector_scaling_c().
Returns an d-scaled version of the given vector.
Implements NLPScalingObject.
References StandardScalingBase::apply_vector_scaling_d_NonConst(), Ipopt::ConstPtr(), and Ipopt::IsValid().
Returns an d-unscaled version of the given vector.
Implements NLPScalingObject.
References Ipopt::ConstPtr(), Ipopt::IsValid(), and StandardScalingBase::unapply_vector_scaling_d_NonConst().
Returns an d-scaled version of the given vector.
Implements NLPScalingObject.
References DBG_PRINT, DBG_START_METH, and Ipopt::IsValid().
Referenced by StandardScalingBase::apply_vector_scaling_d().
SmartPtr< Vector > unapply_vector_scaling_d_NonConst | ( | const SmartPtr< const Vector > & | v | ) | [virtual] |
Returns an d-unscaled version of the given vector.
Implements NLPScalingObject.
References DBG_PRINT, DBG_START_METH, and Ipopt::IsValid().
Referenced by StandardScalingBase::unapply_vector_scaling_d().
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.
Implements NLPScalingObject.
References Ipopt::GetRawPtr(), and Ipopt::IsValid().
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.
Implements NLPScalingObject.
References Ipopt::GetRawPtr(), and Ipopt::IsValid().
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.
Implements NLPScalingObject.
References Ipopt::GetRawPtr(), and Ipopt::IsValid().
bool have_x_scaling | ( | ) | [virtual] |
Returns true if the primal x variables are scaled.
Implements NLPScalingObject.
References Ipopt::IsValid().
bool have_c_scaling | ( | ) | [virtual] |
Returns true if the equality constraints are scaled.
Implements NLPScalingObject.
References Ipopt::IsValid().
bool have_d_scaling | ( | ) | [virtual] |
Returns true if the inequality constraints are scaled.
Implements NLPScalingObject.
References Ipopt::IsValid().
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 | |||
) | [virtual] |
This method is called by the IpoptNLP's at a convenient time to compute and/or read scaling factors.
Implements NLPScalingObject.
References Ipopt::ConstPtr(), StandardScalingBase::DetermineScalingParametersImpl(), Ipopt::GetRawPtr(), Ipopt::IsValid(), Ipopt::J_MAIN, Ipopt::J_VECTOR, NLPScalingObject::Jnlst(), and Journalist::Printf().
void RegisterOptions | ( | SmartPtr< RegisteredOptions > | roptions | ) | [static] |
bool InitializeImpl | ( | const OptionsList & | options, | |
const std::string & | prefix | |||
) | [protected, virtual] |
Overloaded initialization method.
Implements NLPScalingObject.
Reimplemented in GradientScaling.
References OptionsList::GetNumericValue().
Referenced by GradientScaling::InitializeImpl().
virtual void DetermineScalingParametersImpl | ( | 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, | |||
Number & | df, | |||
SmartPtr< Vector > & | dx, | |||
SmartPtr< Vector > & | dc, | |||
SmartPtr< Vector > & | dd | |||
) | [protected, pure virtual] |
This is the method that has to be overloaded by a particular scaling method that somehow computes the scaling vectors dx, dc, and dd.
The pointers to those vectors can be NULL, in which case no scaling for that item will be done later.
Implemented in GradientScaling, NoNLPScalingObject, and UserScaling.
Referenced by StandardScalingBase::DetermineScaling().