Narayan Kamath | c981c48 | 2012-11-02 10:59:05 +0000 | [diff] [blame] | 1 | #ifndef EIGEN_ORDERINGMETHODS_MODULE_H |
| 2 | #define EIGEN_ORDERINGMETHODS_MODULE_H |
| 3 | |
| 4 | #include "SparseCore" |
| 5 | |
| 6 | #include "src/Core/util/DisableStupidWarnings.h" |
| 7 | |
Carlos Hernandez | 7faaa9f | 2014-08-05 17:53:32 -0700 | [diff] [blame] | 8 | /** |
Narayan Kamath | c981c48 | 2012-11-02 10:59:05 +0000 | [diff] [blame] | 9 | * \defgroup OrderingMethods_Module OrderingMethods module |
| 10 | * |
Carlos Hernandez | 7faaa9f | 2014-08-05 17:53:32 -0700 | [diff] [blame] | 11 | * This module is currently for internal use only |
| 12 | * |
| 13 | * It defines various built-in and external ordering methods for sparse matrices. |
| 14 | * They are typically used to reduce the number of elements during |
| 15 | * the sparse matrix decomposition (LLT, LU, QR). |
| 16 | * Precisely, in a preprocessing step, a permutation matrix P is computed using |
| 17 | * those ordering methods and applied to the columns of the matrix. |
| 18 | * Using for instance the sparse Cholesky decomposition, it is expected that |
| 19 | * the nonzeros elements in LLT(A*P) will be much smaller than that in LLT(A). |
| 20 | * |
| 21 | * |
| 22 | * Usage : |
Narayan Kamath | c981c48 | 2012-11-02 10:59:05 +0000 | [diff] [blame] | 23 | * \code |
| 24 | * #include <Eigen/OrderingMethods> |
| 25 | * \endcode |
Carlos Hernandez | 7faaa9f | 2014-08-05 17:53:32 -0700 | [diff] [blame] | 26 | * |
| 27 | * A simple usage is as a template parameter in the sparse decomposition classes : |
| 28 | * |
| 29 | * \code |
| 30 | * SparseLU<MatrixType, COLAMDOrdering<int> > solver; |
| 31 | * \endcode |
| 32 | * |
| 33 | * \code |
| 34 | * SparseQR<MatrixType, COLAMDOrdering<int> > solver; |
| 35 | * \endcode |
| 36 | * |
| 37 | * It is possible as well to call directly a particular ordering method for your own purpose, |
| 38 | * \code |
| 39 | * AMDOrdering<int> ordering; |
| 40 | * PermutationMatrix<Dynamic, Dynamic, int> perm; |
| 41 | * SparseMatrix<double> A; |
| 42 | * //Fill the matrix ... |
| 43 | * |
| 44 | * ordering(A, perm); // Call AMD |
| 45 | * \endcode |
| 46 | * |
| 47 | * \note Some of these methods (like AMD or METIS), need the sparsity pattern |
| 48 | * of the input matrix to be symmetric. When the matrix is structurally unsymmetric, |
| 49 | * Eigen computes internally the pattern of \f$A^T*A\f$ before calling the method. |
| 50 | * If your matrix is already symmetric (at leat in structure), you can avoid that |
| 51 | * by calling the method with a SelfAdjointView type. |
| 52 | * |
| 53 | * \code |
| 54 | * // Call the ordering on the pattern of the lower triangular matrix A |
| 55 | * ordering(A.selfadjointView<Lower>(), perm); |
| 56 | * \endcode |
Narayan Kamath | c981c48 | 2012-11-02 10:59:05 +0000 | [diff] [blame] | 57 | */ |
| 58 | |
Carlos Hernandez | 7faaa9f | 2014-08-05 17:53:32 -0700 | [diff] [blame] | 59 | #ifndef EIGEN_MPL2_ONLY |
Narayan Kamath | c981c48 | 2012-11-02 10:59:05 +0000 | [diff] [blame] | 60 | #include "src/OrderingMethods/Amd.h" |
Carlos Hernandez | 7faaa9f | 2014-08-05 17:53:32 -0700 | [diff] [blame] | 61 | #endif |
Narayan Kamath | c981c48 | 2012-11-02 10:59:05 +0000 | [diff] [blame] | 62 | |
Carlos Hernandez | 7faaa9f | 2014-08-05 17:53:32 -0700 | [diff] [blame] | 63 | #include "src/OrderingMethods/Ordering.h" |
Narayan Kamath | c981c48 | 2012-11-02 10:59:05 +0000 | [diff] [blame] | 64 | #include "src/Core/util/ReenableStupidWarnings.h" |
| 65 | |
| 66 | #endif // EIGEN_ORDERINGMETHODS_MODULE_H |