11 #ifndef EIGEN_ORDERING_H 12 #define EIGEN_ORDERING_H 26 template<
typename MatrixType>
31 for (
int i = 0;
i < C.rows();
i++)
33 for (
typename MatrixType::InnerIterator it(C,
i); it; ++it)
41 #ifndef EIGEN_MPL2_ONLY 51 template <
typename StorageIndex>
60 template <
typename MatrixType>
64 SparseMatrix<typename MatrixType::Scalar, ColMajor, StorageIndex>
symm;
73 template <
typename SrcType,
unsigned int SrcUpLo>
76 SparseMatrix<typename SrcType::Scalar, ColMajor, StorageIndex>
C; C =
mat;
84 #endif // EIGEN_MPL2_ONLY 94 template <
typename StorageIndex>
101 template <
typename MatrixType>
117 template<
typename StorageIndex>
121 typedef PermutationMatrix<Dynamic, Dynamic, StorageIndex> PermutationType;
122 typedef Matrix<StorageIndex, Dynamic, 1> IndexVector;
127 template <
typename MatrixType>
130 eigen_assert(mat.isCompressed() &&
"COLAMDOrdering requires a sparse matrix in compressed mode. Call .makeCompressed() before passing it to COLAMDOrdering");
132 StorageIndex
m = StorageIndex(mat.rows());
133 StorageIndex
n = StorageIndex(mat.cols());
134 StorageIndex nnz = StorageIndex(mat.nonZeros());
142 IndexVector
p(n+1),
A(Alen);
143 for(StorageIndex
i=0;
i <=
n;
i++)
p(
i) = mat.outerIndexPtr()[
i];
144 for(StorageIndex
i=0;
i < nnz;
i++)
A(
i) = mat.innerIndexPtr()[
i];
Namespace containing all symbols from the Eigen library.
Pseudo expression to manipulate a triangular sparse matrix as a selfadjoint matrix.
PermutationMatrix< Dynamic, Dynamic, StorageIndex > PermutationType
void ordering_helper_at_plus_a(const MatrixType &A, MatrixType &symmat)
PermutationMatrix< Dynamic, Dynamic, StorageIndex > PermutationType
IndexType colamd_recommended(IndexType nnz, IndexType n_row, IndexType n_col)
Returns the recommended value of Alen.
idx_t idx_t idx_t idx_t idx_t * perm
void minimum_degree_ordering(SparseMatrix< Scalar, ColMajor, StorageIndex > &C, PermutationMatrix< Dynamic, Dynamic, StorageIndex > &perm)
static bool colamd(IndexType n_row, IndexType n_col, IndexType Alen, IndexType *A, IndexType *p, double knobs[COLAMD_KNOBS], IndexType stats[COLAMD_STATS])
Computes a column ordering using the column approximate minimum degree ordering.
static void colamd_set_defaults(double knobs[COLAMD_KNOBS])
set default parameters The use of this routine is optional.
Matrix< Scalar, Dynamic, Dynamic > C
const IndicesType & indices() const
void operator()(const SparseSelfAdjointView< SrcType, SrcUpLo > &mat, PermutationType &perm)
void resize(Index newSize)
int EIGEN_BLAS_FUNC() symm(const char *side, const char *uplo, const int *m, const int *n, const RealScalar *palpha, const RealScalar *pa, const int *lda, const RealScalar *pb, const int *ldb, const RealScalar *pbeta, RealScalar *pc, const int *ldc)
#define EIGEN_UNUSED_VARIABLE(var)