Skip to content

Commit 47b86cb

Browse files
committed
[bindings/python] expose-manifold.cpp : simplify a tad
1 parent ce78cb6 commit 47b86cb

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

bindings/python/src/expose-manifold.cpp

+12-17
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,17 @@ using namespace proxsuite::nlp::python;
1212
using context::ConstVectorRef;
1313
using context::Manifold;
1414
using context::MatrixRef;
15+
using context::MatrixXs;
1516
using context::Scalar;
1617
using context::VectorRef;
18+
using context::VectorSpace;
19+
using context::VectorXs;
1720
using PolyManifold = xyz::polymorphic<Manifold>;
1821
using CartesianProduct = CartesianProductTpl<Scalar>;
1922

20-
void exposeManifoldBase();
2123
void exposeCartesianProduct();
2224

2325
void exposeManifolds() {
24-
25-
exposeManifoldBase();
26-
27-
/* Basic vector space */
28-
bp::class_<VectorSpaceTpl<Scalar>, bp::bases<Manifold>>(
29-
"VectorSpace", "Basic Euclidean vector space.", bp::no_init)
30-
.def(bp::init<const int>(("self"_a, "dim")))
31-
.def(PolymorphicVisitor<PolyManifold>())
32-
.enable_pickling_(true);
33-
34-
exposeCartesianProduct();
35-
}
36-
37-
void exposeManifoldBase() {
38-
using context::MatrixXs;
39-
using context::VectorXs;
4026
register_polymorphic_to_python<PolyManifold>();
4127

4228
using BinaryFunTypeRet = VectorXs (Manifold::*)(const ConstVectorRef &,
@@ -125,6 +111,15 @@ void exposeManifoldBase() {
125111
"StdVec_Manifold",
126112
eigenpy::details::overload_base_get_item_for_std_vector<
127113
std::vector<PolyManifold>>());
114+
115+
/* Basic vector space */
116+
bp::class_<VectorSpace, bp::bases<Manifold>>(
117+
"VectorSpace", "Basic Euclidean vector space.", bp::no_init)
118+
.def(bp::init<const int>(("self"_a, "dim")))
119+
.def(PolymorphicVisitor<PolyManifold>())
120+
.enable_pickling_(true);
121+
122+
exposeCartesianProduct();
128123
}
129124

130125
} // namespace aligator::python

0 commit comments

Comments
 (0)