proxsuite-nlp  0.10.0
A primal-dual augmented Lagrangian-type solver for nonlinear programming on manifolds.
Loading...
Searching...
No Matches
proxsuite::nlp::QuadraticResidualCostTpl< _Scalar > Struct Template Reference

Quadratic function \(\frac{1}{2} r^\top Qr + b^\top r + c\) of a residual. More...

#include <proxsuite-nlp/modelling/costs/quadratic-residual.hpp>

Inheritance diagram for proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >:
[legend]
Collaboration diagram for proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >:
[legend]

Public Types

using Scalar = _Scalar
 
using FunctionType = C2FunctionTpl<Scalar>
 
using RowMatrixXs = Eigen::Matrix<Scalar, -1, -1, Eigen::RowMajor>
 
using Base = CostFunctionBaseTpl<Scalar>
 
using FunctionPtr = shared_ptr<FunctionType>
 
- Public Types inherited from proxsuite::nlp::CostFunctionBaseTpl< _Scalar >
using Scalar
 
using Base
 
- Public Types inherited from proxsuite::nlp::C2FunctionTpl< _Scalar >
using Scalar
 
using Base
 
- Public Types inherited from proxsuite::nlp::C1FunctionTpl< _Scalar >
using Scalar
 
using Base
 
- Public Types inherited from proxsuite::nlp::BaseFunctionTpl< _Scalar >
using Scalar
 
- Public Types inherited from proxsuite::nlp::math_types< _Scalar >
using Scalar = _Scalar
 

Public Member Functions

 QuadraticResidualCostTpl (FunctionPtr residual, const ConstMatrixRef &weights, const ConstVectorRef &slope, const Scalar constant=Scalar(0.))
 
 QuadraticResidualCostTpl (FunctionPtr residual, const ConstMatrixRef &weights, const Scalar constant=Scalar(0.))
 
template<typename Underlying , typename... ResidualArgs>
 QuadraticResidualCostTpl (const ConstMatrixRef &weights, const ConstVectorRef &slope, const Scalar constant, ResidualArgs &...args)
 Constructor using the template parameter as the underlying type of the residual.
 
Scalar call (const ConstVectorRef &x) const
 Evaluate the cost function.
 
void computeGradient (const ConstVectorRef &x, VectorRef out) const
 
void computeHessian (const ConstVectorRef &x, MatrixRef out) const
 
VectorXs computeGradient (const ConstVectorRef &x) const
 
MatrixXs computeHessian (const ConstVectorRef &x) const
 
- Public Member Functions inherited from proxsuite::nlp::CostFunctionBaseTpl< _Scalar >
 CostFunctionBaseTpl (const int nx, const int ndx)
 
 CostFunctionBaseTpl (const ManifoldAbstractTpl< _Scalar > &manifold)
 
VectorXs computeGradient (const ConstVectorRef &x) const
 
MatrixXs computeHessian (const ConstVectorRef &x) const
 
VectorXs operator() (const ConstVectorRef &x) const
 Evaluate the residual at a given point x.
 
void computeJacobian (const ConstVectorRef &x, MatrixRef Jout) const
 Jacobian matrix of the constraint function.
 
void vectorHessianProduct (const ConstVectorRef &x, const ConstVectorRef &v, MatrixRef Hout) const
 Vector-hessian product.
 
virtual ~CostFunctionBaseTpl ()=default
 
- Public Member Functions inherited from proxsuite::nlp::C2FunctionTpl< _Scalar >
 C2FunctionTpl (const int nx, const int ndx, const int nr)
 
 C2FunctionTpl (const ManifoldAbstractTpl< _Scalar > &manifold, const int nr)
 
- Public Member Functions inherited from proxsuite::nlp::C1FunctionTpl< _Scalar >
 C1FunctionTpl (const int nx, const int ndx, const int nr)
 
 C1FunctionTpl (const ManifoldAbstractTpl< _Scalar > &manifold, const int nr)
 
MatrixXs computeJacobian (const ConstVectorRef &x) const
 Jacobian matrix of the constraint function.
 
- Public Member Functions inherited from proxsuite::nlp::BaseFunctionTpl< _Scalar >
 BaseFunctionTpl (const int nx, const int ndx, const int nr)
 
 BaseFunctionTpl (const ManifoldAbstractTpl< _Scalar > &manifold, const int nr)
 
virtual ~BaseFunctionTpl ()=default
 
int nx () const
 Get function input vector size (representation of manifold).
 
int ndx () const
 Get input manifold's tangent space dimension.
 
int nr () const
 Get function codimension.
 

Public Attributes

 Scalar
 
FunctionPtr residual_
 Residual function \(r(x)\) the composite cost is constructed over.
 
MatrixXs weights_
 Weights \(Q\).
 
VectorXs slope_
 Slope \(b\).
 
Scalar constant_
 Constant term \(c\).
 
bool gauss_newton_
 
- Public Attributes inherited from proxsuite::nlp::CostFunctionBaseTpl< _Scalar >
 Scalar
 
- Public Attributes inherited from proxsuite::nlp::C2FunctionTpl< _Scalar >
 Scalar
 
- Public Attributes inherited from proxsuite::nlp::C1FunctionTpl< _Scalar >
 Scalar
 
- Public Attributes inherited from proxsuite::nlp::BaseFunctionTpl< _Scalar >
 Scalar
 
- Public Attributes inherited from proxsuite::nlp::math_types< _Scalar >
 _Scalar
 

