Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
fix: avoid writing zero via sparse matrix iterator #1989
Writing a zero to a sparse matrix causes the element to be deleted. The zero is then immediately overwritten by a non-zero value. When using iterators, this is horribly inefficient: memory re-allocation + copying. It also has the potential to screw up the validity of the sparse matrix iterators.