Skip to content

Commit

Permalink
Upgraded ordered-float
Browse files Browse the repository at this point in the history
  • Loading branch information
RReverser committed Jan 30, 2024
1 parent 587ab92 commit a9ac79a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ edition = "2018"

[dependencies]
num-traits = "0.2.17"
ordered-float = "3.9.2"
ordered-float = "4.2.0"
pdqselect = "0.1.1"
typenum = "1.17.0"
paste = "1.0.14"
Expand Down
14 changes: 7 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl<T, N: Unsigned> KdSliceN<T, N> {
pub fn sort_by_ordered_float(points: &mut [T]) -> &Self
where
T: KdPoint<Dim = N>,
T::Scalar: num_traits::Float,
T::Scalar: ordered_float::FloatCore,
{
Self::sort_by_key(points, |item, k| ordered_float::OrderedFloat(item.at(k)))
}
Expand Down Expand Up @@ -396,7 +396,7 @@ impl<T: Send, N: Unsigned> KdSliceN<T, N> {
pub fn par_sort_by_ordered_float(points: &mut [T]) -> &Self
where
T: KdPoint<Dim = N>,
T::Scalar: num_traits::Float,
T::Scalar: ordered_float::FloatCore,
{
Self::par_sort_by_key(points, |item, k| ordered_float::OrderedFloat(item.at(k)))
}
Expand Down Expand Up @@ -503,7 +503,7 @@ impl<T, N: Unsigned> KdTreeN<T, N> {
pub fn build_by_ordered_float(points: Vec<T>) -> Self
where
T: KdPoint<Dim = N>,
T::Scalar: num_traits::Float,
T::Scalar: ordered_float::FloatCore,
{
Self::build_by_key(points, |item, k| ordered_float::OrderedFloat(item.at(k)))
}
Expand Down Expand Up @@ -562,7 +562,7 @@ impl<T: Send, N: Unsigned> KdTreeN<T, N> {
pub fn par_build_by_ordered_float(points: Vec<T>) -> Self
where
T: KdPoint<Dim = N>,
T::Scalar: num_traits::Float,
T::Scalar: ordered_float::FloatCore,
{
Self::par_build_by_key(points, |item, k| ordered_float::OrderedFloat(item.at(k)))
}
Expand Down Expand Up @@ -628,7 +628,7 @@ impl<'a, T, N: Unsigned> KdIndexTreeN<'a, T, N> {
pub fn build_by_ordered_float(points: &'a [T]) -> Self
where
T: KdPoint<Dim = N>,
T::Scalar: num_traits::Float,
T::Scalar: ordered_float::FloatCore,
{
Self::build_by_key(points, |item, k| ordered_float::OrderedFloat(item.at(k)))
}
Expand Down Expand Up @@ -766,7 +766,7 @@ impl<'a, T: Sync, N: Unsigned> KdIndexTreeN<'a, T, N> {
pub fn par_build_by_ordered_float(points: &'a [T]) -> Self
where
T: KdPoint<Dim = N>,
T::Scalar: num_traits::Float,
T::Scalar: ordered_float::FloatCore,
{
Self::par_build_by_key(points, |item, k| ordered_float::OrderedFloat(item.at(k)))
}
Expand Down Expand Up @@ -797,7 +797,7 @@ macro_rules! impl_kd_points {
($($len:literal),*) => {
$(
paste::paste!{
impl<T: num_traits::NumAssign + Copy + PartialOrd> KdPoint for [T; $len] {
impl<T: num_traits::NumAssign + Copy + PartialOrd + ordered_float::FloatCore> KdPoint for [T; $len] {
type Scalar = T;
type Dim = typenum::[<U $len>];
fn at(&self, i: usize) -> T { self[i] }
Expand Down

0 comments on commit a9ac79a

Please sign in to comment.