diff options
author | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2014-12-04 22:48:53 +0100 |
---|---|---|
committer | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2014-12-04 22:48:53 +0100 |
commit | e8cdbedefb1913b5a0e2f2b7d38470f081cb8d29 (patch) | |
tree | b64cb33df57f4cfcd87bf42643279629dc0900d3 /Eigen/src/OrderingMethods/Amd.h | |
parent | 6ccf97f3e6ce39c210e225ba7aae66da15b71660 (diff) |
bug #877, bug #572: Introduce a global Index typedef. Rename Sparse*::Index to StorageIndex, make Dense*::StorageIndex an alias to DenseIndex. Overall this commit gets rid of all Index conversion warnings.
Diffstat (limited to 'Eigen/src/OrderingMethods/Amd.h')
-rw-r--r-- | Eigen/src/OrderingMethods/Amd.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Eigen/src/OrderingMethods/Amd.h b/Eigen/src/OrderingMethods/Amd.h index ce7c0bbf3..50022d1ca 100644 --- a/Eigen/src/OrderingMethods/Amd.h +++ b/Eigen/src/OrderingMethods/Amd.h @@ -42,7 +42,7 @@ template<typename T0, typename T1> inline void amd_mark(const T0* w, const T1& j /* clear w */ template<typename Index> -static int cs_wclear (Index mark, Index lemax, Index *w, Index n) +static Index cs_wclear (Index mark, Index lemax, Index *w, Index n) { Index k; if(mark < 2 || (mark + lemax < 0)) @@ -59,7 +59,7 @@ static int cs_wclear (Index mark, Index lemax, Index *w, Index n) template<typename Index> Index cs_tdfs(Index j, Index k, Index *head, const Index *next, Index *post, Index *stack) { - int i, p, top = 0; + Index i, p, top = 0; if(!head || !next || !post || !stack) return (-1); /* check inputs */ stack[0] = j; /* place j on the stack */ while (top >= 0) /* while (stack is not empty) */ @@ -92,11 +92,12 @@ void minimum_degree_ordering(SparseMatrix<Scalar,ColMajor,Index>& C, Permutation { using std::sqrt; - int d, dk, dext, lemax = 0, e, elenk, eln, i, j, k, k1, - k2, k3, jlast, ln, dense, nzmax, mindeg = 0, nvi, nvj, nvk, mark, wnvi, - ok, nel = 0, p, p1, p2, p3, p4, pj, pk, pk1, pk2, pn, q, t; - unsigned int h; + Index d, dk, dext, lemax = 0, e, elenk, eln, i, j, k, k1, + k2, k3, jlast, ln, dense, nzmax, mindeg = 0, nvi, nvj, nvk, mark, wnvi, + ok, nel = 0, p, p1, p2, p3, p4, pj, pk, pk1, pk2, pn, q, t; + std::size_t h; + Index n = C.cols(); dense = std::max<Index> (16, Index(10 * sqrt(double(n)))); /* find dense threshold */ dense = std::min<Index> (n-2, dense); @@ -330,7 +331,7 @@ void minimum_degree_ordering(SparseMatrix<Scalar,ColMajor,Index>& C, Permutation h %= n; /* finalize hash of i */ next[i] = hhead[h]; /* place i in hash bucket */ hhead[h] = i; - last[i] = h; /* save hash of i in last[i] */ + last[i] = Index(h); /* save hash of i in last[i] */ } } /* scan2 is done */ degree[k] = dk; /* finalize |Lk| */ |