Registered Member
|
Hi,
Why does inserting a zero into a sparse matrix increase it nonZeros count? I'm using version 3.1.2.
|
Moderator
|
That's on purpose. Explicitly inserted zero are explicitly stored. This is required in many configurations where it is important to preserve the structure in case of zeros appearing by accident. If you don't want explicit zeros, then do not insert them! You can also prune them afterwards. See the prune () function.
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]