Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
8e53055
WiP replace shared_ptr<Manifold> by polymorphic<Manifold>
May 24, 2024
b3c4dea
Compile project without python interface
May 24, 2024
b631109
Remove shared_ptr for pinocchio model in multibody cost
May 27, 2024
2ee8340
Remove phaseSpace pointer from fly high cost
May 27, 2024
015f1bf
Remove shared_ptr of ODE and Dynamics
May 27, 2024
acf91cb
Remove shared_ptr from cost function
May 27, 2024
13d4a49
Remove shared_ptr from costAbstract
May 27, 2024
eff199d
Remove shared_ptr of stageFunction in cost and others
May 27, 2024
46b02b8
Remove shared_ptr from finite-difference
May 27, 2024
40f1afe
Change poly.h to poly.hpp
May 28, 2024
175d31b
Running cost and terminal cost free of shared_ptr
May 28, 2024
9739fbf
Use polymorphic for constraint set
May 28, 2024
a17cfe5
Replace shared_ptr of stageModel by polymorphic
May 28, 2024
32551f8
Remove last shared_ptr in rollout, integrator and frame func
May 28, 2024
4e4217e
Replace shared_ptr by polymorphic in bindings (boost not compile)
May 29, 2024
48bd0a5
Work in progress fix python tests with polymorphic
May 29, 2024
32c5b93
fwd.hpp : remove using-decl for std::unique_ptr
ManifoldFR May 30, 2024
9903b2f
[python] do not re-register polymorphic<ConstraintSetBase>
ManifoldFR May 30, 2024
a801d57
[python] fix typo
ManifoldFR May 30, 2024
b5634ba
stage-model : change some typedefs, pass polymorphic<T> to ctors by c…
ManifoldFR May 30, 2024
e925319
Enable slicing and convert stageModel to polymorphic
May 30, 2024
524af90
[python] fix exposing std::vector<polymorphic<StageModel>>
ManifoldFR May 30, 2024
1347c82
[dynamics] context.hpp : add explicit integrator abstract/data typedefs
ManifoldFR May 30, 2024
56c880f
[python] expose-integrators.cpp : fix chain of implicit conversions
ManifoldFR May 30, 2024
906bf77
[python] add polymorphic-convertible.hpp
ManifoldFR May 30, 2024
d29f629
Simplify implicit conversion when possible in bindings
May 30, 2024
d6423a0
[python] move header polymorphic-convertible to main include dir, exp…
ManifoldFR May 30, 2024
bbb5248
[python] fix conversions for MultibodyConstraintFwdDynamics
ManifoldFR May 30, 2024
c4870f0
[python] fix conversions for function expressions
ManifoldFR May 30, 2024
8c61473
[python] fix SlicingVisitor
ManifoldFR May 30, 2024
1d1dfe4
convertibleToPolymorphicBases for all bindings
May 30, 2024
f6db6d8
examples/se2-car.hpp: remove an unused make_shared
ManifoldFR May 30, 2024
de24af5
[python] add copyright heading to expose-integrators.cpp
ManifoldFR May 30, 2024
459e50b
[python] split up expose-integrators.cpp
ManifoldFR May 30, 2024
49ff861
remove superfluous include
ManifoldFR May 30, 2024
c7b4292
[solvers/proxddp] touch up run() member function
ManifoldFR May 31, 2024
a997738
[core] remove inheritance from Cloneable<>
ManifoldFR Jun 5, 2024
19154b2
[python] remove exposing StageModel::dyn_model
ManifoldFR Jun 5, 2024
6225e6c
[core] StageFunction : remove shared_from_this
ManifoldFR Jun 5, 2024
31b4c2b
[python] add visitor PolymorphicMultiBaseVisitor
ManifoldFR Jun 5, 2024
f5bf4dd
[core] constraint.hxx: fix assert
ManifoldFR Jun 5, 2024
5999e0e
[tests/python] test_example_problem : check object instance types (ch…
ManifoldFR Jun 6, 2024
9d8779e
[core] CostAbstractTpl : templatize the ctor
ManifoldFR Jun 6, 2024
86c2917
[python] pull PyCostFunction out of internal namespace, un-templatize
ManifoldFR Jun 6, 2024
343cc92
[python] pull wrapper classes out of "internal" namespace
ManifoldFR Jun 6, 2024
7553854
[python] remove forwarding ctors for wrapper classes, use-decl the pa…
ManifoldFR Jun 6, 2024
944a8d5
[modelling/costs] fix debug build for ctor
ManifoldFR Jun 6, 2024
60d467b
[solvers/fddp] fix copy
ManifoldFR Jun 6, 2024
537e8e3
[python] rearrange some includes for continous dynamics, use context …
ManifoldFR Jun 6, 2024
cfa8e6e
[python] add converter for unary function
ManifoldFR Jun 6, 2024
b2b0d92
[python] PyStageFunction wrapper converts to StageFunction
ManifoldFR Jun 6, 2024
257efc0
[core] templatize ctor of StageConstraint
ManifoldFR Jun 6, 2024
fda034d
[python] mark wrapper classes as final, unvirtualize
ManifoldFR Jun 7, 2024
af52ac0
[core] explicitly declare copy/move ctors/ops
ManifoldFR Jun 7, 2024
a7ed087
[core] constraint : change storage for ConstraintStack to two std::ve…
ManifoldFR Jun 7, 2024
dbcaa04
[python] expose-costs.cpp : use correct CreateData... visitor
ManifoldFR Jun 7, 2024
ee6ecce
[tests/python] have test_custom_pyfunction... actually test a custom …
ManifoldFR Jun 7, 2024
73f9af6
commit quadrotor_obstacles.py
ManifoldFR Jun 7, 2024
420e0fe
Use GeometryObject old API to keep Pinocchio 2 compatibility
jorisv Jun 7, 2024
90c96dd
[examples] centroidal.py : fix use of "ldlt_algo_choice"
ManifoldFR Jun 7, 2024
654a4ba
[python] expose-functions.cpp : add overload for getitem
ManifoldFR Jun 7, 2024
53514c9
python: Add custodian_and_ward to manage polymorphic lifetime
jorisv Jun 26, 2024
39e29a5
Revert "python: Add custodian_and_ward to manage polymorphic lifetime"
jorisv Jul 4, 2024
0d4e3e2
python: Use PolymorphicWrappe
jorisv Jul 4, 2024
9fbae4b
tests: Implement serialization for custom function
jorisv Jul 4, 2024
2457150
test: Fix test_example_problem.py
jorisv Jul 4, 2024
81dc233
python: return elements by reference when not using proxy
jorisv Jul 8, 2024
aed725d
ci: Disable error overlinking because of openpm
jorisv Jul 17, 2024
8363da8
examples: Fix few examples
jorisv Jul 23, 2024
b201b1e
Fix StdVectorPythonVisitor bug in bindings
Jul 24, 2024
3580d6d
Merge pull request #1 from jorisv/topic/polymorphic-binding-v2
edantec Jul 29, 2024
ea961fb
Merge branch 'devel' into topic/edantec_polymorphic
ManifoldFR Aug 21, 2024
3edad9e
[examples] quadrotor_obstacles.py : remove unused var flagged by ruff
ManifoldFR Aug 21, 2024
42a5fc1
[python] split up expose-stage.cpp
ManifoldFR Aug 29, 2024
aad317a
[examples] change default spotlight, update quadrotor
ManifoldFR Aug 29, 2024
5ff8908
tiny fix
ManifoldFR Aug 29, 2024
a8577c8
solver-fddp.hxx : remove NDEBUG dumping to .log file
ManifoldFR Aug 30, 2024
f36b8f6
update year
ManifoldFR Aug 30, 2024
8886702
remove a using-statement
ManifoldFR Sep 2, 2024
96594ae
[solvers/proxddp] do not include merit-function.hxx impl header in th…
ManifoldFR Sep 2, 2024
b5f481c
[solvers/proxddp] also remove inclusion of hxx impl file in header hp…
ManifoldFR Sep 2, 2024
8c73c22
[core] Do not include impl header stage-model.hxx in stage-model.hpp,
ManifoldFR Sep 2, 2024
b345362
[solvers/fddp] linesearch.hpp : split up in the include of <aligator/…
ManifoldFR Sep 2, 2024
e3df887
[core] Optimize some includes
ManifoldFR Sep 2, 2024
04bf60f
[core] constraint.hpp : remove "iterator" typedef
ManifoldFR Sep 2, 2024
9b34f82
[core] Change ctor signature for ExplicitDynamics
ManifoldFR Sep 2, 2024
cae1ab7
Correct some straggler shared_ptr<Manifold>
ManifoldFR Sep 3, 2024
5f58bc3
[core] Add some Tracy macros
ManifoldFR Sep 6, 2024
bc4ee6e
[cmake | workflows] set minimum version of proxsuite-nlp to 0.8.0
ManifoldFR Sep 16, 2024
01606fa
[cmake] update minimim required version of eigenpy to 3.7.0
ManifoldFR Sep 16, 2024
d009aca
[workflows] also remove bloody python 3.8 from publish workflow, require
ManifoldFR Sep 16, 2024
079b3e9
[core] change typedef ManifoldPtr in stage-model.hpp
ManifoldFR Sep 16, 2024
902fe69
[core] dynamics.hpp : do not include hxx impl file
ManifoldFR Sep 16, 2024
0665c05
[core] cost-abstact.hpp : evaluate() and computeJacobians() no longer…
ManifoldFR Sep 16, 2024
ad30def
Fix crocoddyl compatibility layer (it compiles !)
ManifoldFR Sep 16, 2024
8769b2b
packaging: Add proxsuite-nlp as a runtime dependency
jorisv Sep 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/conda/conda-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
- pinocchio>=3.0.0
- eigen
- fmt
- proxsuite-nlp
- proxsuite-nlp>=0.8.0
- benchmark
- crocoddyl
- example-robot-data
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
matrix:
os: ["ubuntu-latest", "macos-latest"]
build_type: [Release]
python-version: ["3.8", "3.10", "3.12"]
python-version: ["3.10", "3.11", "3.12"]
include:
- python-version: "3.8"
numpy-version: "1.22"
- python-version: "3.10"
numpy-version: "1.22"
- python-version: "3.11"
numpy-version: "1.24"
- python-version: "3.12"
numpy-version: "1.26"
steps:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Change storage for `ConstraintStack` to using two `std::vector<polymorphic<>>` the struct `StageConstraintTpl` is now merely a convenient API shortcut for the end-user.
- Remove `StageConstraintTpl::nr()` (in C++ only)
- Update minimum required version of eigenpy to 3.7.0
- Add tracy macros to `stage-model.hxx`
- Change minimum required version of proxsuite-nlp to 0.8.0

## [0.7.0] - 2024-09-12

### Changed
Expand Down
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,12 @@ add_project_dependency(Boost REQUIRED COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
if(BUILD_PYTHON_INTERFACE)
set(PYTHON_COMPONENTS Interpreter Development NumPy)
findpython(REQUIRED)
add_project_dependency(eigenpy 3.4.0 REQUIRED PKG_CONFIG_REQUIRES "eigenpy >= 3.4.0")
add_project_dependency(eigenpy 3.7.0 REQUIRED PKG_CONFIG_REQUIRES "eigenpy >= 3.7.0")
set(PYLIB_NAME "py${PROJECT_NAME}")
set(${PYLIB_NAME}_INSTALL_DIR ${PYTHON_SITELIB}/${PROJECT_NAME})
endif()

add_project_dependency(
proxsuite-nlp 0.7.0 REQUIRED PKG_CONFIG_REQUIRES "0.7.0 <= proxsuite-nlp < 0.8.0"
)
add_project_dependency(proxsuite-nlp 0.8.0 REQUIRED PKG_CONFIG_REQUIRES "proxsuite-nlp >= 0.8.0")

set(LIB_SOURCES src/utils/logger.cpp)

Expand Down
8 changes: 4 additions & 4 deletions bench/lqr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ TrajOptProblem define_problem(const std::size_t nsteps, const int dim = 56,

using Dynamics = dynamics::LinearDiscreteDynamicsTpl<T>;
using QuadCost = QuadraticCostTpl<T>;
auto dynptr = std::make_shared<Dynamics>(A, B, c_);
auto space = dynptr->space_next_;
auto dynptr = Dynamics(A, B, c_);
auto space = dynptr.space_next_;

auto rcost = std::make_shared<QuadCost>(w_x, w_u);
auto stage = std::make_shared<StageModel>(rcost, dynptr);
auto rcost = QuadCost(w_x, w_u);
auto stage = StageModel(rcost, dynptr);
auto term_cost = rcost;

VectorXd x0(dim);
Expand Down
44 changes: 26 additions & 18 deletions bindings/python/include/aligator/python/costs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,50 @@

namespace aligator {
namespace python {
namespace internal {
/// @brief Wrapper for the CostDataAbstractTpl class and its children.
template <typename T = context::CostAbstract>
struct PyCostFunction : T, bp::wrapper<T> {
struct PyCostFunction final
: context::CostAbstract,
proxsuite::nlp::python::PolymorphicWrapper<PyCostFunction,
context::CostAbstract> {
using Scalar = context::Scalar;
using bp::wrapper<T>::get_override;
using T = context::CostAbstract;
using CostData = CostDataAbstractTpl<Scalar>;
using context::CostAbstract::CostAbstractTpl;
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar);

/// forwarding constructor
template <typename... Args>
PyCostFunction(Args &&...args) : T(std::forward<Args>(args)...) {}

virtual void evaluate(const ConstVectorRef &x, const ConstVectorRef &u,
CostData &data) const override {
void evaluate(const ConstVectorRef &x, const ConstVectorRef &u,
CostData &data) const override {
ALIGATOR_PYTHON_OVERRIDE_PURE(void, "evaluate", x, u, boost::ref(data));
}

virtual void computeGradients(const ConstVectorRef &x,
const ConstVectorRef &u,
CostData &data) const override {
void computeGradients(const ConstVectorRef &x, const ConstVectorRef &u,
CostData &data) const override {
ALIGATOR_PYTHON_OVERRIDE_PURE(void, "computeGradients", x, u,
boost::ref(data));
}

virtual void computeHessians(const ConstVectorRef &x, const ConstVectorRef &u,
CostData &data) const override {
void computeHessians(const ConstVectorRef &x, const ConstVectorRef &u,
CostData &data) const override {
ALIGATOR_PYTHON_OVERRIDE_PURE(void, "computeHessians", x, u,
boost::ref(data));
}

virtual shared_ptr<CostData> createData() const override {
shared_ptr<CostData> createData() const override {
ALIGATOR_PYTHON_OVERRIDE(shared_ptr<CostData>, T, createData, );
}
};
} // namespace internal

shared_ptr<CostData> default_createData() const { return T::createData(); }
};
} // namespace python
} // namespace aligator

namespace boost::python::objects {

template <>
struct value_holder<aligator::python::PyCostFunction>
: proxsuite::nlp::python::OwningNonOwningHolder<
aligator::python::PyCostFunction> {
using OwningNonOwningHolder::OwningNonOwningHolder;
};

} // namespace boost::python::objects
84 changes: 68 additions & 16 deletions bindings/python/include/aligator/python/functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@

#include "aligator/core/function-abstract.hpp"
#include "aligator/core/unary-function.hpp"
#include "aligator/core/dynamics.hpp"

#include "aligator/modelling/dynamics/context.hpp"
#include "aligator/modelling/dynamics/integrator-abstract.hpp"

#include "aligator/python/polymorphic-convertible.hpp"

#include "proxsuite-nlp/python/polymorphic.hpp"

namespace aligator {
namespace python {
namespace internal {
/// Wrapper for the StageFunction class and any virtual children that avoids
/// having to redeclare Python overrides for these children.
///
Expand All @@ -18,15 +25,15 @@ namespace internal {
///
/// @tparam FunctionBase The virtual class to expose.
template <class FunctionBase = context::StageFunction>
struct PyStageFunction : FunctionBase, bp::wrapper<FunctionBase> {
struct PyStageFunction final
: FunctionBase,
proxsuite::nlp::python::PolymorphicWrapper<PyStageFunction<FunctionBase>,
FunctionBase> {
using Scalar = typename FunctionBase::Scalar;
using Data = StageFunctionDataTpl<Scalar>;
using FunctionBase::FunctionBase;
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar);

// Use perfect forwarding to the FunctionBase constructors.
template <typename... Args>
PyStageFunction(Args &&...args) : FunctionBase(std::forward<Args>(args)...) {}

void evaluate(const ConstVectorRef &x, const ConstVectorRef &u,
const ConstVectorRef &y, Data &data) const override {
ALIGATOR_PYTHON_OVERRIDE_PURE(void, "evaluate", x, u, y, boost::ref(data));
Expand Down Expand Up @@ -57,7 +64,10 @@ struct PyStageFunction : FunctionBase, bp::wrapper<FunctionBase> {
};

template <typename UFunction = context::UnaryFunction>
struct PyUnaryFunction : UFunction, bp::wrapper<UFunction> {
struct PyUnaryFunction final
: UFunction,
proxsuite::nlp::python::PolymorphicWrapper<PyUnaryFunction<UFunction>,
UFunction> {
using Scalar = typename UFunction::Scalar;
static_assert(
std::is_base_of_v<UnaryFunctionTpl<Scalar>, UFunction>,
Expand Down Expand Up @@ -89,14 +99,20 @@ struct PyUnaryFunction : UFunction, bp::wrapper<UFunction> {
Data &data) const {
UFunction::computeVectorHessianProducts(x, lbda, data);
}
};

} // namespace internal
shared_ptr<Data> createData() const override {
ALIGATOR_PYTHON_OVERRIDE(shared_ptr<Data>, UFunction, createData, );
}

shared_ptr<Data> default_createData() const {
return UFunction::createData();
}
};

template <typename Class>
struct SlicingVisitor : bp::def_visitor<SlicingVisitor<Class>> {
using Scalar = typename Class::Scalar;
using FS = FunctionSliceXprTpl<Scalar, Class>;
using SliceType = FunctionSliceXprTpl<Scalar, Class>;

template <typename Iterator, typename Fn>
static auto do_with_slice(Fn &&fun, bp::slice::range<Iterator> &range) {
Expand All @@ -107,23 +123,24 @@ struct SlicingVisitor : bp::def_visitor<SlicingVisitor<Class>> {
fun(*range.start);
}

static auto get_slice(shared_ptr<Class> const &fn, bp::slice slice_obj) {
static auto get_slice(xyz::polymorphic<Class> const &fn,
bp::slice slice_obj) {
std::vector<int> indices((unsigned)fn->nr);
std::iota(indices.begin(), indices.end(), 0);
auto bounds = slice_obj.get_indices(indices.cbegin(), indices.cend());
std::vector<int> out{};

do_with_slice([&](int i) { out.push_back(i); }, bounds);
return std::make_shared<FS>(fn, out);
return SliceType(fn, out);
}

static auto get_from_index(shared_ptr<Class> const &fn, const int idx) {
return std::make_shared<FS>(fn, idx);
static auto get_from_index(xyz::polymorphic<Class> const &fn, const int idx) {
return SliceType(fn, idx);
}

static auto get_from_indices(shared_ptr<Class> const &fn,
static auto get_from_indices(xyz::polymorphic<Class> const &fn,
std::vector<int> const &indices) {
return std::make_shared<FS>(fn, indices);
return SliceType(fn, indices);
}

template <typename... Args> void visit(bp::class_<Args...> &cl) const {
Expand All @@ -135,3 +152,38 @@ struct SlicingVisitor : bp::def_visitor<SlicingVisitor<Class>> {

} // namespace python
} // namespace aligator

namespace boost::python::objects {

template <>
struct value_holder<aligator::python::PyStageFunction<>>
: proxsuite::nlp::python::OwningNonOwningHolder<
aligator::python::PyStageFunction<>> {
using OwningNonOwningHolder::OwningNonOwningHolder;
};

template <>
struct value_holder<
aligator::python::PyStageFunction<aligator::context::DynamicsModel>>
: proxsuite::nlp::python::OwningNonOwningHolder<
aligator::python::PyStageFunction<aligator::context::DynamicsModel>> {
using OwningNonOwningHolder::OwningNonOwningHolder;
};

template <>
struct value_holder<
aligator::python::PyStageFunction<aligator::context::IntegratorAbstract>>
: proxsuite::nlp::python::OwningNonOwningHolder<
aligator::python::PyStageFunction<
aligator::context::IntegratorAbstract>> {
using OwningNonOwningHolder::OwningNonOwningHolder;
};

template <>
struct value_holder<aligator::python::PyUnaryFunction<>>
: proxsuite::nlp::python::OwningNonOwningHolder<
aligator::python::PyUnaryFunction<>> {
using OwningNonOwningHolder::OwningNonOwningHolder;
};

} // namespace boost::python::objects
2 changes: 2 additions & 0 deletions bindings/python/include/aligator/python/fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <eigenpy/eigenpy.hpp>
#include <eigenpy/std-vector.hpp>

#include <proxsuite-nlp/python/polymorphic.hpp>

namespace aligator {
/// @brief The Python bindings.
namespace python {
Expand Down
50 changes: 37 additions & 13 deletions bindings/python/include/aligator/python/modelling/continuous.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@

#include "aligator/python/fwd.hpp"

#include "aligator/modelling/dynamics/context.hpp"
#include "aligator/modelling/dynamics/continuous-dynamics-abstract.hpp"
#include "aligator/modelling/dynamics/ode-abstract.hpp"

#include "proxsuite-nlp/python/polymorphic.hpp"

namespace aligator {
namespace python {

template <class T = dynamics::ContinuousDynamicsAbstractTpl<context::Scalar>>
struct PyContinuousDynamics : T, bp::wrapper<T> {
using Data = dynamics::ContinuousDynamicsDataTpl<context::Scalar>;
template <class T = context::ContinuousDynamicsAbstract>
struct PyContinuousDynamics final
: T,
proxsuite::nlp::python::PolymorphicWrapper<PyContinuousDynamics<T>, T> {
using Data = context::ContinuousDynamicsData;
ALIGATOR_DYNAMIC_TYPEDEFS(context::Scalar);

template <class... Args> PyContinuousDynamics(Args &&...args) : T(args...) {}
using T::T;

void evaluate(const ConstVectorRef &x, const ConstVectorRef &u,
const ConstVectorRef &xdot, Data &data) const override {
Expand All @@ -36,21 +40,23 @@ struct PyContinuousDynamics : T, bp::wrapper<T> {
shared_ptr<Data> default_createData() const { return T::createData(); }
};

template <class T = dynamics::ODEAbstractTpl<context::Scalar>>
struct PyODEAbstract : T, bp::wrapper<T> {
template <class T = context::ODEAbstract>
struct PyODEAbstract final
: T,
proxsuite::nlp::python::PolymorphicWrapper<PyODEAbstract<T>, T> {
using Scalar = context::Scalar;
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar);
using Data = dynamics::ContinuousDynamicsDataTpl<context::Scalar>;
using Data = context::ODEData;

template <class... Args> PyODEAbstract(Args &&...args) : T(args...) {}
using T::T;

virtual void forward(const ConstVectorRef &x, const ConstVectorRef &u,
Data &data) const override {
void forward(const ConstVectorRef &x, const ConstVectorRef &u,
Data &data) const override {
ALIGATOR_PYTHON_OVERRIDE_PURE(void, "forward", x, u, boost::ref(data));
}

virtual void dForward(const ConstVectorRef &x, const ConstVectorRef &u,
Data &data) const override {
void dForward(const ConstVectorRef &x, const ConstVectorRef &u,
Data &data) const override {
ALIGATOR_PYTHON_OVERRIDE_PURE(void, "dForward", x, u, boost::ref(data));
}

Expand All @@ -63,3 +69,21 @@ struct PyODEAbstract : T, bp::wrapper<T> {

} // namespace python
} // namespace aligator
//
namespace boost::python::objects {

template <>
struct value_holder<aligator::python::PyContinuousDynamics<>>
: proxsuite::nlp::python::OwningNonOwningHolder<
aligator::python::PyContinuousDynamics<>> {
using OwningNonOwningHolder::OwningNonOwningHolder;
};

template <>
struct value_holder<aligator::python::PyODEAbstract<>>
: proxsuite::nlp::python::OwningNonOwningHolder<
aligator::python::PyODEAbstract<>> {
using OwningNonOwningHolder::OwningNonOwningHolder;
};

} // namespace boost::python::objects
Loading