Ipopt Documentation  
 
Loading...
Searching...
No Matches
Ipopt::GradientScaling Class Reference

This class does problem scaling by setting the scaling parameters based on the maximum of the gradient at the user provided initial point. More...

#include <IpGradientScaling.hpp>

+ Inheritance diagram for Ipopt::GradientScaling:

Public Member Functions

Constructors/Destructors
 GradientScaling (const SmartPtr< NLP > &nlp)
 
virtual ~GradientScaling ()
 Destructor.
 
- Public Member Functions inherited from Ipopt::StandardScalingBase
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.
 
 StandardScalingBase ()
 
virtual ~StandardScalingBase ()
 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< Vectorapply_vector_scaling_x_NonConst (const SmartPtr< const Vector > &v)
 Returns an x-scaled version of the given vector.
 
virtual SmartPtr< const Vectorapply_vector_scaling_x (const SmartPtr< const Vector > &v)
 Returns an x-scaled version of the given vector.
 
virtual SmartPtr< Vectorunapply_vector_scaling_x_NonConst (const SmartPtr< const Vector > &v)
 Returns an x-unscaled version of the given vector.
 
virtual SmartPtr< const Vectorunapply_vector_scaling_x (const SmartPtr< const Vector > &v)
 Returns an x-unscaled version of the given vector.
 
virtual SmartPtr< const Vectorapply_vector_scaling_c (const SmartPtr< const Vector > &v)
 Returns an c-scaled version of the given vector.
 
virtual SmartPtr< const Vectorunapply_vector_scaling_c (const SmartPtr< const Vector > &v)
 Returns an c-unscaled version of the given vector.
 
virtual SmartPtr< Vectorapply_vector_scaling_c_NonConst (const SmartPtr< const Vector > &v)
 Returns an c-scaled version of the given vector.
 
virtual SmartPtr< Vectorunapply_vector_scaling_c_NonConst (const SmartPtr< const Vector > &v)
 Returns an c-unscaled version of the given vector.
 
virtual SmartPtr< const Vectorapply_vector_scaling_d (const SmartPtr< const Vector > &v)
 Returns an d-scaled version of the given vector.
 
virtual SmartPtr< const Vectorunapply_vector_scaling_d (const SmartPtr< const Vector > &v)
 Returns an d-unscaled version of the given vector.
 
virtual SmartPtr< Vectorapply_vector_scaling_d_NonConst (const SmartPtr< const Vector > &v)
 Returns an d-scaled version of the given vector.
 
virtual SmartPtr< Vectorunapply_vector_scaling_d_NonConst (const SmartPtr< const Vector > &v)
 Returns an d-unscaled version of the given vector.
 
virtual SmartPtr< const Matrixapply_jac_c_scaling (SmartPtr< const Matrix > matrix)
 Returns a scaled version of the Jacobian for c.
 
virtual SmartPtr< const Matrixapply_jac_d_scaling (SmartPtr< const Matrix > matrix)
 Returns a scaled version of the Jacobian for d.
 
virtual SmartPtr< const SymMatrixapply_hessian_scaling (SmartPtr< const SymMatrix > matrix)
 Returns a scaled version of the Hessian of the Lagrangian.
 
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.
 
- Public Member Functions inherited from Ipopt::NLPScalingObject
bool Initialize (const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
 Method to initialize the options.
 
 NLPScalingObject ()
 
virtual ~NLPScalingObject ()
 Destructor.
 
SmartPtr< Vectorapply_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 Vectorapply_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< Vectorapply_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 Vectorapply_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< Vectorunapply_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 Vectorunapply_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< Vectorapply_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 Vectorapply_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< Vectorunapply_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 Vectorunapply_grad_obj_scaling (const SmartPtr< const Vector > &v)
 Returns a grad_f unscaled version (d_f * D_x^{-1}) of the given vector.
 
- Public Member Functions inherited from Ipopt::ReferencedObject
 ReferencedObject ()
 
virtual ~ReferencedObject ()
 
Index ReferenceCount () const
 
void AddRef (const Referencer *referencer) const
 
void ReleaseRef (const Referencer *referencer) const
 

Static Public Member Functions

static void RegisterOptions (const SmartPtr< RegisteredOptions > &roptions)
 Register the options for this class.
 
- Static Public Member Functions inherited from Ipopt::StandardScalingBase
static void RegisterOptions (SmartPtr< RegisteredOptions > roptions)
 

Protected Member Functions

bool InitializeImpl (const OptionsList &options, const std::string &prefix)
 Initialize the object from the options.
 
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)
 This is the method that has to be overloaded by a particular scaling method that somehow computes the scaling vectors dx, dc, and dd.
 
