Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 45fc79d4 authored by hhakim's avatar hhakim
Browse files

Fix Faust::MatSparse::get_rows/cols(): nnz wasn't updated in submatrix.

parent b6266a3b
Branches
Tags
No related merge requests found
...@@ -736,6 +736,7 @@ Faust::MatSparse<FPP,Cpu>* Faust::MatSparse<FPP,Cpu>::get_cols(faust_unsigned_in ...@@ -736,6 +736,7 @@ Faust::MatSparse<FPP,Cpu>* Faust::MatSparse<FPP,Cpu>::get_cols(faust_unsigned_in
tripletList.resize(count); tripletList.resize(count);
MatSparse<FPP, Cpu>* subMatrix = new MatSparse<FPP, Cpu>(this->getNbRow(), num_cols); MatSparse<FPP, Cpu>* subMatrix = new MatSparse<FPP, Cpu>(this->getNbRow(), num_cols);
subMatrix->mat.setFromTriplets(tripletList.begin(), tripletList.end()); subMatrix->mat.setFromTriplets(tripletList.begin(), tripletList.end());
subMatrix->nnz = subMatrix->mat.nonZeros();
return subMatrix; return subMatrix;
} }
...@@ -755,6 +756,7 @@ Faust::MatSparse<FPP,Cpu>* Faust::MatSparse<FPP,Cpu>::get_rows(faust_unsigned_in ...@@ -755,6 +756,7 @@ Faust::MatSparse<FPP,Cpu>* Faust::MatSparse<FPP,Cpu>::get_rows(faust_unsigned_in
tripletList.resize(count); tripletList.resize(count);
MatSparse<FPP, Cpu>* subMatrix = new MatSparse<FPP, Cpu>(num_rows, this->getNbCol()); MatSparse<FPP, Cpu>* subMatrix = new MatSparse<FPP, Cpu>(num_rows, this->getNbCol());
subMatrix->mat.setFromTriplets(tripletList.begin(), tripletList.end()); subMatrix->mat.setFromTriplets(tripletList.begin(), tripletList.end());
subMatrix->nnz = subMatrix->mat.nonZeros();
return subMatrix; return subMatrix;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment