|
1 | 1 | /// Copyright 2025 INRIA |
2 | 2 |
|
3 | | -#include <nanobind/nanobind.h> |
4 | 3 | #include <nanobind/stl/string.h> |
5 | 4 |
|
6 | 5 | #include "nanoeigenpy/decompositions.hpp" |
7 | 6 | #include "nanoeigenpy/geometry.hpp" |
8 | | -#include "nanoeigenpy/solvers.hpp" |
9 | 7 | #include "nanoeigenpy/utils/is-approx.hpp" |
10 | 8 | #include "nanoeigenpy/constants.hpp" |
11 | 9 |
|
| 10 | +#include "./internal.h" |
| 11 | + |
12 | 12 | using namespace nanoeigenpy; |
13 | | -namespace nb = nanobind; |
14 | 13 |
|
15 | | -using Scalar = double; |
16 | | -static constexpr int Options = Eigen::ColMajor; |
17 | | -using Matrix = Eigen::Matrix<Scalar, -1, -1, Options>; |
18 | | -using Vector = Eigen::Matrix<Scalar, -1, 1>; |
19 | 14 | using Quaternion = Eigen::Quaternion<Scalar, Options>; |
20 | 15 | using SparseMatrix = Eigen::SparseMatrix<Scalar, Options>; |
21 | 16 |
|
@@ -84,28 +79,3 @@ NB_MODULE(nanoeigenpy, m) { |
84 | 79 | "Get the set of SIMD instructions used in Eigen when this module was " |
85 | 80 | "compiled."); |
86 | 81 | } |
87 | | - |
88 | | -void exposeSolvers(nb::module_& m) { |
89 | | - exposeIdentityPreconditioner<Scalar>(m, "IdentityPreconditioner"); |
90 | | - exposeDiagonalPreconditioner<Scalar>(m, "DiagonalPreconditioner"); |
91 | | -#if EIGEN_VERSION_AT_LEAST(3, 3, 5) |
92 | | - exposeLeastSquareDiagonalPreconditioner<Scalar>( |
93 | | - m, "LeastSquareDiagonalPreconditioner"); |
94 | | -#endif |
95 | | - |
96 | | - // Solvers |
97 | | - using Eigen::Lower; |
98 | | - using Eigen::Upper; |
99 | | - using ConjugateGradient = Eigen::ConjugateGradient<Matrix, Lower | Upper>; |
100 | | - exposeConjugateGradient<ConjugateGradient>(m, "ConjugateGradient"); |
101 | | - using LeastSquaresConjugateGradient = Eigen::LeastSquaresConjugateGradient< |
102 | | - Matrix, Eigen::LeastSquareDiagonalPreconditioner<Scalar>>; |
103 | | - exposeLeastSquaresConjugateGradient<LeastSquaresConjugateGradient>( |
104 | | - m, "LeastSquaresConjugateGradient"); |
105 | | - |
106 | | - using IdentityConjugateGradient = |
107 | | - Eigen::ConjugateGradient<Matrix, Lower | Upper, |
108 | | - Eigen::IdentityPreconditioner>; |
109 | | - exposeConjugateGradient<IdentityConjugateGradient>( |
110 | | - m, "IdentityConjugateGradient"); |
111 | | -} |
0 commit comments