Skip to content
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

Fix SketchMapMonoid zero #269

Merged
merged 1 commit into from
Feb 21, 2014
Merged

Fix SketchMapMonoid zero #269

merged 1 commit into from
Feb 21, 2014

Conversation

jcoveney
Copy link
Contributor

So, I will add some tests to make sure that this is an issue but I was round-tripping the monoid zero and getting errors, and it looks like this change in the old to new transition is causing them. I'm not sure how we wouldn't run into this in our tests though?! I'll add a failing test but I was hoping @cheecheeo might be able to opine

@cheecheeo
Copy link
Contributor

Looks good to me. I wasn't keeping serialization in mind when I wrote that code :-/. 👍

@cheecheeo
Copy link
Contributor

For serialization purposes this change needs to go in:

It used to be the case that if we serialized the a zero sketchmap (width = 2, depth = 3) we would get this on disk:

0 0 0
0 0 0

With my changes we get this on disk

Z -- where Z is AdaptiveMatrix.monoid.zero ~= SparseVector ~= Map, which is not represented the same way on disk.

When I was writing this code, I was thinking purely of satisfying the monoid laws and thought that AdaptiveMatrix.monoid.zero was simpler than creating the matrix of proper width and height and filling it with V's zeros.

johnynek added a commit that referenced this pull request Feb 21, 2014
@johnynek johnynek merged commit 8e3ae95 into develop Feb 21, 2014
@johnynek johnynek deleted the jco/fix_sketchmap_zero branch February 21, 2014 00:17
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.

3 participants