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

Check overlapping quantization ranges before applying transfomation #6

Open
cirocosta opened this issue Jul 6, 2018 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@cirocosta
Copy link
Owner

Hey,

Although Quantize already includes tests for overlapping

It("overlaps if from in another range", func() {
Expect(qRange.RangeOverlaps(editor.QuantizeRange{
From: 1.5,
To: 3,
})).To(BeTrue())
})

we don't make use of it after parsing the ranges.

We can make an O(n^2) checking over the ranges and that should be fine:

for i, _ := range ranges:
  for k, _ := range ranges:
    if i == k: continue
    if ranges[i].overlaps(ranges[k]):
       error

thx!

@cirocosta cirocosta added the enhancement New feature or request label Jul 6, 2018
@cirocosta
Copy link
Owner Author

Similar to #11 , but instead, apply it only for the quantization transformation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant