7#include <proxsuite-nlp/manifold-base.hpp>
8#include <proxsuite-nlp/third-party/polymorphic_cxx14.hpp>
13template <
typename _Scalar>
struct CostAbstractTpl {
20 xyz::polymorphic<Manifold>
space;
32 virtual void evaluate(
const ConstVectorRef &x,
const ConstVectorRef &u,
37 const ConstVectorRef &u,
CostData &data)
const;
44 return std::make_shared<CostData>(
ndx(),
nu);
50template <
typename Scalar>
52 const ConstVectorRef &,
57template <
typename Scalar>
59 const ConstVectorRef &,
64template <
typename Scalar>
66 const ConstVectorRef &,
112#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
113#include "aligator/core/cost-abstract.txx"
#define ALIGATOR_RUNTIME_ERROR(...)
Stage costs for control problems.
virtual void evaluate(const ConstVectorRef &x, const ConstVectorRef &u, CostData &data) const
Evaluate the cost function.
virtual ~CostAbstractTpl()=default
CostAbstractTpl(U &&space, const int nu)
virtual shared_ptr< CostData > createData() const
virtual void computeGradients(const ConstVectorRef &x, const ConstVectorRef &u, CostData &data) const
Compute the cost gradients .
ManifoldAbstractTpl< Scalar > Manifold
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
xyz::polymorphic< Manifold > space
State dimension.
virtual void computeHessians(const ConstVectorRef &x, const ConstVectorRef &u, CostData &data) const
Compute the cost Hessians .
Data struct for CostAbstractTpl.
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
CostDataAbstractTpl(const CostAbstractTpl< Scalar > &cost)
virtual ~CostDataAbstractTpl()=default
CostDataAbstractTpl(const int ndx, const int nu)