Protected Attributes

VectorXs err
 
VectorXs tmp_w_err
 
MatrixXs Jres
 
RowMatrixXs JtW
 
MatrixXs H
 
- Protected Attributes inherited from proxsuite::nlp::BaseFunctionTpl< _Scalar >
int nx_
 
int ndx_
 
int nr_
 

Detailed Description

template<typename _Scalar>
struct proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >

Quadratic function \(\frac{1}{2} r^\top Qr + b^\top r + c\) of a residual.

Cost function which is a quadratic function

\[ \frac12 r(x)^\top Q r(x) + b^\top r(x) + c \]

of a residual function \(r :\calX\to \RR^p\).

Definition at line 22 of file quadratic-residual.hpp.

Member Typedef Documentation

◆ Scalar

template<typename _Scalar >
using proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::Scalar = _Scalar

Definition at line 24 of file quadratic-residual.hpp.

◆ FunctionType

template<typename _Scalar >
using proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::FunctionType = C2FunctionTpl<Scalar>

Definition at line 25 of file quadratic-residual.hpp.

◆ RowMatrixXs

template<typename _Scalar >
using proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::RowMatrixXs = Eigen::Matrix<Scalar, -1, -1, Eigen::RowMajor>

Definition at line 27 of file quadratic-residual.hpp.

◆ Base

Definition at line 28 of file quadratic-residual.hpp.

◆ FunctionPtr

template<typename _Scalar >
using proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::FunctionPtr = shared_ptr<FunctionType>

Definition at line 31 of file quadratic-residual.hpp.

Constructor & Destructor Documentation

◆ QuadraticResidualCostTpl() [1/3]

template<typename _Scalar >
proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::QuadraticResidualCostTpl ( FunctionPtr residual,
const ConstMatrixRef & weights,
const ConstVectorRef & slope,
const Scalar constant = Scalar(0.) )

◆ QuadraticResidualCostTpl() [2/3]

template<typename _Scalar >
proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::QuadraticResidualCostTpl ( FunctionPtr residual,
const ConstMatrixRef & weights,
const Scalar constant = Scalar(0.) )
inline

Definition at line 47 of file quadratic-residual.hpp.

◆ QuadraticResidualCostTpl() [3/3]

template<typename _Scalar >
template<typename Underlying , typename... ResidualArgs>
proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::QuadraticResidualCostTpl ( const ConstMatrixRef & weights,
const ConstVectorRef & slope,
const Scalar constant,
ResidualArgs &... args )
inline

Constructor using the template parameter as the underlying type of the residual.

Definition at line 55 of file quadratic-residual.hpp.

Member Function Documentation

◆ call()

template<typename _Scalar >
Scalar proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::call ( const ConstVectorRef & x) const
virtual

Evaluate the cost function.

Implements proxsuite::nlp::CostFunctionBaseTpl< _Scalar >.

◆ computeGradient() [1/2]

template<typename _Scalar >
void proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::computeGradient ( const ConstVectorRef & x,
VectorRef out ) const
virtual

◆ computeHessian() [1/2]

template<typename _Scalar >
void proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::computeHessian ( const ConstVectorRef & x,
MatrixRef out ) const
virtual

◆ computeGradient() [2/2]

template<typename _Scalar >
VectorXs proxsuite::nlp::CostFunctionBaseTpl< Scalar >::computeGradient ( const ConstVectorRef & x) const
inline

Definition at line 50 of file cost-function.hpp.

◆ computeHessian() [2/2]

template<typename _Scalar >
MatrixXs proxsuite::nlp::CostFunctionBaseTpl< Scalar >::computeHessian ( const ConstVectorRef & x) const
inline

Definition at line 56 of file cost-function.hpp.

Member Data Documentation

◆ Scalar

Definition at line 26 of file quadratic-residual.hpp.

◆ residual_

Residual function \(r(x)\) the composite cost is constructed over.

Definition at line 34 of file quadratic-residual.hpp.

◆ weights_

template<typename _Scalar >
MatrixXs proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::weights_

Weights \(Q\).

Definition at line 36 of file quadratic-residual.hpp.

◆ slope_

template<typename _Scalar >
VectorXs proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::slope_

Slope \(b\).

Definition at line 38 of file quadratic-residual.hpp.

◆ constant_

Constant term \(c\).

Definition at line 40 of file quadratic-residual.hpp.

◆ gauss_newton_

template<typename _Scalar >
bool proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::gauss_newton_

Definition at line 41 of file quadratic-residual.hpp.

◆ err

template<typename _Scalar >
VectorXs proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::err
mutableprotected

Definition at line 68 of file quadratic-residual.hpp.

◆ tmp_w_err

template<typename _Scalar >
VectorXs proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::tmp_w_err
mutableprotected

Definition at line 69 of file quadratic-residual.hpp.

◆ Jres

template<typename _Scalar >
MatrixXs proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::Jres
mutableprotected

Definition at line 70 of file quadratic-residual.hpp.

◆ JtW

template<typename _Scalar >
RowMatrixXs proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::JtW
mutableprotected

Definition at line 71 of file quadratic-residual.hpp.

◆ H

template<typename _Scalar >
MatrixXs proxsuite::nlp::QuadraticResidualCostTpl< _Scalar >::H
mutableprotected

Definition at line 72 of file quadratic-residual.hpp.


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