aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/sparse_block.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-05-26 17:42:12 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-05-26 17:42:12 +0200
commitdb62719eda3f4bd6d8992eb911dfc0a4af0770b2 (patch)
tree95cd30f5b208bccc44efd4c6bd007c7093e28cec /test/sparse_block.cpp
parentfdcad686eea0123049c0fc1d4b5cb50894a08ef6 (diff)
Fix some conversion warnings in unit tests.
Diffstat (limited to 'test/sparse_block.cpp')
-rw-r--r--test/sparse_block.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/sparse_block.cpp b/test/sparse_block.cpp
index 582bf34c3..49a5f135e 100644
--- a/test/sparse_block.cpp
+++ b/test/sparse_block.cpp
@@ -17,6 +17,7 @@ template<typename SparseMatrixType> void sparse_block(const SparseMatrixType& re
const Index outer = ref.outerSize();
typedef typename SparseMatrixType::Scalar Scalar;
+ typedef typename SparseMatrixType::StorageIndex StorageIndex;
double density = (std::max)(8./(rows*cols), 0.01);
typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
@@ -123,7 +124,7 @@ template<typename SparseMatrixType> void sparse_block(const SparseMatrixType& re
m3.reserve(VectorXi::Constant(outer,int(inner/2)));
for(Index j=0; j<outer; ++j)
for(Index k=0; k<(std::min)(j,inner); ++k)
- m3.insertByOuterInner(j,k) = k+1;
+ m3.insertByOuterInner(j,k) = internal::convert_index<StorageIndex>(k+1);
for(Index j=0; j<(std::min)(outer, inner); ++j)
{
VERIFY(j==numext::real(m3.innerVector(j).nonZeros()));