From c614b2bbd32d96e6087e37f614ae151706207a44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20S=C3=A1nchez?= Date: Tue, 6 Dec 2022 00:02:31 +0000 Subject: [PATCH] Fix index type for sparse index sorting. --- test/sparse_vector.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/sparse_vector.cpp b/test/sparse_vector.cpp index 43de50d81..88cea0948 100644 --- a/test/sparse_vector.cpp +++ b/test/sparse_vector.cpp @@ -15,6 +15,7 @@ template void sparse_vector(int rows, int double densityVec = (std::max)(8./(rows), 0.1); typedef Matrix DenseMatrix; typedef Matrix DenseVector; + typedef Matrix DenseIndexVector; typedef SparseVector SparseVectorType; typedef SparseMatrix SparseMatrixType; Scalar eps = 1e-6; @@ -148,7 +149,7 @@ template void sparse_vector(int rows, int { SparseVectorType vec1(rows); DenseVector refVec1 = DenseVector::Zero(rows); - DenseVector innerIndices(rows); + DenseIndexVector innerIndices(rows); innerIndices.setLinSpaced(0, rows - 1); std::random_shuffle(innerIndices.begin(), innerIndices.end()); Index nz = internal::random(2, rows / 2);