diff options
author | Gael Guennebaud <g.gael@free.fr> | 2015-03-09 13:54:05 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2015-03-09 13:54:05 +0100 |
commit | cf9940e17b5799c35b6a05764bec166d07906b6f (patch) | |
tree | dd03f1e0d5bc3912a3762c11acd093b9be1cba8e /test/sparse.h | |
parent | 39228cb22414209e1880d84699b5f8e481c2b436 (diff) |
Make sparse unit-test helpers aware of StorageIndex
Diffstat (limited to 'test/sparse.h')
-rw-r--r-- | test/sparse.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/sparse.h b/test/sparse.h index 81ab9e873..3c3a0c9be 100644 --- a/test/sparse.h +++ b/test/sparse.h @@ -53,15 +53,15 @@ enum { * \param zeroCoords and nonzeroCoords allows to get the coordinate lists of the non zero, * and zero coefficients respectively. */ -template<typename Scalar,int Opt1,int Opt2,typename Index> void +template<typename Scalar,int Opt1,int Opt2,typename StorageIndex> void initSparse(double density, Matrix<Scalar,Dynamic,Dynamic,Opt1>& refMat, - SparseMatrix<Scalar,Opt2,Index>& sparseMat, + SparseMatrix<Scalar,Opt2,StorageIndex>& sparseMat, int flags = 0, - std::vector<Matrix<Index,2,1> >* zeroCoords = 0, - std::vector<Matrix<Index,2,1> >* nonzeroCoords = 0) + std::vector<Matrix<StorageIndex,2,1> >* zeroCoords = 0, + std::vector<Matrix<StorageIndex,2,1> >* nonzeroCoords = 0) { - enum { IsRowMajor = SparseMatrix<Scalar,Opt2,Index>::IsRowMajor }; + enum { IsRowMajor = SparseMatrix<Scalar,Opt2,StorageIndex>::IsRowMajor }; sparseMat.setZero(); //sparseMat.reserve(int(refMat.rows()*refMat.cols()*density)); sparseMat.reserve(VectorXi::Constant(IsRowMajor ? refMat.rows() : refMat.cols(), int((1.5*density)*(IsRowMajor?refMat.cols():refMat.rows())))); @@ -93,11 +93,11 @@ initSparse(double density, //sparseMat.insertBackByOuterInner(j,i) = v; sparseMat.insertByOuterInner(j,i) = v; if (nonzeroCoords) - nonzeroCoords->push_back(Matrix<Index,2,1> (ai,aj)); + nonzeroCoords->push_back(Matrix<StorageIndex,2,1> (ai,aj)); } else if (zeroCoords) { - zeroCoords->push_back(Matrix<Index,2,1> (ai,aj)); + zeroCoords->push_back(Matrix<StorageIndex,2,1> (ai,aj)); } refMat(ai,aj) = v; } |