10#define METIS_SUPPORT_H
21template <
typename StorageIndex>
28 template <
typename MatrixType>
29 void get_symmetrized_graph(
const MatrixType& A)
32 eigen_assert((A.rows() == A.cols()) &&
"ONLY FOR SQUARED MATRICES");
34 MatrixType
At = A.transpose();
39 for (StorageIndex j = 0; j < m; j++)
44 for (
typename MatrixType::InnerIterator it(A, j); it; ++it)
46 Index idx = it.index();
54 for (
typename MatrixType::InnerIterator it(
At, j); it; ++it)
56 Index idx = it.index();
70 StorageIndex
CurNz = 0;
71 for (StorageIndex j = 0; j < m; j++)
73 m_indexPtr(j) =
CurNz;
77 for (
typename MatrixType::InnerIterator it(A,j); it; ++it)
79 StorageIndex idx = it.index();
83 m_innerIndices(
CurNz) = idx;
88 for (
typename MatrixType::InnerIterator it(
At, j); it; ++it)
90 StorageIndex idx = it.index();
94 m_innerIndices(
CurNz) = idx;
99 m_indexPtr(m) =
CurNz;
102 template <
typename MatrixType>
105 StorageIndex m = internal::convert_index<StorageIndex>(A.cols());
108 get_symmetrized_graph(A);
117 std::cerr <<
"ERROR WHILE CALLING THE METIS PACKAGE \n";
126 for (
int j = 0; j < m; j++)
EIGEN_DEVICE_FUNC void resize(Index newSize)
Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods...
Definition DenseBase.h:246
EIGEN_DEVICE_FUNC Derived & setConstant(const Scalar &value)
Sets all coefficients in this expression to value val.
Definition CwiseNullaryOp.h:345
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
Get the fill-reducing ordering from the METIS package.
Definition MetisSupport.h:23
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar * data() const
Definition PlainObjectBase.h:247
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Resizes *this to a rows x cols matrix.
Definition PlainObjectBase.h:271
Namespace containing all symbols from the Eigen library.
Definition LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74