11#ifndef EIGEN_ORDERING_H
12#define EIGEN_ORDERING_H
26template<
typename MatrixType>
31 for (
int i = 0; i < C.rows(); i++)
33 for (
typename MatrixType::InnerIterator it(C, i); it; ++it)
34 it.valueRef() =
typename MatrixType::Scalar(0);
49template <
typename StorageIndex>
58 template <
typename MatrixType>
71 template <
typename SrcType,
unsigned int SrcUpLo>
90template <
typename StorageIndex>
97 template <
typename MatrixType>
113template<
typename StorageIndex>
123 template <
typename MatrixType>
126 eigen_assert(mat.isCompressed() &&
"COLAMDOrdering requires a sparse matrix in compressed mode. Call .makeCompressed() before passing it to COLAMDOrdering");
128 StorageIndex m = StorageIndex(mat.rows());
129 StorageIndex n = StorageIndex(mat.cols());
130 StorageIndex nnz = StorageIndex(mat.nonZeros());
139 for(StorageIndex i=0; i <= n; i++) p(i) = mat.outerIndexPtr()[i];
140 for(StorageIndex i=0; i < nnz; i++) A(i) = mat.innerIndexPtr()[i];
147 for (StorageIndex i = 0; i < n; i++) perm.
indices()(p(i)) = i;
#define EIGEN_UNUSED_VARIABLE(var)
Definition: Macros.h:1086
#define eigen_assert(x)
Definition: Macros.h:1047
Functor computing the approximate minimum degree ordering If the matrix is not structurally symmetric...
Definition: Ordering.h:51
void operator()(const SparseSelfAdjointView< SrcType, SrcUpLo > &mat, PermutationType &perm)
Compute the permutation with a selfadjoint matrix.
Definition: Ordering.h:72
PermutationMatrix< Dynamic, Dynamic, StorageIndex > PermutationType
Definition: Ordering.h:53
void operator()(const MatrixType &mat, PermutationType &perm)
Compute the permutation vector from a sparse matrix This routine is much faster if the input matrix i...
Definition: Ordering.h:59
Definition: Ordering.h:115
void operator()(const MatrixType &mat, PermutationType &perm)
Compute the permutation vector perm form the sparse matrix mat.
Definition: Ordering.h:124
Matrix< StorageIndex, Dynamic, 1 > IndexVector
Definition: Ordering.h:118
PermutationMatrix< Dynamic, Dynamic, StorageIndex > PermutationType
Definition: Ordering.h:117
Functor computing the natural ordering (identity)
Definition: Ordering.h:92
void operator()(const MatrixType &, PermutationType &perm)
Compute the permutation vector from a column-major sparse matrix.
Definition: Ordering.h:98
PermutationMatrix< Dynamic, Dynamic, StorageIndex > PermutationType
Definition: Ordering.h:94
void resize(Index newSize)
Resizes to given size.
Definition: PermutationMatrix.h:125
const IndicesType & indices() const
const version of indices().
Definition: PermutationMatrix.h:360
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar * data() const
Definition: PlainObjectBase.h:247
A versatible sparse matrix representation.
Definition: SparseMatrix.h:98
Pseudo expression to manipulate a triangular sparse matrix as a selfadjoint matrix.
Definition: SparseSelfAdjointView.h:45
void ordering_helper_at_plus_a(const MatrixType &A, MatrixType &symmat)
Definition: Ordering.h:27
void minimum_degree_ordering(SparseMatrix< Scalar, ColMajor, StorageIndex > &C, PermutationMatrix< Dynamic, Dynamic, StorageIndex > &perm)
Definition: Amd.h:84
Namespace containing all symbols from the Eigen library.
Definition: Core:141
const int NKnobs
Definition: Eigen_Colamd.h:65
IndexType recommended(IndexType nnz, IndexType n_row, IndexType n_col)
Returns the recommended value of Alen.
Definition: Eigen_Colamd.h:277
static bool compute_ordering(IndexType n_row, IndexType n_col, IndexType Alen, IndexType *A, IndexType *p, double knobs[NKnobs], IndexType stats[NStats])
Computes a column ordering using the column approximate minimum degree ordering.
Definition: Eigen_Colamd.h:342
const int NStats
Definition: Eigen_Colamd.h:68
static void set_defaults(double knobs[NKnobs])
set default parameters The use of this routine is optional.
Definition: Eigen_Colamd.h:306
Definition: Eigen_Colamd.h:50