Skip to content

Commit

Permalink
fix typo: (bi)liniar -> (bi)linear
Browse files Browse the repository at this point in the history
  • Loading branch information
jungerm2 committed Dec 14, 2023
1 parent e5c3acd commit 8a898d6
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ logarithmic spaced values.
- added type aliases for common interpolators
- make the `VectorExtensions` trait public
- add `Interp1D::new_unchecked` and `Interp2D::new_unchecked` methods
- add biliniar extrapolation
- add bilinear extrapolation
- impl `Default` for interpolation strategies

# 0.3.0
- add 2d interpolation
- add biliniar interpolation strategy
- add bilinear interpolation strategy
- rename `Strategy` to `Interp1DStrategy` and `StrategyBuilder` to `Interp1DStrategyBuilder`
- make extrapolate filed of `Linear` private add `extrapolate(bool)` method instead.

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "MIT"
description = "Interpolation package for ndarray"
repository = "https://github.com/jonasBoss/ndarray-interp"

keywords = ["interpolation", "multidimensional", "liniar", "biliniar", "cubic-spline"]
keywords = ["interpolation", "multidimensional", "linear", "bilinear", "cubic-spline"]
categories = ["science", "algorithms", "mathematics"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A Interpolation crate for usage with the rust [ndarray](https://crates.io/crates
## Interpolation strategies
- Linear interpolation with, and without extrapolation
- Cubic spline interpolation [Wikipedia](https://en.wikipedia.org/wiki/Spline_interpolation)
- Biliniar interpolation with, and without extrapolation [Wikipedia](https://en.wikipedia.org/wiki/Bilinear_interpolation)
- Bilinear interpolation with, and without extrapolation [Wikipedia](https://en.wikipedia.org/wiki/Bilinear_interpolation)

## Planned Features
- More interpolation strategies
Expand Down
4 changes: 2 additions & 2 deletions benches/bench_interp2d_query_dim.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use ndarray::{Array, Array1, Axis};
use ndarray_interp::interp2d::{Biliniar, Interp2D, Interp2DScalar};
use ndarray_interp::interp2d::{Bilinear, Interp2D, Interp2DScalar};

use rand_extensions::RandArray;

mod rand_extensions;

fn setup() -> (Interp2DScalar<f64, Biliniar>, Array1<f64>, Array1<f64>) {
fn setup() -> (Interp2DScalar<f64, Bilinear>, Array1<f64>, Array1<f64>) {
let data = Array::from_rand(10_000, (0.0, 1.0), 42)
.into_shape((100, 100))
.unwrap();
Expand Down
14 changes: 7 additions & 7 deletions src/interp2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! - [`Interp2DStrategyBuilder`] The trait used to specialize [`Interp2DBuilder`] to initialize the correct strategy
//!
//! # Strategies
//! - [`Biliniar`] Linear interpolation strategy
//! - [`Bilinear`] Linear interpolation strategy
use std::{any::TypeId, fmt::Debug, ops::Sub};

Expand All @@ -29,7 +29,7 @@ use crate::{
mod aliases;
mod strategies;
pub use aliases::*;
pub use strategies::{Biliniar, Interp2DStrategy, Interp2DStrategyBuilder};
pub use strategies::{Bilinear, Interp2DStrategy, Interp2DStrategyBuilder};

/// Two dimensional interpolator
#[derive(Debug)]
Expand All @@ -47,7 +47,7 @@ where
strategy: Strat,
}

impl<Sd, D> Interp2D<Sd, OwnedRepr<Sd::Elem>, OwnedRepr<Sd::Elem>, D, Biliniar>
impl<Sd, D> Interp2D<Sd, OwnedRepr<Sd::Elem>, OwnedRepr<Sd::Elem>, D, Bilinear>
where
Sd: Data,
Sd::Elem: Num + PartialOrd + NumCast + Copy + Debug + Sub + Send,
Expand All @@ -56,7 +56,7 @@ where
/// Get the [Interp2DBuilder]
pub fn builder(
data: ArrayBase<Sd, D>,
) -> Interp2DBuilder<Sd, OwnedRepr<Sd::Elem>, OwnedRepr<Sd::Elem>, D, Biliniar> {
) -> Interp2DBuilder<Sd, OwnedRepr<Sd::Elem>, OwnedRepr<Sd::Elem>, D, Bilinear> {
Interp2DBuilder::new(data)
}
}
Expand Down Expand Up @@ -379,7 +379,7 @@ where
strategy: Strat,
}

impl<Sd, D> Interp2DBuilder<Sd, OwnedRepr<Sd::Elem>, OwnedRepr<Sd::Elem>, D, Biliniar>
impl<Sd, D> Interp2DBuilder<Sd, OwnedRepr<Sd::Elem>, OwnedRepr<Sd::Elem>, D, Bilinear>
where
Sd: Data,
Sd::Elem: Num + PartialOrd + NumCast + Copy + Debug + Sub,
Expand All @@ -400,7 +400,7 @@ where
x,
y,
data,
strategy: Biliniar::new(),
strategy: Bilinear::new(),
}
}
}
Expand All @@ -416,7 +416,7 @@ where
Strat: Interp2DStrategyBuilder<Sd, Sx, Sy, D>,
{
/// Set the interpolation strategy by provideing a [`Interp2DStrategyBuilder`].
/// By default [`Biliniar`] is used.
/// By default [`Bilinear`] is used.
pub fn strategy<NewStrat: Interp2DStrategyBuilder<Sd, Sx, Sy, D>>(
self,
strategy: NewStrat,
Expand Down
4 changes: 2 additions & 2 deletions src/interp2d/strategies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use crate::{BuilderError, InterpolateError};

use super::Interp2D;

mod biliniar;
mod bilinear;

pub use biliniar::Biliniar;
pub use bilinear::Bilinear;

pub trait Interp2DStrategyBuilder<Sd, Sx, Sy, D>
where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ use crate::{interp1d::Linear, InterpolateError};
use super::{Interp2DStrategy, Interp2DStrategyBuilder};

#[derive(Debug)]
pub struct Biliniar {
pub struct Bilinear {
extrapolate: bool,
}

impl<Sd, Sx, Sy, D> Interp2DStrategyBuilder<Sd, Sx, Sy, D> for Biliniar
impl<Sd, Sx, Sy, D> Interp2DStrategyBuilder<Sd, Sx, Sy, D> for Bilinear
where
Sd: Data,
Sd::Elem: Num + PartialOrd + NumCast + Copy + Debug + Sub + Send,
Expand All @@ -35,7 +35,7 @@ where
}
}

impl<Sd, Sx, Sy, D> Interp2DStrategy<Sd, Sx, Sy, D> for Biliniar
impl<Sd, Sx, Sy, D> Interp2DStrategy<Sd, Sx, Sy, D> for Bilinear
where
Sd: Data,
Sd::Elem: Num + PartialOrd + NumCast + Copy + Debug + Sub + Send,
Expand Down Expand Up @@ -82,9 +82,9 @@ where
}
}

impl Biliniar {
impl Bilinear {
pub fn new() -> Self {
Biliniar { extrapolate: false }
Bilinear { extrapolate: false }
}

pub fn extrapolate(mut self, yes: bool) -> Self {
Expand All @@ -93,7 +93,7 @@ impl Biliniar {
}
}

impl Default for Biliniar {
impl Default for Bilinear {
fn default() -> Self {
Self::new()
}
Expand Down

0 comments on commit 8a898d6

Please sign in to comment.