Sleipnir C++ API
Loading...
Searching...
No Matches
slp::ProblemScaling< Scalar > Struct Template Reference

#include </home/runner/work/Sleipnir/Sleipnir/include/sleipnir/optimization/solver/util/problem_scaling.hpp>

Public Types

using DenseVector = Eigen::Vector< Scalar, Eigen::Dynamic >
 Type alias for dense vector.
 
using SparseMatrix = Eigen::SparseMatrix< Scalar >
 Type alias for sparse matrix.
 
using SparseVector = Eigen::SparseVector< Scalar >
 Type alias for sparse vector.
 

Public Member Functions

 ProblemScaling ()=default
 Constructs identity problem scaling.
 
 ProblemScaling (Scalar f, const DenseVector &c_e, const DenseVector &c_i)
 
 ProblemScaling (const DenseVector &g)
 
 ProblemScaling (const DenseVector &g, const SparseMatrix &A_e)
 
 ProblemScaling (const DenseVector &g, const SparseMatrix &A_e, const SparseMatrix &A_i)
 
bool is_identity () const
 

Public Attributes

Scalar f = Scalar(1)
 Cost scaling factor d_f.
 
DenseVector c_e
 Equality constraint scaling factors d_cₑ.
 
DenseVector c_i
 Inequality constraint scaling factors d_cᵢ.
 

Detailed Description

template<typename Scalar>
struct slp::ProblemScaling< Scalar >

Automatic problem scaling factors.

Template Parameters
ScalarScalar type.

Constructor & Destructor Documentation

◆ ProblemScaling() [1/4]

template<typename Scalar >
slp::ProblemScaling< Scalar >::ProblemScaling ( Scalar  f,
const DenseVector c_e,
const DenseVector c_i 
)
inline

Constructs problem scaling from explicit factors.

Parameters
fCost scaling factor d_f.
c_eEquality constraint scaling factors d_cₑ.
c_iInequality constraint scaling factors d_cᵢ.

◆ ProblemScaling() [2/4]

template<typename Scalar >
slp::ProblemScaling< Scalar >::ProblemScaling ( const DenseVector g)
inlineexplicit

Computes Newton problem scaling.

Scales the cost so the largest gradient component at the starting point is at most gₘₐₓ:

d_f = min(1, gₘₐₓ / ‖∇f(x₀)‖_∞)

See §3.8 Automatic Scaling of the Problem Statement in [2].

Parameters
gCost gradient ∇f, evaluated at the starting point.

◆ ProblemScaling() [3/4]

template<typename Scalar >
slp::ProblemScaling< Scalar >::ProblemScaling ( const DenseVector g,
const SparseMatrix A_e 
)
inline

Computes SQP problem scaling.

Scales the cost and each equality constraint so the largest gradient component at the starting point is at most gₘₐₓ:

d_f = min(1, gₘₐₓ / ‖∇f(x₀)‖_∞) d_cₑ[j] = min(1, gₘₐₓ / ‖∇cₑⱼ(x₀)‖_∞)

See §3.8 Automatic Scaling of the Problem Statement in [2].

Parameters
gCost gradient ∇f, evaluated at the starting point.
A_eEquality constraint Jacobian Aₑ, evaluated at the starting point.

◆ ProblemScaling() [4/4]

template<typename Scalar >
slp::ProblemScaling< Scalar >::ProblemScaling ( const DenseVector g,
const SparseMatrix A_e,
const SparseMatrix A_i 
)
inline

Computes interior-point problem scaling.

Scales the cost and each constraint so the largest gradient component at the starting point is at most gₘₐₓ:

d_f = min(1, gₘₐₓ / ‖∇f(x₀)‖_∞) d_c[j] = min(1, gₘₐₓ / ‖∇cⱼ(x₀)‖_∞)

See §3.8 Automatic Scaling of the Problem Statement in [2].

Parameters
gCost gradient ∇f, evaluated at the starting point.
A_eEquality constraint Jacobian Aₑ, evaluated at the starting point.
A_iInequality constraint Jacobian Aᵢ, evaluated at the starting point.

Member Function Documentation

◆ is_identity()

template<typename Scalar >
bool slp::ProblemScaling< Scalar >::is_identity ( ) const
inline

Whether the problem scaling is identity.

Returns
True if the problem scaling is identity.

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