Lines Matching refs:m2
71 SparseMatrixType m2(rows,cols); in sparse_basic() local
77 m2.reserve(VectorXi::Constant(m2.outerSize(), int(nnz))); in sparse_basic()
79 m2.reserve(m2.outerSize() * nnz); in sparse_basic()
88 m2.insert(i,j) = m1(i,j) = internal::random<Scalar>(); in sparse_basic()
97 m2.finalize(); in sparse_basic()
98 VERIFY_IS_APPROX(m2,m1); in sparse_basic()
105 SparseMatrixType m2(rows,cols); in sparse_basic() local
107 m2.reserve(VectorXi::Constant(m2.outerSize(), 2)); in sparse_basic()
113 m2.insert(i,j) = m1(i,j) = internal::random<Scalar>(); in sparse_basic()
117 m2.coeffRef(i,j) += v; in sparse_basic()
121 VERIFY_IS_APPROX(m2,m1); in sparse_basic()
129 SparseMatrixType m2(rows,cols); in sparse_basic() local
130 …VectorXi r(VectorXi::Constant(m2.outerSize(), ((mode%2)==0) ? int(m2.innerSize()) : std::max<int>(… in sparse_basic()
131 m2.reserve(r); in sparse_basic()
137 m2.insert(i,j) = m1(i,j) = internal::random<Scalar>(); in sparse_basic()
139 m2.reserve(r); in sparse_basic()
142 m2.makeCompressed(); in sparse_basic()
143 VERIFY_IS_APPROX(m2,m1); in sparse_basic()
153 SparseMatrixType m2(rows, cols); in sparse_basic() local
157 initSparse<Scalar>(density, refM2, m2); in sparse_basic()
167 VERIFY_IS_APPROX(m1+m2, refM1+refM2); in sparse_basic()
168 VERIFY_IS_APPROX(m1+m2+m3, refM1+refM2+refM3); in sparse_basic()
169 VERIFY_IS_APPROX(m3.cwiseProduct(m1+m2), refM3.cwiseProduct(refM1+refM2)); in sparse_basic()
170 VERIFY_IS_APPROX(m1*s1-m2, refM1*s1-refM2); in sparse_basic()
222 VERIFY_IS_APPROX(m1+=m2, refM1+=refM2); in sparse_basic()
223 VERIFY_IS_APPROX(m1-=m2, refM1-=refM2); in sparse_basic()
262 SpBool mb2 = m2.real().template cast<bool>(); in sparse_basic()
277 SparseMatrixType m2(rows, cols); in sparse_basic() local
278 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
279 std::vector<Scalar> ref_value(m2.innerSize()); in sparse_basic()
280 std::vector<Index> ref_index(m2.innerSize()); in sparse_basic()
282 m2.makeCompressed(); in sparse_basic()
283 for(Index j = 0; j<m2.outerSize(); ++j) in sparse_basic()
287 for(typename SparseMatrixType::InnerIterator it(m2,j); it; ++it) in sparse_basic()
294 for(typename SparseMatrixType::ReverseInnerIterator it(m2,j); it; --it) in sparse_basic()
307 SparseMatrixType m2(rows, cols); in sparse_basic() local
308 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
309 VERIFY_IS_APPROX(m2.transpose().eval(), refMat2.transpose().eval()); in sparse_basic()
310 VERIFY_IS_APPROX(m2.transpose(), refMat2.transpose()); in sparse_basic()
312 VERIFY_IS_APPROX(SparseMatrixType(m2.adjoint()), refMat2.adjoint()); in sparse_basic()
315 typename Transpose<SparseMatrixType>::PlainObject m3(m2); in sparse_basic()
316 VERIFY(m2.isApprox(m3)); in sparse_basic()
321 SparseMatrixType m2(rows, cols); in sparse_basic() local
326 m2.reserve(VectorXi::Constant(m2.outerSize(), int(m2.innerSize()))); in sparse_basic()
327 for (Index j=0; j<m2.cols(); ++j) in sparse_basic()
329 for (Index i=0; i<m2.rows(); ++i) in sparse_basic()
339 m2.insert(i,j) = Scalar(0); in sparse_basic()
344 m2.insert(i,j) = Scalar(1); in sparse_basic()
350 m2.makeCompressed(); in sparse_basic()
351 VERIFY(countFalseNonZero+countTrueNonZero == m2.nonZeros()); in sparse_basic()
353 VERIFY_IS_APPROX(m2, refM2); in sparse_basic()
354 m2.prune(Scalar(1)); in sparse_basic()
355 VERIFY(countTrueNonZero==m2.nonZeros()); in sparse_basic()
356 VERIFY_IS_APPROX(m2, refM2); in sparse_basic()
397 SparseMatrixType m2(rows, cols), m3(rows, cols); in sparse_basic() local
398 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
401 …ap<SparseMatrixType> mapMat2(m2.rows(), m2.cols(), m2.nonZeros(), m2.outerIndexPtr(), m2.innerInde… in sparse_basic()
407 …ptions,StorageIndex> mapMat2(m2.rows(), m2.cols(), m2.nonZeros(), m2.outerIndexPtr(), m2.innerInde… in sparse_basic()
415 m2.coeffRef(i,j) = 123; in sparse_basic()
417 m2.makeCompressed(); in sparse_basic()
418 …p<SparseMatrixType> mapMat2(rows, cols, m2.nonZeros(), m2.outerIndexPtr(), m2.innerIndexPtr(), m2.… in sparse_basic()
419 VERIFY_IS_EQUAL(m2.coeff(i,j),Scalar(123)); in sparse_basic()
422 VERIFY_IS_EQUAL(m2.coeff(i,j),Scalar(-123)); in sparse_basic()
428 SparseMatrixType m2(rows, cols), m3(rows, cols); in sparse_basic() local
429 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
431 m3 = m2.template triangularView<Lower>(); in sparse_basic()
435 m3 = m2.template triangularView<Upper>(); in sparse_basic()
440 m3 = m2.template triangularView<UnitUpper>(); in sparse_basic()
444 m3 = m2.template triangularView<UnitLower>(); in sparse_basic()
449 m3 = m2.template triangularView<StrictlyUpper>(); in sparse_basic()
453 m3 = m2.template triangularView<StrictlyLower>(); in sparse_basic()
457 refMat3 = m2.template triangularView<StrictlyUpper>(); in sparse_basic()
465 SparseMatrixType m2(rows, rows), m3(rows, rows); in sparse_basic() local
466 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
468 m3 = m2.template selfadjointView<Lower>(); in sparse_basic()
472 m3 += m2.template selfadjointView<Lower>(); in sparse_basic()
476 m3 -= m2.template selfadjointView<Lower>(); in sparse_basic()
488 SparseMatrixType m2(rows, rows); in sparse_basic() local
489 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
490 VERIFY_IS_APPROX(m2.eval(), refMat2.sparseView().eval()); in sparse_basic()
493 VERIFY_IS_APPROX((s1*m2).eval(), (s1*refMat2).sparseView().eval()); in sparse_basic()
494 VERIFY_IS_APPROX((m2+m2).eval(), (refMat2+refMat2).sparseView().eval()); in sparse_basic()
495 VERIFY_IS_APPROX((m2*m2).eval(), (refMat2.lazyProduct(refMat2)).sparseView().eval()); in sparse_basic()
496 VERIFY_IS_APPROX((m2*m2).eval(), (refMat2*refMat2).sparseView().eval()); in sparse_basic()
502 SparseMatrixType m2(rows, cols); in sparse_basic() local
503 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
504 VERIFY_IS_APPROX(m2.diagonal(), refMat2.diagonal().eval()); in sparse_basic()
505 DenseVector d = m2.diagonal(); in sparse_basic()
507 d = m2.diagonal().array(); in sparse_basic()
509 VERIFY_IS_APPROX(const_cast<const SparseMatrixType&>(m2).diagonal(), refMat2.diagonal().eval()); in sparse_basic()
511 initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag); in sparse_basic()
512 m2.diagonal() += refMat2.diagonal(); in sparse_basic()
514 VERIFY_IS_APPROX(m2, refMat2); in sparse_basic()
521 SparseMatrixType m2(rows, rows); in sparse_basic() local
522 m2 = d.asDiagonal(); in sparse_basic()
523 VERIFY_IS_APPROX(m2, refMat2); in sparse_basic()
527 m2 += d.asDiagonal(); in sparse_basic()
528 VERIFY_IS_APPROX(m2, refMat2); in sparse_basic()
594 SparseMatrixType m2(rows, cols); in sparse_basic() local
595 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
597 static_array[0] = IteratorType(m2,0); in sparse_basic()
598 static_array[1] = IteratorType(m2,m2.outerSize()-1); in sparse_basic()
599 VERIFY( static_array[0] || m2.innerVector(static_array[0].outer()).nonZeros() == 0 ); in sparse_basic()
600 VERIFY( static_array[1] || m2.innerVector(static_array[1].outer()).nonZeros() == 0 ); in sparse_basic()
604 static_array[1] = IteratorType(m2,0); in sparse_basic()
612 iters[0] = IteratorType(m2,0); in sparse_basic()
613 iters[1] = IteratorType(m2,m2.outerSize()-1); in sparse_basic()