Lines Matching refs:m2

105       SparseMatrixType m2(rows,cols);  in sparse_basic()  local
107 m2.reserve(VectorXi::Constant(m2.outerSize(), 2)); in sparse_basic()
114 m2.insert(i,j) = m1(i,j) = internal::random<Scalar>(); in sparse_basic()
117 m2.finalize(); in sparse_basic()
118 VERIFY_IS_APPROX(m2,m1); in sparse_basic()
125 SparseMatrixType m2(rows,cols); in sparse_basic() local
127 m2.reserve(VectorXi::Constant(m2.outerSize(), 2)); in sparse_basic()
133 m2.insert(i,j) = m1(i,j) = internal::random<Scalar>(); in sparse_basic()
137 m2.coeffRef(i,j) += v; in sparse_basic()
141 VERIFY_IS_APPROX(m2,m1); in sparse_basic()
149 SparseMatrixType m2(rows,cols); in sparse_basic() local
150 …VectorXi r(VectorXi::Constant(m2.outerSize(), ((mode%2)==0) ? m2.innerSize() : std::max<int>(1,m2.… in sparse_basic()
151 m2.reserve(r); in sparse_basic()
157 m2.insert(i,j) = m1(i,j) = internal::random<Scalar>(); in sparse_basic()
159 m2.reserve(r); in sparse_basic()
162 m2.makeCompressed(); in sparse_basic()
163 VERIFY_IS_APPROX(m2,m1); in sparse_basic()
169 SparseMatrixType m2(rows, rows); in sparse_basic() local
170 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
174 VERIFY_IS_APPROX(m2.innerVector(j0), refMat2.row(j0)); in sparse_basic()
176 VERIFY_IS_APPROX(m2.innerVector(j0), refMat2.col(j0)); in sparse_basic()
179 VERIFY_IS_APPROX(m2.innerVector(j0)+m2.innerVector(j1), refMat2.row(j0)+refMat2.row(j1)); in sparse_basic()
181 VERIFY_IS_APPROX(m2.innerVector(j0)+m2.innerVector(j1), refMat2.col(j0)+refMat2.col(j1)); in sparse_basic()
210 SparseMatrixType m2(rows, rows); in sparse_basic() local
211 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
212 if(internal::random<float>(0,1)>0.5) m2.makeCompressed(); in sparse_basic()
218 VERIFY_IS_APPROX(m2.innerVectors(j0,n0), refMat2.block(j0,0,n0,cols)); in sparse_basic()
220 VERIFY_IS_APPROX(m2.innerVectors(j0,n0), refMat2.block(0,j0,rows,n0)); in sparse_basic()
222 VERIFY_IS_APPROX(m2.innerVectors(j0,n0)+m2.innerVectors(j1,n0), in sparse_basic()
225 VERIFY_IS_APPROX(m2.innerVectors(j0,n0)+m2.innerVectors(j1,n0), in sparse_basic()
228 VERIFY_IS_APPROX(m2, refMat2); in sparse_basic()
230 m2.innerVectors(j0,n0) = m2.innerVectors(j0,n0) + m2.innerVectors(j1,n0); in sparse_basic()
236 VERIFY_IS_APPROX(m2, refMat2); in sparse_basic()
247 SparseMatrixType m2(rows, rows); in sparse_basic() local
251 initSparse<Scalar>(density, refM2, m2); in sparse_basic()
255 VERIFY_IS_APPROX(m1+m2, refM1+refM2); in sparse_basic()
256 VERIFY_IS_APPROX(m1+m2+m3, refM1+refM2+refM3); in sparse_basic()
257 VERIFY_IS_APPROX(m3.cwiseProduct(m1+m2), refM3.cwiseProduct(refM1+refM2)); in sparse_basic()
258 VERIFY_IS_APPROX(m1*s1-m2, refM1*s1-refM2); in sparse_basic()
263 VERIFY_IS_APPROX(m1+=m2, refM1+=refM2); in sparse_basic()
264 VERIFY_IS_APPROX(m1-=m2, refM1-=refM2); in sparse_basic()
289 SparseMatrixType m2(rows, rows); in sparse_basic() local
290 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
291 VERIFY_IS_APPROX(m2.transpose().eval(), refMat2.transpose().eval()); in sparse_basic()
292 VERIFY_IS_APPROX(m2.transpose(), refMat2.transpose()); in sparse_basic()
294 VERIFY_IS_APPROX(SparseMatrixType(m2.adjoint()), refMat2.adjoint()); in sparse_basic()
302 SparseMatrixType m2(rows, rows); in sparse_basic() local
303 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
308 VERIFY_IS_APPROX(m2.block(j0,0,n0,cols), refMat2.block(j0,0,n0,cols)); in sparse_basic()
310 VERIFY_IS_APPROX(m2.block(0,j0,rows,n0), refMat2.block(0,j0,rows,n0)); in sparse_basic()
313 VERIFY_IS_APPROX(m2.block(j0,0,n0,cols)+m2.block(j1,0,n0,cols), in sparse_basic()
316 VERIFY_IS_APPROX(m2.block(0,j0,rows,n0)+m2.block(0,j1,rows,n0), in sparse_basic()
319 Index i = internal::random<Index>(0,m2.outerSize()-1); in sparse_basic()
321 m2.innerVector(i) = m2.innerVector(i) * s1; in sparse_basic()
323 VERIFY_IS_APPROX(m2,refMat2); in sparse_basic()
325 m2.innerVector(i) = m2.innerVector(i) * s1; in sparse_basic()
327 VERIFY_IS_APPROX(m2,refMat2); in sparse_basic()
333 SparseMatrixType m2(rows, rows); in sparse_basic() local
338 for (Index j=0; j<m2.outerSize(); ++j) in sparse_basic()
340 m2.startVec(j); in sparse_basic()
341 for (Index i=0; i<m2.innerSize(); ++i) in sparse_basic()
351 m2.insertBackByOuterInner(j,i) = Scalar(0); in sparse_basic()
356 m2.insertBackByOuterInner(j,i) = Scalar(1); in sparse_basic()
364 m2.finalize(); in sparse_basic()
365 VERIFY(countFalseNonZero+countTrueNonZero == m2.nonZeros()); in sparse_basic()
366 VERIFY_IS_APPROX(m2, refM2); in sparse_basic()
367 m2.prune(Scalar(1)); in sparse_basic()
368 VERIFY(countTrueNonZero==m2.nonZeros()); in sparse_basic()
369 VERIFY_IS_APPROX(m2, refM2); in sparse_basic()
396 SparseMatrixType m2(rows, rows), m3(rows, rows); in sparse_basic() local
397 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
399 m3 = m2.template triangularView<Lower>(); in sparse_basic()
403 m3 = m2.template triangularView<Upper>(); in sparse_basic()
407 m3 = m2.template triangularView<UnitUpper>(); in sparse_basic()
411 m3 = m2.template triangularView<UnitLower>(); in sparse_basic()
415 m3 = m2.template triangularView<StrictlyUpper>(); in sparse_basic()
419 m3 = m2.template triangularView<StrictlyLower>(); in sparse_basic()
427 SparseMatrixType m2(rows, rows), m3(rows, rows); in sparse_basic() local
428 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
430 m3 = m2.template selfadjointView<Lower>(); in sparse_basic()
437 SparseMatrixType m2(rows, rows); in sparse_basic() local
438 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
439 VERIFY_IS_APPROX(m2.eval(), refMat2.sparseView().eval()); in sparse_basic()
445 SparseMatrixType m2(rows, rows); in sparse_basic() local
446 initSparse<Scalar>(density, refMat2, m2); in sparse_basic()
447 VERIFY_IS_APPROX(m2.diagonal(), refMat2.diagonal().eval()); in sparse_basic()