Skip to content

Commit e99f461

Browse files
authored
Merge pull request #477 from jcarpent/topic/devel
Add id() helper
2 parents ca81cf1 + ee2748a commit e99f461

22 files changed

+85
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1010

1111
### Added
1212
- Added a deprecation call policy shortcut ([#466](https://github.com/stack-of-tasks/eigenpy/pull/466))
13+
- Added id() helper to retrieve unique object identifier in Python ([#477](https://github.com/stack-of-tasks/eigenpy/pull/477))
1314

1415
### Fixed
1516
- Fix register_symbolic_link_to_registered_type() for multiple successive registrations ([#471](https://github.com/stack-of-tasks/eigenpy/pull/471))

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ set(${PROJECT_NAME}_HEADERS
232232
include/eigenpy/eigen-to-python.hpp
233233
include/eigenpy/eigen-from-python.hpp
234234
include/eigenpy/eigen-typedef.hpp
235+
include/eigenpy/id.hpp
235236
include/eigenpy/numpy-map.hpp
236237
include/eigenpy/geometry.hpp
237238
include/eigenpy/geometry-conversion.hpp

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:

0 commit comments

Comments
 (0)