-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump kbnf version * Use radix sort in samplers * Make `cargo fmt` happy
- Loading branch information
1 parent
4888fcc
commit 87cca8b
Showing
7 changed files
with
90 additions
and
24 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
use std::cmp::Ordering; | ||
use voracious_radix_sort::Radixable; | ||
#[derive(Copy, Clone, Debug)] | ||
pub struct F32WithIndex(pub usize, pub f32); | ||
impl PartialOrd for F32WithIndex { | ||
fn partial_cmp(&self, other: &F32WithIndex) -> Option<Ordering> { | ||
self.1.partial_cmp(&other.1) | ||
} | ||
} | ||
impl PartialEq for F32WithIndex { | ||
fn eq(&self, other: &Self) -> bool { | ||
self.1 == other.1 | ||
} | ||
} | ||
impl Radixable<f32> for F32WithIndex { | ||
type Key = f32; | ||
#[inline] | ||
fn key(&self) -> Self::Key { | ||
self.1 | ||
} | ||
} | ||
#[derive(Copy, Clone, Debug)] | ||
pub struct DoubleF32WithIndex(pub usize, pub f32, pub f32); | ||
impl PartialOrd for DoubleF32WithIndex { | ||
fn partial_cmp(&self, other: &DoubleF32WithIndex) -> Option<Ordering> { | ||
self.2.partial_cmp(&other.2) | ||
} | ||
} | ||
impl PartialEq for DoubleF32WithIndex { | ||
fn eq(&self, other: &Self) -> bool { | ||
self.2 == other.2 | ||
} | ||
} | ||
impl Radixable<f32> for DoubleF32WithIndex { | ||
type Key = f32; | ||
#[inline] | ||
fn key(&self) -> Self::Key { | ||
self.2 | ||
} | ||
} |