11 #ifndef EIGEN_ORDERING_H
12 #define EIGEN_ORDERING_H
16 #include "Eigen_Colamd.h"
25 template<
typename MatrixType>
26 void ordering_helper_at_plus_a(
const MatrixType& mat, MatrixType& symmat)
30 for (
int i = 0; i < C.rows(); i++)
32 for (
typename MatrixType::InnerIterator it(C, i); it; ++it)
40 #ifndef EIGEN_MPL2_ONLY
50 template <
typename Index>
59 template <
typename MatrixType>
64 internal::ordering_helper_at_plus_a(mat,symm);
68 internal::minimum_degree_ordering(symm, perm);
72 template <
typename SrcType,
unsigned int SrcUpLo>
79 internal::minimum_degree_ordering(C, perm);
83 #endif // EIGEN_MPL2_ONLY
93 template <
typename Index>
100 template <
typename MatrixType>
114 template<
typename Index>
122 template <
typename MatrixType>
125 Index m = mat.rows();
126 Index n = mat.cols();
127 Index nnz = mat.nonZeros();
131 double knobs [COLAMD_KNOBS];
132 Index stats [COLAMD_STATS];
133 internal::colamd_set_defaults(knobs);
137 for(Index i=0; i <= n; i++) p(i) = mat.outerIndexPtr()[i];
138 for(Index i=0; i < nnz; i++) A(i) = mat.innerIndexPtr()[i];
140 info = internal::colamd(m, n, Alen, A.
data(), p.data(), knobs, stats);
141 eigen_assert( info &&
"COLAMD failed " );
144 for (Index i = 0; i < n; i++) perm.
indices()(p(i)) = i;