diff options
author | Gael Guennebaud <g.gael@free.fr> | 2015-02-16 13:19:05 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2015-02-16 13:19:05 +0100 |
commit | aa6c516ec17fb44dff85b1abf3a1b05d58d3bc01 (patch) | |
tree | cd0b6ce4d023ff6734beecc167749d00f301c017 /test | |
parent | fc202bab398ed9b78ef8452f8e4ef35e233965f6 (diff) |
Fix many long to int conversion warnings:
- fix usage of Index (API) versus StorageIndex (when multiple indexes are stored)
- use StorageIndex(val) when the input has already been check
- use internal::convert_index<StorageIndex>(val) when val is potentially unsafe (directly comes from user input)
Diffstat (limited to 'test')
-rw-r--r-- | test/sparse_basic.cpp | 4 | ||||
-rw-r--r-- | test/spqr_support.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/test/sparse_basic.cpp b/test/sparse_basic.cpp index b06956974..8021f4db6 100644 --- a/test/sparse_basic.cpp +++ b/test/sparse_basic.cpp @@ -398,8 +398,8 @@ template<typename SparseMatrixType> void sparse_basic(const SparseMatrixType& re refMat.setZero(); for(Index i=0;i<ntriplets;++i) { - StorageIndex r = internal::random<StorageIndex>(0,rows-1); - StorageIndex c = internal::random<StorageIndex>(0,cols-1); + StorageIndex r = internal::random<StorageIndex>(0,StorageIndex(rows-1)); + StorageIndex c = internal::random<StorageIndex>(0,StorageIndex(cols-1)); Scalar v = internal::random<Scalar>(); triplets.push_back(TripletType(r,c,v)); refMat(r,c) += v; diff --git a/test/spqr_support.cpp b/test/spqr_support.cpp index 901c42c40..baa25a0c2 100644 --- a/test/spqr_support.cpp +++ b/test/spqr_support.cpp @@ -37,7 +37,7 @@ template<typename Scalar> void test_spqr_scalar() SPQR<MatrixType> solver; generate_sparse_rectangular_problem(A,dA); - int m = A.rows(); + Index m = A.rows(); b = DenseVector::Random(m); solver.compute(A); if (solver.info() != Success) |