-
Notifications
You must be signed in to change notification settings - Fork 20
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
Adds test cases for sum and delta system macros #137
Conversation
(binary "EF 12 02 07 FF FF FF 01") | ||
(text "(:delta -1 -1 -1)") | ||
(produces -1 -2 -3)) | ||
(each "4 arguments" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you throw in one or two simple tests showing that delta-of-delta works too?
Summary of offline conversation in which we decided to keep The version in this PR is aligned with the commonly known concept of directed delta encoding. It is intended to be a compact representation of groups of numbers that are relatively close to each other. In practice, pre-analysis of the numbers to select a median/mode as the initial seed is unlikely to result in any significant savings over this method since delta encoding is designed to take advantage of things that have small differences. (As an aside, pre-analysis can be useful to determine whether delta encoding is actually beneficial—this strategy is used in some audio codecs.) The "difference from initial seed" function can be constructed using a template macro such as this:
|
As per offline conversation about the usefulness of allowing an arbitrary number of operands for |
Issue #, if available:
#88
Description of changes:
Adds test cases for
sum
anddelta
.As I was writing the test cases, it seemed really odd that
sum
can have zero-to-many argument values, butdelta
cannot. So, I made a decision to change that, and in these test cases,delta
accepts zero-to-many argument values, and the implicit initial value is zero. (Just likesum
.)If there's disagreement, I can revert back to the currently spec'd behavior. If we agree, then I can update the spec accordingly.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.