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

Int based linear interpol #1482

Merged
merged 12 commits into from
Sep 5, 2022
Merged

Int based linear interpol #1482

merged 12 commits into from
Sep 5, 2022

Conversation

fulmicoton
Copy link
Collaborator

No description provided.

@fulmicoton fulmicoton force-pushed the int-based-linear-interpol branch 5 times, most recently from c3ea0ed to dd81978 Compare August 25, 2022 16:07
@codecov-commenter
Copy link

codecov-commenter commented Aug 25, 2022

Codecov Report

Merging #1482 (cb34b60) into main (00657d9) will decrease coverage by 0.01%.
The diff coverage is 98.77%.

@@            Coverage Diff             @@
##             main    #1482      +/-   ##
==========================================
- Coverage   93.98%   93.97%   -0.02%     
==========================================
  Files         241      242       +1     
  Lines       44754    44661      -93     
==========================================
- Hits        42063    41968      -95     
- Misses       2691     2693       +2     
Impacted Files Coverage Δ
fastfield_codecs/src/linear.rs 98.82% <98.41%> (+0.07%) ⬆️
fastfield_codecs/src/blockwise_linear.rs 98.70% <98.44%> (-0.65%) ⬇️
fastfield_codecs/src/line.rs 99.14% <99.14%> (ø)
fastfield_codecs/src/lib.rs 98.96% <100.00%> (+0.03%) ⬆️
src/fastfield/mod.rs 96.32% <100.00%> (+<0.01%) ⬆️
common/src/serialize.rs 85.98% <0.00%> (-3.83%) ⬇️
fastfield_codecs/src/serialize.rs 91.48% <0.00%> (-0.71%) ⬇️
src/postings/stacker/expull.rs 98.57% <0.00%> (-0.48%) ⬇️
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@fulmicoton fulmicoton force-pushed the int-based-linear-interpol branch 4 times, most recently from c7a8248 to dd8d72b Compare August 26, 2022 06:34
fix off by one to accurately interpolate autoincrement fields
impl Line {
#[inline(always)]
pub fn eval(&self, x: u64) -> u64 {
let linear_part = (x.wrapping_mul(self.slope) >> 32) as i32 as u64;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why cast first to i32?

Copy link
Collaborator Author

@fulmicoton fulmicoton Sep 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you want negative slopes to be interpreted as negative...
After the bitshift, you want stuff to be interpreted as negative is the 32th bit is set to 1, not the 64th.
There is probably a nicer a way to express it by expressing the slope as a i64.

@fulmicoton fulmicoton merged commit ea72cf3 into main Sep 5, 2022
@fulmicoton fulmicoton deleted the int-based-linear-interpol branch September 5, 2022 06:53
This was referenced Jan 13, 2023
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