1 // This file is part of Eigen, a lightweight C++ template library
4 // This Source Code Form is subject to the terms of the Mozilla
5 // Public License v. 2.0. If a copy of the MPL was not distributed
6 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 #ifndef EIGEN_ORDERINGMETHODS_MODULE_H
9 #define EIGEN_ORDERINGMETHODS_MODULE_H
13 #include "src/Core/util/DisableStupidWarnings.h"
16 * \defgroup OrderingMethods_Module OrderingMethods module
18 * This module is currently for internal use only
20 * It defines various built-in and external ordering methods for sparse matrices.
21 * They are typically used to reduce the number of elements during
22 * the sparse matrix decomposition (LLT, LU, QR).
23 * Precisely, in a preprocessing step, a permutation matrix P is computed using
24 * those ordering methods and applied to the columns of the matrix.
25 * Using for instance the sparse Cholesky decomposition, it is expected that
26 * the nonzeros elements in LLT(A*P) will be much smaller than that in LLT(A).
31 * #include <Eigen/OrderingMethods>
34 * A simple usage is as a template parameter in the sparse decomposition classes :
37 * SparseLU<MatrixType, COLAMDOrdering<int> > solver;
41 * SparseQR<MatrixType, COLAMDOrdering<int> > solver;
44 * It is possible as well to call directly a particular ordering method for your own purpose,
46 * AMDOrdering<int> ordering;
47 * PermutationMatrix<Dynamic, Dynamic, int> perm;
48 * SparseMatrix<double> A;
49 * //Fill the matrix ...
51 * ordering(A, perm); // Call AMD
54 * \note Some of these methods (like AMD or METIS), need the sparsity pattern
55 * of the input matrix to be symmetric. When the matrix is structurally unsymmetric,
56 * Eigen computes internally the pattern of \f$A^T*A\f$ before calling the method.
57 * If your matrix is already symmetric (at leat in structure), you can avoid that
58 * by calling the method with a SelfAdjointView type.
61 * // Call the ordering on the pattern of the lower triangular matrix A
62 * ordering(A.selfadjointView<Lower>(), perm);
66 #ifndef EIGEN_MPL2_ONLY
67 #include "src/OrderingMethods/Amd.h"
70 #include "src/OrderingMethods/Ordering.h"
71 #include "src/Core/util/ReenableStupidWarnings.h"
73 #endif // EIGEN_ORDERINGMETHODS_MODULE_H