Skip to content

Commit c3df621

Browse files
Add equivalent to eigenpy::register_symbolic_link_to_registered_type (#10)
* Add equivalent to eigenpy::register_symbolic_link_to_registered_type * Re write the if condition with register_symbolic_link_to_registered_type * Renamed register_symbolic_link_to_registered_type into check_registration_alias with attribute deprecated
1 parent a7a0c7d commit c3df621

26 files changed

+121
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
build*/
22
.cache/
33
__pycache__
4+
.pytest_cache
45

56
# pixi environments
67
.pixi

include/nanoeigenpy/decompositions/col-piv-householder-qr.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ void exposeColPivHouseholderQRSolver(nb::module_ m, const char *name) {
2727
using Scalar = typename MatrixType::Scalar;
2828
using RealScalar = typename MatrixType::RealScalar;
2929
using VectorType = Eigen::Matrix<Scalar, -1, 1>;
30+
31+
if (check_registration_alias<Solver>(m)) {
32+
return;
33+
}
3034
nb::class_<Solver>(
3135
m, name,
3236
"This class performs a rank-revealing QR decomposition of a matrix A "

include/nanoeigenpy/decompositions/complete-orthogonal-decomposition.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ void exposeCompleteOrthogonalDecompositionSolver(nb::module_ m,
3131
using RealScalar = typename MatrixType::RealScalar;
3232
using VectorType = Eigen::Matrix<Scalar, -1, 1>;
3333

34+
if (check_registration_alias<Solver>(m)) {
35+
return;
36+
}
3437
nb::class_<Solver>(
3538
m, name,
3639
"This class performs a rank-revealing complete orthogonal "

include/nanoeigenpy/decompositions/eigen-solver.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ void exposeEigenSolver(nb::module_ m, const char *name) {
1515
using MatrixType = _MatrixType;
1616
using Solver = Eigen::EigenSolver<MatrixType>;
1717

18+
if (check_registration_alias<Solver>(m)) {
19+
return;
20+
}
1821
nb::class_<Solver>(m, name, "Eigen solver.")
19-
2022
.def(nb::init<>(), "Default constructor.")
2123
.def(nb::init<Eigen::DenseIndex>(), nb::arg("size"),
2224
"Default constructor with memory preallocation.")

include/nanoeigenpy/decompositions/full-piv-householder-qr.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ void exposeFullPivHouseholderQRSolver(nb::module_ m, const char *name) {
2828
using RealScalar = typename MatrixType::RealScalar;
2929
using VectorType = Eigen::Matrix<Scalar, -1, 1>;
3030

31+
if (check_registration_alias<Solver>(m)) {
32+
return;
33+
}
3134
nb::class_<Solver>(
3235
m, name,
3336
"This class performs a rank-revealing QR decomposition of a matrix A "

include/nanoeigenpy/decompositions/householder-qr.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ void exposeHouseholderQRSolver(nb::module_ m, const char *name) {
2222
using Scalar = typename MatrixType::Scalar;
2323
using VectorType = Eigen::Matrix<Scalar, -1, 1>;
2424

25+
if (check_registration_alias<Solver>(m)) {
26+
return;
27+
}
2528
nb::class_<Solver>(
2629
m, name,
2730
"This class performs a QR decomposition of a matrix A into matrices "

include/nanoeigenpy/decompositions/ldlt.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ void exposeLDLTSolver(nb::module_ m, const char *name) {
2222
using Scalar = typename MatrixType::Scalar;
2323
using VectorType = Eigen::Matrix<Scalar, -1, 1>;
2424

25+
if (check_registration_alias<Solver>(m)) {
26+
return;
27+
}
2528
nb::class_<Solver>(
2629
m, name,
2730
"Robust Cholesky decomposition of a matrix with pivoting.\n\n"

include/nanoeigenpy/decompositions/llt.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ void exposeLLTSolver(nb::module_ m, const char *name) {
2121
using Chol = Eigen::LLT<MatrixType>;
2222
using Scalar = typename MatrixType::Scalar;
2323
using VectorType = Eigen::Matrix<Scalar, -1, 1>;
24+
25+
if (check_registration_alias<Chol>(m)) {
26+
return;
27+
}
2428
nb::class_<Chol>(
2529
m, name,
2630
"Standard Cholesky decomposition (LL^T) of a matrix and associated "

include/nanoeigenpy/decompositions/permutation-matrix.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ void exposePermutationMatrix(nb::module_ m, const char *name) {
1919
using VectorIndex = Eigen::Matrix<StorageIndex, SizeAtCompileTime, 1, 0,
2020
MaxSizeAtCompileTime, 1>;
2121

22+
if (check_registration_alias<PermutationMatrix>(m)) {
23+
return;
24+
}
2225
nb::class_<PermutationMatrix>(m, name,
2326
"Permutation matrix.\n"
2427
"This class represents a permutation matrix, "

0 commit comments

Comments
 (0)