|
2 | 2 | * Copyright 2017-2025 CNRS INRIA |
3 | 3 | */ |
4 | 4 |
|
5 | | -#include <Eigen/Core> |
6 | | - |
7 | | -#if EIGEN_VERSION_AT_LEAST(3, 2, 0) |
8 | | - |
9 | | -#include "eigenpy/solvers/ConjugateGradient.hpp" |
10 | 5 | #include "eigenpy/solvers/solvers.hpp" |
11 | 6 |
|
12 | | -#if EIGEN_VERSION_AT_LEAST(3, 3, 5) |
13 | | -#include "eigenpy/solvers/LeastSquaresConjugateGradient.hpp" |
14 | | -#endif |
15 | | - |
16 | | -#include "eigenpy/solvers/BiCGSTAB.hpp" |
17 | | -#include "eigenpy/solvers/MINRES.hpp" |
18 | | - |
19 | | -#include "eigenpy/solvers/IncompleteLUT.hpp" |
20 | | -#include "eigenpy/solvers/IncompleteCholesky.hpp" |
| 7 | +#include "eigenpy/fwd.hpp" |
21 | 8 |
|
22 | 9 | namespace eigenpy { |
23 | | -void exposeSolvers() { |
24 | | - using namespace Eigen; |
25 | | - |
26 | | - using Eigen::Lower; |
27 | | - |
28 | | - using Eigen::BiCGSTAB; |
29 | | - using Eigen::ConjugateGradient; |
30 | | - using Eigen::LeastSquaresConjugateGradient; |
31 | 10 |
|
32 | | - using Eigen::DiagonalPreconditioner; |
33 | | - using Eigen::IdentityPreconditioner; |
34 | | - using Eigen::LeastSquareDiagonalPreconditioner; |
| 11 | +void exposeBiCGSTAB(); |
| 12 | +void exposeMINRES(); |
| 13 | +void exposeConjugateGradient(); |
| 14 | +void exposeLeastSquaresConjugateGradient(); |
| 15 | +void exposeIncompleteCholesky(); |
| 16 | +void exposeIncompleteLUT(); |
35 | 17 |
|
36 | | - using IdentityBiCGSTAB = BiCGSTAB<MatrixXd, IdentityPreconditioner>; |
37 | | - using IdentityConjugateGradient = |
38 | | - ConjugateGradient<MatrixXd, Lower, IdentityPreconditioner>; |
39 | | - using IdentityLeastSquaresConjugateGradient = |
40 | | - LeastSquaresConjugateGradient<MatrixXd, IdentityPreconditioner>; |
41 | | - using DiagonalLeastSquaresConjugateGradient = LeastSquaresConjugateGradient< |
42 | | - MatrixXd, DiagonalPreconditioner<typename MatrixXd::Scalar>>; |
43 | | - |
44 | | - ConjugateGradientVisitor<ConjugateGradient<MatrixXd, Lower>>::expose( |
45 | | - "ConjugateGradient"); |
46 | | - ConjugateGradientVisitor<IdentityConjugateGradient>::expose( |
47 | | - "IdentityConjugateGradient"); |
48 | | - |
49 | | - LeastSquaresConjugateGradientVisitor<LeastSquaresConjugateGradient< |
50 | | - MatrixXd, LeastSquareDiagonalPreconditioner<MatrixXd::Scalar>>>:: |
51 | | - expose("LeastSquaresConjugateGradient"); |
52 | | - LeastSquaresConjugateGradientVisitor<IdentityLeastSquaresConjugateGradient>:: |
53 | | - expose("IdentityLeastSquaresConjugateGradient"); |
54 | | - LeastSquaresConjugateGradientVisitor<DiagonalLeastSquaresConjugateGradient>:: |
55 | | - expose("DiagonalLeastSquaresConjugateGradient"); |
56 | | - |
57 | | - BiCGSTABVisitor<BiCGSTAB<MatrixXd>>::expose("BiCGSTAB"); |
58 | | - BiCGSTABVisitor<IdentityBiCGSTAB>::expose("IdentityBiCGSTAB"); |
59 | | - |
60 | | - MINRESSolverVisitor<MatrixXd>::expose("MINRES"); |
61 | | - |
62 | | - typedef SparseMatrix<double, ColMajor> ColMajorSparseMatrix; |
63 | | - IncompleteLUTVisitor<ColMajorSparseMatrix>::expose("IncompleteLUT"); |
64 | | - IncompleteCholeskyVisitor<ColMajorSparseMatrix>::expose("IncompleteCholesky"); |
| 18 | +void exposeSolvers() { |
| 19 | + exposeBiCGSTAB(); |
| 20 | + exposeMINRES(); |
| 21 | + exposeConjugateGradient(); |
| 22 | + exposeLeastSquaresConjugateGradient(); |
| 23 | + exposeIncompleteCholesky(); |
| 24 | + exposeIncompleteLUT(); |
65 | 25 | } |
66 | 26 | } // namespace eigenpy |
67 | | - |
68 | | -#endif |
0 commit comments