30 {
32 eigen_assert((A.rows() == A.cols()) &&
"ONLY FOR SQUARED MATRICES");
33
34 MatrixType At = A.transpose();
35
38 visited.setConstant(-1);
39 for (StorageIndex j = 0; j < m; j++)
40 {
41
42 visited(j) = j;
43
44 for (typename MatrixType::InnerIterator it(A, j); it; ++it)
45 {
46 Index idx = it.index();
47 if (visited(idx) != j )
48 {
49 visited(idx) = j;
50 ++TotNz;
51 }
52 }
53
54 for (typename MatrixType::InnerIterator it(At, j); it; ++it)
55 {
56 Index idx = it.index();
57 if(visited(idx) != j)
58 {
59 visited(idx) = j;
60 ++TotNz;
61 }
62 }
63 }
64
67
68
69 visited.setConstant(-1);
70 StorageIndex CurNz = 0;
71 for (StorageIndex j = 0; j < m; j++)
72 {
74
75 visited(j) = j;
76
77 for (typename MatrixType::InnerIterator it(A,j); it; ++it)
78 {
79 StorageIndex idx = it.index();
80 if (visited(idx) != j )
81 {
82 visited(idx) = j;
84 CurNz++;
85 }
86 }
87
88 for (typename MatrixType::InnerIterator it(At, j); it; ++it)
89 {
90 StorageIndex idx = it.index();
91 if(visited(idx) != j)
92 {
93 visited(idx) = j;
95 ++CurNz;
96 }
97 }
98 }
100 }
#define eigen_assert(x)
Definition Macros.h:579
IndexVector m_indexPtr
Definition MetisSupport.h:132
IndexVector m_innerIndices
Definition MetisSupport.h:133
Matrix< StorageIndex, Dynamic, 1 > IndexVector
Definition MetisSupport.h:26
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Definition PlainObjectBase.h:279
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:33