Loading src/CrsMatrix.h +15 −4 Original line number Diff line number Diff line Loading @@ -717,10 +717,19 @@ void fullMatrixToCrsMatrix(CrsMatrix<T>& crsMatrix, const Matrix<T>& a) SizeType cols = a.cols(); SizeType nonZeros = rows * cols; const bool use_push = true; if (use_push) { // ------------------------------ // avoid filling array with zeros // ------------------------------ crsMatrix.resize(rows, cols ); crsMatrix.reserve( nonZeros ); } else { crsMatrix.resize(rows, cols, nonZeros ); }; const bool use_push = true; SizeType counter = 0; for (SizeType i = 0; i < rows; ++i) { Loading @@ -736,8 +745,8 @@ void fullMatrixToCrsMatrix(CrsMatrix<T>& crsMatrix, const Matrix<T>& a) else { crsMatrix.setValues(counter, val); crsMatrix.setCol(counter, j); ++counter; }; ++counter; } } Loading @@ -745,6 +754,8 @@ void fullMatrixToCrsMatrix(CrsMatrix<T>& crsMatrix, const Matrix<T>& a) crsMatrix.checkValidity(); } /** If order==false then creates B such that B_{i1+j1*nout,i2+j2*nout)=A(j1,j2)\delta_{i1,i2} if order==true then Loading Loading
src/CrsMatrix.h +15 −4 Original line number Diff line number Diff line Loading @@ -717,10 +717,19 @@ void fullMatrixToCrsMatrix(CrsMatrix<T>& crsMatrix, const Matrix<T>& a) SizeType cols = a.cols(); SizeType nonZeros = rows * cols; const bool use_push = true; if (use_push) { // ------------------------------ // avoid filling array with zeros // ------------------------------ crsMatrix.resize(rows, cols ); crsMatrix.reserve( nonZeros ); } else { crsMatrix.resize(rows, cols, nonZeros ); }; const bool use_push = true; SizeType counter = 0; for (SizeType i = 0; i < rows; ++i) { Loading @@ -736,8 +745,8 @@ void fullMatrixToCrsMatrix(CrsMatrix<T>& crsMatrix, const Matrix<T>& a) else { crsMatrix.setValues(counter, val); crsMatrix.setCol(counter, j); ++counter; }; ++counter; } } Loading @@ -745,6 +754,8 @@ void fullMatrixToCrsMatrix(CrsMatrix<T>& crsMatrix, const Matrix<T>& a) crsMatrix.checkValidity(); } /** If order==false then creates B such that B_{i1+j1*nout,i2+j2*nout)=A(j1,j2)\delta_{i1,i2} if order==true then Loading