26 refV2 = DenseVector::Random(
rows),
27 refV3 = DenseVector::Random(
rows);
29 std::vector<int> zerocoords, nonzerocoords;
30 initSparse<Scalar>(densityVec, refV1,
v1, &zerocoords, &nonzerocoords);
31 initSparse<Scalar>(densityMat, refM1,
m1);
33 initSparse<Scalar>(densityVec, refV2,
v2);
34 initSparse<Scalar>(densityVec, refV3,
v3);
36 Scalar s1 = internal::random<Scalar>();
39 for (
unsigned int i=0;
i<zerocoords.size(); ++
i)
45 VERIFY(
int(nonzerocoords.size()) ==
v1.nonZeros());
47 for (
typename SparseVectorType::InnerIterator it(
v1); it; ++it,++
j)
49 VERIFY(nonzerocoords[
j]==it.index());
50 VERIFY(it.value()==
v1.coeff(it.index()));
51 VERIFY(it.value()==refV1.coeff(it.index()));
58 SparseVectorType v4(
rows);
60 for(
int k=0; k<
rows; ++k)
62 int i = internal::random<int>(0,
rows-1);
63 Scalar v = internal::random<Scalar>();
70 v1.coeffRef(nonzerocoords[0]) =
Scalar(5);
71 refV1.coeffRef(nonzerocoords[0]) =
Scalar(5);
91 int i = internal::random<int>(0,
rows-1);
106 SparseMatrixType mv1;
118 std::vector<StorageIndex> inc;
127 StorageIndex incRows = inc[
i];
130 initSparse<Scalar>(densityVec, refVec1,
vec1);
132 vec1.conservativeResize(
rows+incRows);
133 refVec1.conservativeResize(
rows+incRows);
134 if (incRows > 0) refVec1.tail(incRows).setZero();
140 vec1.insert(
vec1.rows()-1) = refVec1(refVec1.rows()-1) = 1;
151 int r = Eigen::internal::random<int>(1,500),
c = Eigen::internal::random<int>(1,500);
152 if(Eigen::internal::random<int>(0,4) == 0) {