rsl_interpolation/
lib.rs

1//! A re-write of [`GSL's Interpolation`] in Rust.
2//!
3//! [`GSL's Interpolation`]: https://www.gnu.org/software/gsl/doc/html/interp.html
4//!
5//! # 1D Interpolation Types
6//!
7//! + [Linear]
8//! + [Cubic]
9//! + [CubicPeriodic]
10//! + [Akima]
11//! + [AkimaPeriodic]
12//! + [Steffen]
13//! + [DynInterpType] - Dynamic Interpolation Type
14//!
15//! # 2D Interpolation Types
16//!
17//! + [Bilinear]
18//! + [Bicubic]
19//!
20//! # Higher level Interface
21//!
22//! + [Spline]
23//! + [Spline2d]
24//! + [DynSpline]
25//! + [DynSpline2d]
26//!
27#![allow(rustdoc::broken_intra_doc_links)]
28#![doc = include_str!("../TODO.md")]
29
30mod accel;
31mod error;
32mod interp;
33mod interp2d;
34mod types;
35
36mod spline;
37mod spline2d;
38
39pub use accel::Accelerator;
40
41pub use error::*;
42pub use interp::{InterpType, Interpolation};
43pub use interp2d::{z_get, z_idx, z_set, Interp2dType, Interpolation2d};
44
45pub use spline::{make_spline, DynSpline, Spline};
46pub use spline2d::{make_spline2d, DynSpline2d, Spline2d};
47
48pub use types::*;
49
50#[cfg(test)]
51mod tests;
52
53/// Trait for supported data types.
54pub trait Num: num::Float + num_traits::NumAssignOps + Sync + Send {}
55
56impl Num for f64 {}
57impl Num for f32 {}