You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
according to @pelesh, there is no hard requirement that the value stored in the nnz_expanded_ field on the Sparse class be correct. the field should either be removed entirely (as i'm not really sure what it would be used for if it can't be relied on) or have this invariant documented so that it does not lead to confusion or errors in the future
The text was updated successfully, but these errors were encountered:
superwhiskers
changed the title
document invariants for nnz_expanded or remove it entirely
document invariants for nnz_expanded_ or remove it entirely
Jun 19, 2024
The nnz_expanded_ refers to the number of non zeros when you expand a symmetric matrix to a general sparse matrix format. There is no way of knowing nnz_expanded_ upon instantiation of a sparse symmetric matrix in upper/lower triangular form, so it should be set to zero and stay zero for al long as flag is_expanded_ is set to false. The nnz_expanded_ needs to be calculated at the time when a function to expand the matrix into a general form is called. The expand function should have the responsibility to set the new number of nonzeros and flip the flag is_expanded_ to true.
My preference would be to remove nnz_expanded_ as a member variable altogether because it is used only as a temporary storage until nnz_ is updated.
according to @pelesh, there is no hard requirement that the value stored in the
nnz_expanded_
field on theSparse
class be correct. the field should either be removed entirely (as i'm not really sure what it would be used for if it can't be relied on) or have this invariant documented so that it does not lead to confusion or errors in the futureThe text was updated successfully, but these errors were encountered: