Commit a963a0ce authored by D'azevedo, Ed's avatar D'azevedo, Ed Committed by Alvarez, Gonzalo
Browse files

snapshot

parent 69f2a61a
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -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) {
@@ -736,8 +745,8 @@ void fullMatrixToCrsMatrix(CrsMatrix<T>& crsMatrix, const Matrix<T>& a)
                        else {
			   crsMatrix.setValues(counter, val);
			   crsMatrix.setCol(counter, j);
			   ++counter;
                        };
			++counter;
		}
	}

@@ -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