13template <
typename _Scalar>
struct BaseFunctionTpl :
math_types<_Scalar> {
20 using Scalar = _Scalar;
24 : nx_(
nx), ndx_(
ndx), nr_(
nr) {}
30 virtual VectorXs
operator()(
const ConstVectorRef &x)
const = 0;
32 virtual ~BaseFunctionTpl() =
default;
35 int nx()
const {
return nx_; }
37 int ndx()
const {
return ndx_; }
39 int nr()
const {
return nr_; }
44template <
typename _Scalar>
45struct C1FunctionTpl :
public BaseFunctionTpl<_Scalar> {
47 using Scalar = _Scalar;
48 using Base = BaseFunctionTpl<_Scalar>;
53 C1FunctionTpl(
const int nx,
const int ndx,
const int nr)
56 : C1FunctionTpl(manifold.
nx(), manifold.
ndx(),
nr) {}
60 MatrixRef Jout)
const = 0;
67 MatrixXs Jout(this->
nr(), this->
ndx());
76template <
typename _Scalar>
77struct C2FunctionTpl :
public C1FunctionTpl<_Scalar> {
79 using Scalar = _Scalar;
80 using Base = C1FunctionTpl<_Scalar>;
85 C2FunctionTpl(
const int nx,
const int ndx,
const int nr)
88 : C2FunctionTpl(manifold.
nx(), manifold.
ndx(),
nr) {}
92 const ConstVectorRef &,
93 MatrixRef Hout)
const {
101#ifdef PROXSUITE_NLP_ENABLE_TEMPLATE_INSTANTIATION
102#include "proxsuite-nlp/function-base.txx"
Forward declarations and configuration macros.
#define PROXSUITE_NLP_DYNAMIC_TYPEDEFS(Scalar)
virtual VectorXs operator()(const ConstVectorRef &x) const =0
Evaluate the residual at a given point x.
MatrixXs computeJacobian(const ConstVectorRef &x) const
Jacobian matrix of the constraint function.
virtual void computeJacobian(const ConstVectorRef &x, MatrixRef Jout) const =0
Jacobian matrix of the constraint function.
virtual void vectorHessianProduct(const ConstVectorRef &, const ConstVectorRef &, MatrixRef Hout) const
Vector-hessian product.
virtual int nx() const =0
Get manifold representation dimension.
virtual int ndx() const =0
Get manifold tangent space dimension.
Typedefs for math (Eigen vectors, matrices) depending on scalar type.