Skip to content

Conversation

@tkluck
Copy link
Contributor

@tkluck tkluck commented Aug 17, 2017

Before this commit, find_next() will just use the default implementation of looping over each element. When find_next is called without a function filter as first argument, we know that semantics are to find elements x satisfying x != 0, so for sparse matrices/vectors, we may only loop over the stored elements.

Some care must be taken for stored zero values; that's the reason for the indirection of _sparse_find_next (which only finds the next stored element) and the actual find_next (which does actual non-zero checks).

Before this commit, find_next() will just use the default implementation
of looping over each element. When find_next is called without a
function filter as first argument, we *know* that semantics are to find
elements x satisfying x != 0, so for sparse matrices/vectors, we may
only loop over the stored elements.

Some care must be taken for stored zero values; that's the reason for
the indirection of _sparse_find_next (which only finds the next stored
element) and the actual find_next (which does actual non-zero checks).
@tkluck
Copy link
Contributor Author

tkluck commented Aug 17, 2017

Oops, just found a test failure. Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant