Eigen  3.4.90 (git rev a4098ac676528a83cfb73d4d26ce1b42ec05f47c)
OrderingMethods module

Detailed Description

This module is currently for internal use only

It defines various built-in and external ordering methods for sparse matrices. They are typically used to reduce the number of elements during the sparse matrix decomposition (LLT, LU, QR). Precisely, in a preprocessing step, a permutation matrix P is computed using those ordering methods and applied to the columns of the matrix. Using for instance the sparse Cholesky decomposition, it is expected that the nonzeros elements in LLT(A*P) will be much smaller than that in LLT(A).

Usage :

#include <Eigen/OrderingMethods>

A simple usage is as a template parameter in the sparse decomposition classes :

Sparse supernodal LU factorization for general matrices.
Definition: SparseLU.h:134
Sparse left-looking QR factorization with numerical column pivoting.
Definition: SparseQR.h:87

It is possible as well to call directly a particular ordering method for your own purpose,

//Fill the matrix ...
ordering(A, perm); // Call AMD
Definition: Ordering.h:53
Permutation matrix.
Definition: PermutationMatrix.h:300
A versatible sparse matrix representation.
Definition: SparseMatrix.h:100
Some of these methods (like AMD or METIS), need the sparsity pattern of the input matrix to be symmetric. When the matrix is structurally unsymmetric, Eigen computes internally the pattern of \(A^T*A\) before calling the method. If your matrix is already symmetric (at leat in structure), you can avoid that by calling the method with a SelfAdjointView type.
// Call the ordering on the pattern of the lower triangular matrix A
ordering(A.selfadjointView<Lower>(), perm);
@ Lower
Definition: Constants.h:211


class  Eigen::AMDOrdering< StorageIndex >
class  Eigen::COLAMDOrdering< StorageIndex >
class  Eigen::NaturalOrdering< StorageIndex >