Lines Matching full:m2

137       SparseMatrixType m2(rows,cols);  in sparse_basic()  local
139 m2.reserve(VectorXi::Constant(m2.outerSize(), 2)); in sparse_basic()
146 m2.insert(i,j) = m1(i,j) = internal::random<Scalar>(); in sparse_basic()
149 m2.finalize(); in sparse_basic()
150 VERIFY_IS_APPROX(m2,m1); in sparse_basic()
157 SparseMatrixType m2(rows,cols); in sparse_basic() local
159 m2.reserve(VectorXi::Constant(m2.outerSize(), 2)); in sparse_basic()
165 m2.insert(i,j) = m1(i,j) = internal::random<Scalar>(); in sparse_basic()
169 m2.coeffRef(i,j) += v; in sparse_basic()
173 VERIFY_IS_APPROX(m2,m1); in sparse_basic()
181 SparseMatrixType m2(rows,cols); in sparse_basic() local
182 …VectorXi r(VectorXi::Constant(m2.outerSize(), ((mode%2)==0) ? m2.innerSize() : std::max<int>(1,m2.… in sparse_basic()
183 m2.reserve(r); in sparse_basic()
189 m2.insert(i,j) = m1(i,j) = internal::random<Scalar>(); in sparse_basic()
191 m2.reserve(r); in sparse_basic()
194 m2.makeCompressed(); in sparse_basic()
195 VERIFY_IS_APPROX(m2,m1); in sparse_basic()
201 SparseMatrixType m2(rows, rows); in sparse_basic() local
202 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
206 VERIFY_IS_APPROX(m2.innerVector(j0), refMat2.row(j0)); in sparse_basic()
208 VERIFY_IS_APPROX(m2.innerVector(j0), refMat2.col(j0)); in sparse_basic()
211 VERIFY_IS_APPROX(m2.innerVector(j0)+m2.innerVector(j1), refMat2.row(j0)+refMat2.row(j1)); in sparse_basic()
213 VERIFY_IS_APPROX(m2.innerVector(j0)+m2.innerVector(j1), refMat2.col(j0)+refMat2.col(j1)); in sparse_basic()
234 //m2.innerVector(j0) = 2*m2.innerVector(j1); in sparse_basic()
236 //VERIFY_IS_APPROX(m2, refMat2); in sparse_basic()
242 SparseMatrixType m2(rows, rows); in sparse_basic() local
243 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
244 if(internal::random<float>(0,1)>0.5) m2.makeCompressed(); in sparse_basic()
250 VERIFY_IS_APPROX(m2.innerVectors(j0,n0), refMat2.block(j0,0,n0,cols)); in sparse_basic()
252 VERIFY_IS_APPROX(m2.innerVectors(j0,n0), refMat2.block(0,j0,rows,n0)); in sparse_basic()
254 VERIFY_IS_APPROX(m2.innerVectors(j0,n0)+m2.innerVectors(j1,n0), in sparse_basic()
257 VERIFY_IS_APPROX(m2.innerVectors(j0,n0)+m2.innerVectors(j1,n0), in sparse_basic()
260 VERIFY_IS_APPROX(m2, refMat2); in sparse_basic()
262 m2.innerVectors(j0,n0) = m2.innerVectors(j0,n0) + m2.innerVectors(j1,n0); in sparse_basic()
268 VERIFY_IS_APPROX(m2, refMat2); in sparse_basic()
279 SparseMatrixType m2(rows, rows); in sparse_basic() local
283 initSparse<Scalar>(density, refM2, m2); in sparse_basic()
287 VERIFY_IS_APPROX(m1+m2, refM1+refM2); in sparse_basic()
288 VERIFY_IS_APPROX(m1+m2+m3, refM1+refM2+refM3); in sparse_basic()
289 VERIFY_IS_APPROX(m3.cwiseProduct(m1+m2), refM3.cwiseProduct(refM1+refM2)); in sparse_basic()
290 VERIFY_IS_APPROX(m1*s1-m2, refM1*s1-refM2); in sparse_basic()
295 VERIFY_IS_APPROX(m1+=m2, refM1+=refM2); in sparse_basic()
296 VERIFY_IS_APPROX(m1-=m2, refM1-=refM2); in sparse_basic()
321 SparseMatrixType m2(rows, rows); in sparse_basic() local
322 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
323 VERIFY_IS_APPROX(m2.transpose().eval(), refMat2.transpose().eval()); in sparse_basic()
324 VERIFY_IS_APPROX(m2.transpose(), refMat2.transpose()); in sparse_basic()
326 VERIFY_IS_APPROX(SparseMatrixType(m2.adjoint()), refMat2.adjoint()); in sparse_basic()
334 SparseMatrixType m2(rows, rows); in sparse_basic() local
335 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
340 VERIFY_IS_APPROX(m2.block(j0,0,n0,cols), refMat2.block(j0,0,n0,cols)); in sparse_basic()
342 VERIFY_IS_APPROX(m2.block(0,j0,rows,n0), refMat2.block(0,j0,rows,n0)); in sparse_basic()
345 VERIFY_IS_APPROX(m2.block(j0,0,n0,cols)+m2.block(j1,0,n0,cols), in sparse_basic()
348 VERIFY_IS_APPROX(m2.block(0,j0,rows,n0)+m2.block(0,j1,rows,n0), in sparse_basic()
351 Index i = internal::random<Index>(0,m2.outerSize()-1); in sparse_basic()
353 m2.innerVector(i) = m2.innerVector(i) * s1; in sparse_basic()
355 VERIFY_IS_APPROX(m2,refMat2); in sparse_basic()
357 m2.innerVector(i) = m2.innerVector(i) * s1; in sparse_basic()
359 VERIFY_IS_APPROX(m2,refMat2); in sparse_basic()
362 VERIFY_IS_APPROX(DenseVector(m2.col(j0)), refMat2.col(j0)); in sparse_basic()
363 VERIFY_IS_APPROX(m2.col(j0), refMat2.col(j0)); in sparse_basic()
365 VERIFY_IS_APPROX(RowDenseVector(m2.row(j0)), refMat2.row(j0)); in sparse_basic()
366 VERIFY_IS_APPROX(m2.row(j0), refMat2.row(j0)); in sparse_basic()
368 VERIFY_IS_APPROX(m2.block(j0,j1,n0,n0), refMat2.block(j0,j1,n0,n0)); in sparse_basic()
369 VERIFY_IS_APPROX((2*m2).block(j0,j1,n0,n0), (2*refMat2).block(j0,j1,n0,n0)); in sparse_basic()
374 SparseMatrixType m2(rows, rows); in sparse_basic() local
379 for (Index j=0; j<m2.outerSize(); ++j) in sparse_basic()
381 m2.startVec(j); in sparse_basic()
382 for (Index i=0; i<m2.innerSize(); ++i) in sparse_basic()
392 m2.insertBackByOuterInner(j,i) = Scalar(0); in sparse_basic()
397 m2.insertBackByOuterInner(j,i) = Scalar(1); in sparse_basic()
405 m2.finalize(); in sparse_basic()
406 VERIFY(countFalseNonZero+countTrueNonZero == m2.nonZeros()); in sparse_basic()
407 VERIFY_IS_APPROX(m2, refM2); in sparse_basic()
408 m2.prune(Scalar(1)); in sparse_basic()
409 VERIFY(countTrueNonZero==m2.nonZeros()); in sparse_basic()
410 VERIFY_IS_APPROX(m2, refM2); in sparse_basic()
437 SparseMatrixType m2(rows, rows), m3(rows, rows); in sparse_basic() local
438 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
440 m3 = m2.template triangularView<Lower>(); in sparse_basic()
444 m3 = m2.template triangularView<Upper>(); in sparse_basic()
448 m3 = m2.template triangularView<UnitUpper>(); in sparse_basic()
452 m3 = m2.template triangularView<UnitLower>(); in sparse_basic()
456 m3 = m2.template triangularView<StrictlyUpper>(); in sparse_basic()
460 m3 = m2.template triangularView<StrictlyLower>(); in sparse_basic()
468 SparseMatrixType m2(rows, rows), m3(rows, rows); in sparse_basic() local
469 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
471 m3 = m2.template selfadjointView<Lower>(); in sparse_basic()
478 SparseMatrixType m2(rows, rows); in sparse_basic() local
479 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
480 VERIFY_IS_APPROX(m2.eval(), refMat2.sparseView().eval()); in sparse_basic()
486 SparseMatrixType m2(rows, rows); in sparse_basic() local
487 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
488 VERIFY_IS_APPROX(m2.diagonal(), refMat2.diagonal().eval()); in sparse_basic()