7#ifndef __IPNLPSCALING_HPP__
8#define __IPNLPSCALING_HPP__
22class ScaledMatrixSpace;
23class SymScaledMatrixSpace;
46 const std::string& prefix
50 return InitializeImpl(options, prefix);
277 const std::string& prefix
444 const std::string& prefix
Class responsible for all message output.
This is the abstract base class for problem scaling.
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.
virtual SmartPtr< const Matrix > apply_jac_c_scaling(SmartPtr< const Matrix > matrix)=0
Returns a scaled version of the Jacobian for c.
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< 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< 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.
const Journalist & Jnlst() const
Accessor method for the journalist.
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 > unapply_grad_obj_scaling(const SmartPtr< const Vector > &v)
Returns a grad_f unscaled version (d_f * D_x^{-1}) 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 bool InitializeImpl(const OptionsList &options, const std::string &prefix)=0
Initialization method that has to be overloaded by for each derived class.
virtual SmartPtr< const Vector > unapply_vector_scaling_c(const SmartPtr< const Vector > &v)=0
Returns an c-unscaled version of the given vector.
virtual bool have_d_scaling()=0
Returns true if the inequality constraints are scaled.
NLPScalingObject(const NLPScalingObject &)
Copy Constructor.
virtual Number unapply_obj_scaling(const Number &f)=0
Returns an obj-unscaled version of the given scalar.
virtual ~NLPScalingObject()
Destructor.
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 Journalist > jnlst_
virtual SmartPtr< Vector > apply_vector_scaling_c_NonConst(const SmartPtr< const Vector > &v)=0
Returns an c-scaled version of the given vector.
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, const Matrix &Px_L, const Vector &x_L, const Matrix &Px_U, const Vector &x_U)=0
This method is called by the IpoptNLP's at a convenient time to compute and/or read scaling factors.
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< const Vector > apply_vector_scaling_c(const SmartPtr< const Vector > &v)=0
Returns an c-scaled version of the given vector.
virtual SmartPtr< const Matrix > apply_jac_d_scaling(SmartPtr< const Matrix > matrix)=0
Returns a scaled version of the Jacobian for d.
virtual bool have_x_scaling()=0
Returns true if the primal x variables are scaled.
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< 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_d_NonConst(const SmartPtr< const Vector > &v)=0
Returns an d-unscaled version of the given vector.
virtual SmartPtr< const SymMatrix > apply_hessian_scaling(SmartPtr< const SymMatrix > matrix)=0
Returns a scaled version of the Hessian of the Lagrangian.
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< 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.
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 bool have_c_scaling()=0
Returns true if the equality constraints are scaled.
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 Number apply_obj_scaling(const Number &f)=0
Methods to map scaled and unscaled matrices.
void operator=(const NLPScalingObject &)
Default Assignment Operator.
virtual SmartPtr< const Vector > unapply_vector_scaling_d(const SmartPtr< const Vector > &v)=0
Returns an d-unscaled version of the given vector.
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.
bool Initialize(const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
Method to initialize the options.
Class implementing the scaling object that doesn't to any scaling.
void operator=(const NoNLPScalingObject &)
Default Assignment Operator.
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, const Matrix &Px_L, const Vector &x_L, const Matrix &Px_U, const Vector &x_U, Number &df, SmartPtr< Vector > &dx, SmartPtr< Vector > &dc, SmartPtr< Vector > &dd)
Overloaded from StandardScalingBase.
virtual ~NoNLPScalingObject()
Destructor.
NoNLPScalingObject(const NoNLPScalingObject &)
Copy Constructor.
This class stores a list of user set options.
Storing the reference count of all the smart pointers that currently reference it.
Template class for Smart Pointers.
This is a base class for many standard scaling techniques.
virtual SmartPtr< Vector > apply_vector_scaling_d_NonConst(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 Number unapply_obj_scaling(const Number &f)
Returns an obj-unscaled version of the given scalar.
virtual SmartPtr< const Vector > unapply_vector_scaling_x(const SmartPtr< const Vector > &v)
Returns an x-unscaled version of the given vector.
StandardScalingBase(const StandardScalingBase &)
Copy Constructor.
virtual bool InitializeImpl(const OptionsList &options, const std::string &prefix)
Initialization method that has to be overloaded by for each derived class.
SmartPtr< ScaledMatrixSpace > scaled_jac_d_space_
Scaled Jacobian of d space.
virtual SmartPtr< Vector > unapply_vector_scaling_x_NonConst(const SmartPtr< const Vector > &v)
Returns an x-unscaled 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.
SmartPtr< ScaledMatrixSpace > scaled_jac_c_space_
Scaled Matrix Spaces.
virtual SmartPtr< const Matrix > apply_jac_c_scaling(SmartPtr< const Matrix > matrix)
Returns a scaled version of the Jacobian for c.
virtual ~StandardScalingBase()
Destructor.
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, const Matrix &Px_L, const Vector &x_L, const Matrix &Px_U, const Vector &x_U, 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...
void operator=(const StandardScalingBase &)
Default Assignment Operator.
virtual bool have_c_scaling()
Returns true if the equality constraints are scaled.
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, const Matrix &Px_L, const Vector &x_L, const Matrix &Px_U, const Vector &x_U)
This method is called by the IpoptNLP's at a convenient time to compute and/or read scaling factors.
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 > unapply_vector_scaling_c_NonConst(const SmartPtr< const Vector > &v)
Returns an c-unscaled version of the given vector.
virtual SmartPtr< const SymMatrix > apply_hessian_scaling(SmartPtr< const SymMatrix > matrix)
Returns a scaled version of the Hessian of the Lagrangian.
virtual SmartPtr< Vector > apply_vector_scaling_x_NonConst(const SmartPtr< const Vector > &v)
Returns an x-scaled version of the given vector.
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
virtual SmartPtr< Vector > apply_vector_scaling_c_NonConst(const SmartPtr< const Vector > &v)
Returns an c-scaled version of the given vector.
virtual bool have_x_scaling()
Returns true if the primal x variables are scaled.
SmartPtr< Vector > dx_
x scaling
virtual SmartPtr< const Vector > apply_vector_scaling_c(const SmartPtr< const Vector > &v)
Returns an c-scaled version of the given vector.
SmartPtr< SymScaledMatrixSpace > scaled_h_space_
Scaled Hessian of Lagrangian spacea.
virtual Number apply_obj_scaling(const Number &f)
Methods to map scaled and unscaled matrices.
virtual bool have_d_scaling()
Returns true if the inequality constraints are scaled.
Number obj_scaling_factor_
Additional scaling value for the objective function.
virtual SmartPtr< const Matrix > apply_jac_d_scaling(SmartPtr< const Matrix > matrix)
Returns a scaled version of the Jacobian for d.
virtual SmartPtr< const Vector > apply_vector_scaling_x(const SmartPtr< const Vector > &v)
Returns an x-scaled 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.
Number df_
Scaling parameters - we only need to keep copies of the objective scaling and the x scaling - the oth...
VectorSpace base class, corresponding to the Vector base class.
This file contains a base class for all exceptions and a set of macros to help with exceptions.
ipnumber Number
Type of all numbers.