aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/SparseCore
diff options
context:
space:
mode:
authorGravatar Desire NUENTSA <desire.nuentsa_wakam@inria.fr>2013-01-29 16:21:24 +0100
committerGravatar Desire NUENTSA <desire.nuentsa_wakam@inria.fr>2013-01-29 16:21:24 +0100
commit8bc00925e511e55a6a9518b63b39994392625099 (patch)
treefad727c99641b71b2e42fd938757d73a1166a15a /Eigen/src/SparseCore
parent57e50789f30544daba1b8e554025af1c5352eee1 (diff)
Change int to Index type for SparseLU
Diffstat (limited to 'Eigen/src/SparseCore')
-rw-r--r--Eigen/src/SparseCore/SparseColEtree.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/Eigen/src/SparseCore/SparseColEtree.h b/Eigen/src/SparseCore/SparseColEtree.h
index df6b9f966..664d09600 100644
--- a/Eigen/src/SparseCore/SparseColEtree.h
+++ b/Eigen/src/SparseCore/SparseColEtree.h
@@ -36,11 +36,11 @@ namespace Eigen {
namespace internal {
/** Find the root of the tree/set containing the vertex i : Use Path halving */
-template<typename IndexVector>
-int etree_find (int i, IndexVector& pp)
+template<typename Index, typename IndexVector>
+Index etree_find (Index i, IndexVector& pp)
{
- int p = pp(i); // Parent
- int gp = pp(p); // Grand parent
+ Index p = pp(i); // Parent
+ Index gp = pp(p); // Grand parent
while (gp != p)
{
pp(i) = gp; // Parent pointer on find path is changed to former grand parent
@@ -68,7 +68,7 @@ int coletree(const MatrixType& mat, IndexVector& parent, IndexVector& firstRowEl
pp.setZero(); // Initialize disjoint sets
parent.resize(mat.cols());
//Compute first nonzero column in each row
- int row,col;
+ Index row,col;
firstRowElt.resize(m);
firstRowElt.setConstant(nc);
firstRowElt.segment(0, nc).setLinSpaced(nc, 0, nc-1);
@@ -85,7 +85,7 @@ int coletree(const MatrixType& mat, IndexVector& parent, IndexVector& firstRowEl
except use (firstRowElt[r],c) in place of an edge (r,c) of A.
Thus each row clique in A'*A is replaced by a star
centered at its first vertex, which has the same fill. */
- int rset, cset, rroot;
+ Index rset, cset, rroot;
for (col = 0; col < nc; col++)
{
found_diag = false;
@@ -97,7 +97,7 @@ int coletree(const MatrixType& mat, IndexVector& parent, IndexVector& firstRowEl
* hence the loop is executed once more */
for (typename MatrixType::InnerIterator it(mat, col); it||!found_diag; ++it)
{ // A sequence of interleaved find and union is performed
- int i = col;
+ Index i = col;
if(it) i = it.index();
if (i == col) found_diag = true;
row = firstRowElt(i);
@@ -120,10 +120,10 @@ int coletree(const MatrixType& mat, IndexVector& parent, IndexVector& firstRowEl
* Depth-first search from vertex n. No recursion.
* This routine was contributed by Cédric Doucet, CEDRAT Group, Meylan, France.
*/
-template <typename IndexVector>
-void nr_etdfs (int n, IndexVector& parent, IndexVector& first_kid, IndexVector& next_kid, IndexVector& post, int postnum)
+template <typename Index, typename IndexVector>
+void nr_etdfs (Index n, IndexVector& parent, IndexVector& first_kid, IndexVector& next_kid, IndexVector& post, Index postnum)
{
- int current = n, first, next;
+ Index current = n, first, next;
while (postnum != n)
{
// No kid for the current node
@@ -167,18 +167,18 @@ void nr_etdfs (int n, IndexVector& parent, IndexVector& first_kid, IndexVector&
* \param parent Input tree
* \param post postordered tree
*/
-template <typename IndexVector>
-void treePostorder(int n, IndexVector& parent, IndexVector& post)
+template <typename Index, typename IndexVector>
+void treePostorder(Index n, IndexVector& parent, IndexVector& post)
{
IndexVector first_kid, next_kid; // Linked list of children
- int postnum;
+ Index postnum;
// Allocate storage for working arrays and results
first_kid.resize(n+1);
next_kid.setZero(n+1);
post.setZero(n+1);
// Set up structure describing children
- int v, dad;
+ Index v, dad;
first_kid.setConstant(-1);
for (v = n-1; v >= 0; v--)
{