aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/sparse_vector.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2014-02-15 09:35:23 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2014-02-15 09:35:23 +0100
commit4b6b3f310f5b651d82a65eb546e61d70c09407c5 (patch)
tree4d0631070b5b0bf08f0da8d18f0033b0c06e98d8 /test/sparse_vector.cpp
parentcd606bbc943c4862cf0cf596d3ef97aae32c2887 (diff)
Fix a few Index to int buggy conversions
Diffstat (limited to 'test/sparse_vector.cpp')
-rw-r--r--test/sparse_vector.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/sparse_vector.cpp b/test/sparse_vector.cpp
index ec5877b6a..0c9476803 100644
--- a/test/sparse_vector.cpp
+++ b/test/sparse_vector.cpp
@@ -9,14 +9,14 @@
#include "sparse.h"
-template<typename Scalar> void sparse_vector(int rows, int cols)
+template<typename Scalar,typename Index> void sparse_vector(int rows, int cols)
{
double densityMat = (std::max)(8./(rows*cols), 0.01);
double densityVec = (std::max)(8./float(rows), 0.1);
typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
typedef Matrix<Scalar,Dynamic,1> DenseVector;
- typedef SparseVector<Scalar> SparseVectorType;
- typedef SparseMatrix<Scalar> SparseMatrixType;
+ typedef SparseVector<Scalar,0,Index> SparseVectorType;
+ typedef SparseMatrix<Scalar,0,Index> SparseMatrixType;
Scalar eps = 1e-6;
SparseMatrixType m1(rows,rows);
@@ -101,9 +101,10 @@ template<typename Scalar> void sparse_vector(int rows, int cols)
void test_sparse_vector()
{
for(int i = 0; i < g_repeat; i++) {
- CALL_SUBTEST_1( sparse_vector<double>(8, 8) );
- CALL_SUBTEST_2( sparse_vector<std::complex<double> >(16, 16) );
- CALL_SUBTEST_1( sparse_vector<double>(299, 535) );
+ CALL_SUBTEST_1(( sparse_vector<double,int>(8, 8) ));
+ CALL_SUBTEST_2(( sparse_vector<std::complex<double>, int>(16, 16) ));
+ CALL_SUBTEST_1(( sparse_vector<double,long int>(299, 535) ));
+ CALL_SUBTEST_1(( sparse_vector<double,short>(299, 535) ));
}
}