Skip to content

Commit 8be7b0f

Browse files
committed
doc update
1 parent 62a62cc commit 8be7b0f

File tree

7 files changed

+23
-14
lines changed

7 files changed

+23
-14
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ninterp"
3-
version = "0.4.0"
3+
version = "0.5.0"
44
edition = "2021"
55
description = "Numerical interpolation for N-dimensional rectilinear grids"
66
repository = "https://github.com/NREL/ninterp"
@@ -10,7 +10,7 @@ keywords = [
1010
"multidimensional",
1111
"multilinear",
1212
"numerical",
13-
"approximation",
13+
"linear",
1414
]
1515
categories = ["mathematics"]
1616

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
The `ninterp` crate provides [multivariate interpolation](https://en.wikipedia.org/wiki/Multivariate_interpolation#Regular_grid) over rectilinear grids of any dimensionality.
66

77
There are hard-coded interpolators for lower dimensionalities (up to N = 3) for better runtime performance.
8+
All interpolators work with both owned and borrowed arrays (array views) of various types.
89

910
A variety of interpolation strategies are implemented and exposed in the `prelude` module.
1011
Custom interpolation strategies can be defined in downstream crates.
@@ -27,18 +28,18 @@ See examples in `new` method documentation:
2728
- [`Interp3D::new`](https://docs.rs/ninterp/latest/ninterp/three/struct.Interp3D.html#method.new)
2829
- [`InterpND::new`](https://docs.rs/ninterp/latest/ninterp/n/struct.InterpND.html#method.new)
2930

30-
Also see the [`examples`](https://github.com/NREL/ninterp/tree/a26c77caeac9e4ba2c5e8a4dbd652ce00b5747f3/examples) directory for advanced examples:
31-
- Strategy dynamic dispatch: [`dynamic_strategy.rs`](https://github.com/NREL/ninterp/blob/a26c77caeac9e4ba2c5e8a4dbd652ce00b5747f3/examples/dynamic_strategy.rs)
31+
Also see the [`examples`](https://github.com/NREL/ninterp/tree/62a62ccd2b3c285919baae609089dee287dc3842/examples) directory for advanced examples:
32+
- Strategy dynamic dispatch: [`dynamic_strategy.rs`](https://github.com/NREL/ninterp/blob/62a62ccd2b3c285919baae609089dee287dc3842/examples/dynamic_strategy.rs)
3233

3334
By default, construction of interpolators uses *static dispatch*,
3435
meaning strategy concrete types are determined at compilation.
3536
This gives increased performance at the cost of runtime flexibility.
3637
To allow swapping strategies at runtime,
3738
use *dynamic dispatch* by providing a trait object `Box<dyn Strategy1D>`/etc. to the `new` method.
3839

39-
- Interpolator dynamic dispatch using `Box<dyn Interpolator>`: [`dynamic_interpolator.rs`](https://github.com/NREL/ninterp/blob/46d8436c4ac389e778392a28048fb9e32a80b8e0/examples/dynamic_interpolator.rs)
40+
- Interpolator dynamic dispatch using `Box<dyn Interpolator>`: [`dynamic_interpolator.rs`](https://github.com/NREL/ninterp/blob/62a62ccd2b3c285919baae609089dee287dc3842/examples/dynamic_interpolator.rs)
4041

41-
- Defining custom strategies: [`custom_strategy.rs`](https://github.com/NREL/ninterp/blob/46d8436c4ac389e778392a28048fb9e32a80b8e0/examples/custom_strategy.rs)
42+
- Defining custom strategies: [`custom_strategy.rs`](https://github.com/NREL/ninterp/blob/62a62ccd2b3c285919baae609089dee287dc3842/examples/custom_strategy.rs)
4243

4344
## Overview
4445
A prelude module has been defined:
@@ -78,7 +79,7 @@ Not all interpolation strategies are implemented for every dimensionality.
7879
`Linear` and `Nearest` are implemented for all dimensionalities.
7980

8081
Custom strategies can be defined. See
81-
[`examples/custom_strategy.rs`](https://github.com/NREL/ninterp/blob/a26c77caeac9e4ba2c5e8a4dbd652ce00b5747f3/examples/custom_strategy.rs)
82+
[`examples/custom_strategy.rs`](https://github.com/NREL/ninterp/blob/62a62ccd2b3c285919baae609089dee287dc3842/examples/custom_strategy.rs)
8283
for an example.
8384

8485
### Extrapolation

src/lib.rs

+11-7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//! over rectilinear grids of any dimensionality.
44
//!
55
//! There are hard-coded interpolators for lower dimensionalities (up to N = 3) for better runtime performance.
6+
//! All interpolators work with both owned and borrowed arrays (array views) of various types.
67
//!
78
//! A variety of interpolation strategies are implemented and exposed in the `prelude` module.
89
//! Custom interpolation strategies can be defined in downstream crates.
@@ -11,7 +12,7 @@
1112
//! cargo add ninterp
1213
//! ```
1314
//!
14-
//! #### Feature Flags
15+
//! ### Cargo Features
1516
//! - `serde`: support for [`serde`](https://crates.io/crates/serde)
1617
//! ```text
1718
//! cargo add ninterp --features serde
@@ -25,19 +26,22 @@
2526
//! - [`Interp3D::new`](`interpolator::Interp3D::new`)
2627
//! - [`InterpND::new`](`interpolator::InterpND::new`)
2728
//!
28-
//! Also see the [`examples`](https://github.com/NREL/ninterp/tree/a26c77caeac9e4ba2c5e8a4dbd652ce00b5747f3/examples)
29+
//! Also see the [`examples`](https://github.com/NREL/ninterp/tree/62a62ccd2b3c285919baae609089dee287dc3842/examples)
2930
//! directory for advanced examples:
30-
//! - Strategy dynamic dispatch: [`dynamic_strategy.rs`](https://github.com/NREL/ninterp/blob/a26c77caeac9e4ba2c5e8a4dbd652ce00b5747f3/examples/dynamic_strategy.rs)
31+
//! - Strategy dynamic dispatch:
32+
//! [`dynamic_strategy.rs`](https://github.com/NREL/ninterp/blob/62a62ccd2b3c285919baae609089dee287dc3842/examples/dynamic_strategy.rs)
3133
//!
3234
//! By default, construction of interpolators uses *static dispatch*,
3335
//! meaning strategy concrete types are determined at compilation.
3436
//! This gives increased performance at the cost of runtime flexibility.
3537
//! To allow swapping strategies at runtime,
3638
//! use *dynamic dispatch* by providing a trait object `Box<dyn Strategy1D>`/etc. to the `new` method.
3739
//!
38-
//! - Interpolator dynamic dispatch using `Box<dyn Interpolator>`: [`dynamic_interpolator.rs`](https://github.com/NREL/ninterp/blob/46d8436c4ac389e778392a28048fb9e32a80b8e0/examples/dynamic_interpolator.rs)
40+
//! - Interpolator dynamic dispatch using `Box<dyn Interpolator>`:
41+
//! [`dynamic_interpolator.rs`](https://github.com/NREL/ninterp/blob/62a62ccd2b3c285919baae609089dee287dc3842/examples/dynamic_interpolator.rs)
3942
//!
40-
//! - Defining custom strategies: [`custom_strategy.rs`](https://github.com/NREL/ninterp/blob/46d8436c4ac389e778392a28048fb9e32a80b8e0/examples/custom_strategy.rs)
43+
//! - Defining custom strategies:
44+
//! [`custom_strategy.rs`](https://github.com/NREL/ninterp/blob/62a62ccd2b3c285919baae609089dee287dc3842/examples/custom_strategy.rs)
4145
//!
4246
//! # Overview
4347
//! A prelude module has been defined:
@@ -73,7 +77,7 @@
7377
//! [`Linear`] and [`Nearest`] are implemented for all dimensionalities.
7478
//!
7579
//! Custom strategies can be defined. See
76-
//! [`examples/custom_strategy.rs`](https://github.com/NREL/ninterp/blob/a26c77caeac9e4ba2c5e8a4dbd652ce00b5747f3/examples/custom_strategy.rs)
80+
//! [`examples/custom_strategy.rs`](https://github.com/NREL/ninterp/blob/62a62ccd2b3c285919baae609089dee287dc3842/examples/custom_strategy.rs)
7781
//! for an example.
7882
//!
7983
//! ## Extrapolation
@@ -94,7 +98,7 @@
9498
//! The length of the interpolant point slice must be equal to the interpolator dimensionality.
9599
//! The interpolator dimensionality can be retrieved by calling [`Interpolator::ndim`].
96100
97-
/// The `prelude` module exposes:
101+
/// The `prelude` module exposes a variety of types:
98102
/// - All interpolator structs:
99103
/// - [`Interp0D`](`interpolator::Interp0D`)
100104
/// - [`Interp1D`](`interpolator::Interp1D`)

src/n/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ where
232232
D: Data,
233233
D::Elem: Num + PartialOrd + Copy + Debug,
234234
{
235+
/// Update strategy dynamically.
235236
pub fn set_strategy(&mut self, strategy: Box<dyn StrategyND<D>>) -> Result<(), ValidateError> {
236237
self.strategy = strategy;
237238
self.check_extrapolate(&self.extrapolate)

src/one/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ where
186186
D: Data,
187187
D::Elem: Num + PartialOrd + Copy + Debug,
188188
{
189+
/// Update strategy dynamically.
189190
pub fn set_strategy(&mut self, strategy: Box<dyn Strategy1D<D>>) -> Result<(), ValidateError> {
190191
self.strategy = strategy;
191192
self.check_extrapolate(&self.extrapolate)

src/three/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ where
228228
D: Data,
229229
D::Elem: Num + PartialOrd + Copy + Debug,
230230
{
231+
/// Update strategy dynamically.
231232
pub fn set_strategy(&mut self, strategy: Box<dyn Strategy3D<D>>) -> Result<(), ValidateError> {
232233
self.strategy = strategy;
233234
self.check_extrapolate(&self.extrapolate)

src/two/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ where
207207
D: Data,
208208
D::Elem: Num + PartialOrd + Copy + Debug,
209209
{
210+
/// Update strategy dynamically.
210211
pub fn set_strategy(&mut self, strategy: Box<dyn Strategy2D<D>>) -> Result<(), ValidateError> {
211212
self.strategy = strategy;
212213
self.check_extrapolate(&self.extrapolate)

0 commit comments

Comments
 (0)