11template <
typename T = context::CostAbstract>
12struct PyCostFunction : T, bp::wrapper<T> {
14 using bp::wrapper<T>::get_override;
15 using CostData = CostDataAbstractTpl<Scalar>;
19 template <
typename... Args>
20 PyCostFunction(Args &&...args) : T(std::forward<Args>(args)...) {}
22 virtual void evaluate(
const ConstVectorRef &x,
const ConstVectorRef &u,
23 CostData &data)
const override {
28 const ConstVectorRef &u,
29 CostData &data)
const override {
34 virtual void computeHessians(
const ConstVectorRef &x,
const ConstVectorRef &u,
35 CostData &data)
const override {
40 virtual shared_ptr<CostData>
createData()
const override {
#define ALIGATOR_PYTHON_OVERRIDE(ret_type, cname, fname,...)
Define the body of a virtual function override. This is meant to reduce boilerplate code when exposin...
#define ALIGATOR_PYTHON_OVERRIDE_PURE(ret_type, pyname,...)
Define the body of a virtual function override. This is meant to reduce boilerplate code when exposin...
#define ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
virtual shared_ptr< CostData > createData() const
virtual void evaluate(const ConstVectorRef &x, const ConstVectorRef &u, CostData &data) const=0
Evaluate the cost function.
virtual void computeHessians(const ConstVectorRef &x, const ConstVectorRef &u, CostData &data) const=0
Compute the cost Hessians .
virtual void computeGradients(const ConstVectorRef &x, const ConstVectorRef &u, CostData &data) const=0
Compute the cost gradients .