9 #ifndef METIS_SUPPORT_H
10 #define METIS_SUPPORT_H
21 template <
typename StorageIndex>
28 template <
typename MatrixType>
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();
47 if (visited(idx) != j )
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++)
77 for (
typename MatrixType::InnerIterator it(A,j); it; ++it)
79 StorageIndex idx = it.index();
80 if (visited(idx) != j )
88 for (
typename MatrixType::InnerIterator it(At, j); it; ++it)
90 StorageIndex idx = it.index();
102 template <
typename MatrixType>
105 StorageIndex m = internal::convert_index<StorageIndex>(A.cols());
114 if(output_error != METIS_OK)
117 std::cerr <<
"ERROR WHILE CALLING THE METIS PACKAGE \n";
126 for (
int j = 0; j < m; j++)
127 matperm.
indices()(iperm(j)) = j;
#define eigen_assert(x)
Definition: Macros.h:1037
Definition: MetisSupport.h:23
PermutationMatrix< Dynamic, Dynamic, StorageIndex > PermutationType
Definition: MetisSupport.h:25
void operator()(const MatrixType &A, PermutationType &matperm)
Definition: MetisSupport.h:103
IndexVector m_indexPtr
Definition: MetisSupport.h:132
void get_symmetrized_graph(const MatrixType &A)
Definition: MetisSupport.h:29
IndexVector m_innerIndices
Definition: MetisSupport.h:133
Matrix< StorageIndex, Dynamic, 1 > IndexVector
Definition: MetisSupport.h:26
void resize(Index newSize)
Definition: PermutationMatrix.h:125
const IndicesType & indices() const
Definition: PermutationMatrix.h:360
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Definition: PlainObjectBase.h:271
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar * data() const
Definition: PlainObjectBase.h:247
EIGEN_DEVICE_FUNC Derived & setConstant(Index size, const Scalar &val)
Definition: CwiseNullaryOp.h:361
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