-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AdaptiveVector isNonZero
is broken when sparseval == Monoid[T].zero
#583
Comments
isNonZero
is brokenisNonZero
is broken when sparseval == Monoid[T].zero
This is only a problem when the sparse value is the same as the zero of the underlying monoid. Once this is fixed, we'll want to remove the custom
|
this is still flakey:
|
Hi all, two questions
This bug is happening because the size of the result is getting set to the larger of the two arguments which is the right thing to do as long as neither argument
|
Whoops! Scratch (2), I get it now: Okay, so I maintain that |
Now that I've poked around, a couple qs about what the semantics should be.
I think we should only be adding non-sparse values so this looks like a bug to me, but want to make sure this is not, in fact, desired behavior. |
I think the only use of I'm happy adding some better constraints and saying that two densevectors are only equal if they have the same length. I think we should do the more complex thing for sparse vs dense. |
Same length for dense, not-necessarily the same length for sparse makes perfect sense so I'll do that and address the adding sparse values issue, too. Okay, I see, |
Here's an example of the breakage:
Monoid.plus
returnsSparseVector(1, 0, 0, 0, 0)
, extending the first vector. We want to be able to add zero-only vectors of any length and treat them as identity.The text was updated successfully, but these errors were encountered: