diff options
author | 2015-02-16 15:29:00 +0100 | |
---|---|---|
committer | 2015-02-16 15:29:00 +0100 | |
commit | 98604576d1d4ef3d768b1cc08b4ccedbf16816ab (patch) | |
tree | dc570ba8d010e3b74550671039bf1548d11289d1 /Eigen/src/SparseCore/TriangularSolver.h | |
parent | bd511dde9da3a1f147b3d0d70e76298f759c4420 (diff) | |
parent | 45cbb0bbb1f66bbc923dd4dd1034b919f6b4a191 (diff) |
Merged in chtz/eigen-indexconversion (pull request PR-92)
bug #877, bug #572: Get rid of Index conversion warnings, summary of changes:
- Introduce a global typedef Eigen::Index making Eigen::DenseIndex and AnyExpr<>::Index deprecated (default is std::ptrdiff_t).
- Eigen::Index is used throughout the API to represent indices, offsets, and sizes.
- Classes storing an array of indices uses the type StorageIndex to store them. This is a template parameter of the class. Default is int.
- Methods that *explicitly* set or return an element of such an array take or return a StorageIndex type. In all other cases, the Index type is used.
Diffstat (limited to 'Eigen/src/SparseCore/TriangularSolver.h')
-rw-r--r-- | Eigen/src/SparseCore/TriangularSolver.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Eigen/src/SparseCore/TriangularSolver.h b/Eigen/src/SparseCore/TriangularSolver.h index 98062e9c6..ccfbdc762 100644 --- a/Eigen/src/SparseCore/TriangularSolver.h +++ b/Eigen/src/SparseCore/TriangularSolver.h @@ -28,7 +28,7 @@ template<typename Lhs, typename Rhs, int Mode> struct sparse_solve_triangular_selector<Lhs,Rhs,Mode,Lower,RowMajor> { typedef typename Rhs::Scalar Scalar; - typedef typename Lhs::Index Index; + typedef typename Lhs::StorageIndex StorageIndex; typedef typename evaluator<Lhs>::type LhsEval; typedef typename evaluator<Lhs>::InnerIterator LhsIterator; static void run(const Lhs& lhs, Rhs& other) @@ -66,7 +66,7 @@ template<typename Lhs, typename Rhs, int Mode> struct sparse_solve_triangular_selector<Lhs,Rhs,Mode,Upper,RowMajor> { typedef typename Rhs::Scalar Scalar; - typedef typename Lhs::Index Index; + typedef typename Lhs::StorageIndex StorageIndex; typedef typename evaluator<Lhs>::type LhsEval; typedef typename evaluator<Lhs>::InnerIterator LhsIterator; static void run(const Lhs& lhs, Rhs& other) @@ -106,7 +106,7 @@ template<typename Lhs, typename Rhs, int Mode> struct sparse_solve_triangular_selector<Lhs,Rhs,Mode,Lower,ColMajor> { typedef typename Rhs::Scalar Scalar; - typedef typename Lhs::Index Index; + typedef typename Lhs::StorageIndex StorageIndex; typedef typename evaluator<Lhs>::type LhsEval; typedef typename evaluator<Lhs>::InnerIterator LhsIterator; static void run(const Lhs& lhs, Rhs& other) @@ -142,7 +142,7 @@ template<typename Lhs, typename Rhs, int Mode> struct sparse_solve_triangular_selector<Lhs,Rhs,Mode,Upper,ColMajor> { typedef typename Rhs::Scalar Scalar; - typedef typename Lhs::Index Index; + typedef typename Lhs::StorageIndex StorageIndex; typedef typename evaluator<Lhs>::type LhsEval; typedef typename evaluator<Lhs>::InnerIterator LhsIterator; static void run(const Lhs& lhs, Rhs& other) @@ -212,12 +212,12 @@ template<typename Lhs, typename Rhs, int Mode, int UpLo> struct sparse_solve_triangular_sparse_selector<Lhs,Rhs,Mode,UpLo,ColMajor> { typedef typename Rhs::Scalar Scalar; - typedef typename promote_index_type<typename traits<Lhs>::Index, - typename traits<Rhs>::Index>::type Index; + typedef typename promote_index_type<typename traits<Lhs>::StorageIndex, + typename traits<Rhs>::StorageIndex>::type StorageIndex; static void run(const Lhs& lhs, Rhs& other) { const bool IsLower = (UpLo==Lower); - AmbiVector<Scalar,Index> tempVector(other.rows()*2); + AmbiVector<Scalar,StorageIndex> tempVector(other.rows()*2); tempVector.setBounds(0,other.rows()); Rhs res(other.rows(), other.cols()); @@ -273,7 +273,7 @@ struct sparse_solve_triangular_sparse_selector<Lhs,Rhs,Mode,UpLo,ColMajor> Index count = 0; // FIXME compute a reference value to filter zeros - for (typename AmbiVector<Scalar,Index>::Iterator it(tempVector/*,1e-12*/); it; ++it) + for (typename AmbiVector<Scalar,StorageIndex>::Iterator it(tempVector/*,1e-12*/); it; ++it) { ++ count; // std::cerr << "fill " << it.index() << ", " << col << "\n"; |