- Protected Member Functions inherited from Ipopt::NLPScalingObject
const JournalistJnlst () const
 Accessor method for the journalist.
 

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.

 GradientScaling (const GradientScaling &)
 Copy Constructor.
 
void operator= (const GradientScaling &)
 Default Assignment Operator.
 

Private Attributes

SmartPtr< NLPnlp_
 pointer to the NLP to get scaling parameters
 
Number scaling_max_gradient_
 maximum allowed gradient before scaling is performed
 
Number scaling_obj_target_gradient_
 target size of norm for objective gradient
 
Number scaling_constr_target_gradient_
 target size of norm for constraint gradients
 
Number scaling_min_value_
 minimum value of a scaling parameter
 

Detailed Description

This class does problem scaling by setting the scaling parameters based on the maximum of the gradient at the user provided initial point.

Definition at line 20 of file IpGradientScaling.hpp.

Constructor & Destructor Documentation

◆ GradientScaling() [1/2]

Ipopt::GradientScaling::GradientScaling ( const SmartPtr< NLP > &  nlp)
inline

Definition at line 25 of file IpGradientScaling.hpp.

◆ ~GradientScaling()

virtual Ipopt::GradientScaling::~GradientScaling ( )
inlinevirtual

Destructor.

Definition at line 34 of file IpGradientScaling.hpp.

◆ GradientScaling() [2/2]

Ipopt::GradientScaling::GradientScaling ( const GradientScaling )
private

Copy Constructor.

Member Function Documentation

◆ RegisterOptions()

static void Ipopt::GradientScaling::RegisterOptions ( const SmartPtr< RegisteredOptions > &  roptions)
static

Register the options for this class.

◆ InitializeImpl()

bool Ipopt::GradientScaling::InitializeImpl ( const OptionsList options,
const std::string &  prefix 
)
protectedvirtual

Initialize the object from the options.

Reimplemented from Ipopt::StandardScalingBase.

◆ DetermineScalingParametersImpl()

virtual void Ipopt::GradientScaling::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 
)
protectedvirtual

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.

Implements Ipopt::StandardScalingBase.

◆ operator=()

void Ipopt::GradientScaling::operator= ( const GradientScaling )
private

Default Assignment Operator.

Member Data Documentation

◆ nlp_

SmartPtr<NLP> Ipopt::GradientScaling::nlp_
private

pointer to the NLP to get scaling parameters

Definition at line 91 of file IpGradientScaling.hpp.

◆ scaling_max_gradient_

Number Ipopt::GradientScaling::scaling_max_gradient_
private

maximum allowed gradient before scaling is performed

Definition at line 94 of file IpGradientScaling.hpp.

◆ scaling_obj_target_gradient_

Number Ipopt::GradientScaling::scaling_obj_target_gradient_
private

target size of norm for objective gradient

Definition at line 97 of file IpGradientScaling.hpp.

◆ scaling_constr_target_gradient_

Number Ipopt::GradientScaling::scaling_constr_target_gradient_
private

target size of norm for constraint gradients

Definition at line 100 of file IpGradientScaling.hpp.

◆ scaling_min_value_

Number Ipopt::GradientScaling::scaling_min_value_
private

minimum value of a scaling parameter

Definition at line 103 of file IpGradientScaling.hpp.


The documentation for this class was generated from the following file: