Skip to content
Snippets Groups Projects
Commit 34b957a9 authored by Norihiro Watanabe's avatar Norihiro Watanabe
Browse files

[Math] avoid using expensive SparseMatrix::setZero()

parent 0c83f6e0
No related branches found
No related tags found
1 merge request!805some improvements in MathLib/LinAlg
......@@ -55,7 +55,9 @@ public:
/// reset data entries to zero.
void setZero()
{
_mat.setZero();
for (std::size_t i=0; i<_mat.nonZeros(); i++)
_mat.valuePtr()[i] = 0;
// don't use _mat.setZero(). it makes a matrix uncompressed
}
/// set a value to the given entry. If the entry doesn't exist, this class
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment