Skip to content

Commit 4c12269

Browse files
committed
all: add id() helper to all exposed classes
1 parent ae3081b commit 4c12269

16 files changed

+36
-14
lines changed

include/eigenpy/angle-axis.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ class AngleAxisVisitor : public bp::def_visitor<AngleAxisVisitor<AngleAxis> > {
118118
static void expose() {
119119
bp::class_<AngleAxis>(
120120
"AngleAxis", "AngleAxis representation of a rotation.\n\n", bp::no_init)
121-
.def(AngleAxisVisitor<AngleAxis>());
121+
.def(AngleAxisVisitor<AngleAxis>())
122+
.def(IdVisitor<AngleAxis>());
122123

123124
// Cast to Eigen::RotationBase
124125
bp::implicitly_convertible<AngleAxis, RotationBase>();

include/eigenpy/decompositions/EigenSolver.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ struct EigenSolverVisitor
7575
}
7676

7777
static void expose(const std::string& name) {
78-
bp::class_<Solver>(name.c_str(), bp::no_init).def(EigenSolverVisitor());
78+
bp::class_<Solver>(name.c_str(), bp::no_init)
79+
.def(EigenSolverVisitor())
80+
.def(IdVisitor<Solver>());
7981
}
8082

8183
private:

include/eigenpy/decompositions/LDLT.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2021 INRIA
2+
* Copyright 2020-2024 INRIA
33
*/
44

55
#ifndef __eigenpy_decomposition_ldlt_hpp__
@@ -119,6 +119,7 @@ struct LDLTSolverVisitor
119119
"have zeros in the bottom right rank(A) - n submatrix. Avoiding the "
120120
"square root on D also stabilizes the computation.",
121121
bp::no_init)
122+
.def(IdVisitor<Solver>())
122123
.def(LDLTSolverVisitor());
123124
}
124125

include/eigenpy/decompositions/LLT.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2021 INRIA
2+
* Copyright 2020-2024 INRIA
33
*/
44

55
#ifndef __eigenpy_decomposition_llt_hpp__
@@ -115,6 +115,7 @@ struct LLTSolverVisitor
115115
"remains useful in many other situations like generalised eigen "
116116
"problems with hermitian matrices.",
117117
bp::no_init)
118+
.def(IdVisitor<Solver>())
118119
.def(LLTSolverVisitor());
119120
}
120121

include/eigenpy/decompositions/PermutationMatrix.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ struct PermutationMatrixVisitor
9797
"This class represents a permutation matrix, "
9898
"internally stored as a vector of integers.",
9999
bp::no_init)
100+
.def(IdVisitor<PermutationMatrix>())
100101
.def(PermutationMatrixVisitor());
101102
}
102103
};

include/eigenpy/decompositions/SelfAdjointEigenSolver.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 INRIA
2+
* Copyright 2020-2024 INRIA
33
*/
44

55
#ifndef __eigenpy_decomposition_self_adjoint_eigen_solver_hpp__
@@ -84,6 +84,7 @@ struct SelfAdjointEigenSolverVisitor
8484

8585
static void expose(const std::string& name) {
8686
bp::class_<Solver>(name.c_str(), bp::no_init)
87+
.def(IdVisitor<Solver>())
8788
.def(SelfAdjointEigenSolverVisitor());
8889
}
8990

include/eigenpy/decompositions/minres.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ struct MINRESSolverVisitor
165165
"defaults are the size of the problem for the maximal number of "
166166
"iterations and NumTraits<Scalar>::epsilon() for the tolerance.\n",
167167
bp::no_init)
168-
.def(MINRESSolverVisitor());
168+
.def(MINRESSolverVisitor())
169+
.def(IdVisitor<Solver>());
169170
}
170171

171172
private:

include/eigenpy/decompositions/sparse/LDLT.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ struct SimplicialLDLTVisitor
5959
"prior to the factorization such that the factorized matrix is P A "
6060
"P^-1.",
6161
bp::no_init)
62-
.def(SimplicialLDLTVisitor());
62+
.def(SimplicialLDLTVisitor())
63+
.def(IdVisitor<Solver>());
6364
}
6465

6566
private:

include/eigenpy/decompositions/sparse/LLT.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ struct SimplicialLLTVisitor
5757
"prior to the factorization such that the factorized matrix is P A "
5858
"P^-1.",
5959
bp::no_init)
60-
.def(SimplicialLLTVisitor());
60+
.def(SimplicialLLTVisitor())
61+
.def(IdVisitor<Solver>());
6162
}
6263
};
6364

include/eigenpy/quaternion.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@ class QuaternionVisitor
364364
"'q*v' (rotating 'v' by 'q'), "
365365
"'q==q', 'q!=q', 'q[0..3]'.",
366366
bp::no_init)
367-
.def(QuaternionVisitor<Quaternion>());
367+
.def(QuaternionVisitor<Quaternion>())
368+
.def(IdVisitor<Quaternion>());
368369

369370
// Cast to Eigen::QuaternionBase and vice-versa
370371
bp::implicitly_convertible<Quaternion, QuaternionBase>();

0 commit comments

Comments
 (0)