Lines Matching refs:m2
97 SparseMatrixType m2(rows,cols);
99 m2.reserve(VectorXi::Constant(m2.outerSize(), 2));
106 m2.insert(i,j) = m1(i,j) = internal::random<Scalar>();
109 m2.finalize();
110 VERIFY_IS_APPROX(m2,m1);
117 SparseMatrixType m2(rows,cols);
119 m2.reserve(VectorXi::Constant(m2.outerSize(), 2));
125 m2.insert(i,j) = m1(i,j) = internal::random<Scalar>();
129 m2.coeffRef(i,j) += v;
133 VERIFY_IS_APPROX(m2,m1);
141 SparseMatrixType m2(rows,cols);
142 VectorXi r(VectorXi::Constant(m2.outerSize(), ((mode%2)==0) ? m2.innerSize() : std::max<int>(1,m2.innerSize()/8)));
143 m2.reserve(r);
149 m2.insert(i,j) = m1(i,j) = internal::random<Scalar>();
151 m2.reserve(r);
154 m2.makeCompressed();
155 VERIFY_IS_APPROX(m2,m1);
165 SparseMatrixType m2(rows, rows);
169 initSparse<Scalar>(density, refM2, m2);
173 VERIFY_IS_APPROX(m1+m2, refM1+refM2);
174 VERIFY_IS_APPROX(m1+m2+m3, refM1+refM2+refM3);
175 VERIFY_IS_APPROX(m3.cwiseProduct(m1+m2), refM3.cwiseProduct(refM1+refM2));
176 VERIFY_IS_APPROX(m1*s1-m2, refM1*s1-refM2);
181 VERIFY_IS_APPROX(m1+=m2, refM1+=refM2);
182 VERIFY_IS_APPROX(m1-=m2, refM1-=refM2);
201 SparseMatrixType m2(rows, rows);
202 initSparse<Scalar>(density, refMat2, m2);
203 VERIFY_IS_APPROX(m2.transpose().eval(), refMat2.transpose().eval());
204 VERIFY_IS_APPROX(m2.transpose(), refMat2.transpose());
206 VERIFY_IS_APPROX(SparseMatrixType(m2.adjoint()), refMat2.adjoint());
212 SparseMatrixType m2(rows, rows);
213 initSparse<Scalar>(density, refMat2, m2);
217 VERIFY_IS_APPROX(m2.innerVector(j0), refMat2.row(j0));
219 VERIFY_IS_APPROX(m2.innerVector(j0), refMat2.col(j0));
222 VERIFY_IS_APPROX(m2.innerVector(j0)+m2.innerVector(j1), refMat2.row(j0)+refMat2.row(j1));
224 VERIFY_IS_APPROX(m2.innerVector(j0)+m2.innerVector(j1), refMat2.col(j0)+refMat2.col(j1));
245 //m2.innerVector(j0) = 2*m2.innerVector(j1);
247 //VERIFY_IS_APPROX(m2, refMat2);
253 SparseMatrixType m2(rows, rows);
254 initSparse<Scalar>(density, refMat2, m2);
259 VERIFY_IS_APPROX(m2.innerVectors(j0,n0), refMat2.block(j0,0,n0,cols));
261 VERIFY_IS_APPROX(m2.innerVectors(j0,n0), refMat2.block(0,j0,rows,n0));
263 VERIFY_IS_APPROX(m2.innerVectors(j0,n0)+m2.innerVectors(j1,n0),
266 VERIFY_IS_APPROX(m2.innerVectors(j0,n0)+m2.innerVectors(j1,n0),
268 //m2.innerVectors(j0,n0) = m2.innerVectors(j0,n0) + m2.innerVectors(j1,n0);
274 SparseMatrixType m2(rows, rows);
279 for (int j=0; j<m2.outerSize(); ++j)
281 m2.startVec(j);
282 for (int i=0; i<m2.innerSize(); ++i)
292 m2.insertBackByOuterInner(j,i) = Scalar(0);
297 m2.insertBackByOuterInner(j,i) = Scalar(1);
305 m2.finalize();
306 VERIFY(countFalseNonZero+countTrueNonZero == m2.nonZeros());
307 VERIFY_IS_APPROX(m2, refM2);
308 m2.prune(Scalar(1));
309 VERIFY(countTrueNonZero==m2.nonZeros());
310 VERIFY_IS_APPROX(m2, refM2);
337 SparseMatrixType m2(rows, rows), m3(rows, rows);
338 initSparse<Scalar>(density, refMat2, m2);
340 m3 = m2.template triangularView<Lower>();
344 m3 = m2.template triangularView<Upper>();
348 m3 = m2.template triangularView<UnitUpper>();
352 m3 = m2.template triangularView<UnitLower>();
360 SparseMatrixType m2(rows, rows), m3(rows, rows);
361 initSparse<Scalar>(density, refMat2, m2);
363 m3 = m2.template selfadjointView<Lower>();
370 SparseMatrixType m2(rows, rows);
371 initSparse<Scalar>(density, refMat2, m2);
372 VERIFY_IS_APPROX(m2.eval(), refMat2.sparseView().eval());
378 SparseMatrixType m2(rows, rows);
379 initSparse<Scalar>(density, refMat2, m2);
380 VERIFY_IS_APPROX(m2.diagonal(), refMat2.diagonal().eval());