|
3 | 3 | //! over rectilinear grids of any dimensionality. |
4 | 4 | //! |
5 | 5 | //! 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. |
6 | 7 | //! |
7 | 8 | //! A variety of interpolation strategies are implemented and exposed in the `prelude` module. |
8 | 9 | //! Custom interpolation strategies can be defined in downstream crates. |
|
11 | 12 | //! cargo add ninterp |
12 | 13 | //! ``` |
13 | 14 | //! |
14 | | -//! #### Feature Flags |
| 15 | +//! ### Cargo Features |
15 | 16 | //! - `serde`: support for [`serde`](https://crates.io/crates/serde) |
16 | 17 | //! ```text |
17 | 18 | //! cargo add ninterp --features serde |
|
25 | 26 | //! - [`Interp3D::new`](`interpolator::Interp3D::new`) |
26 | 27 | //! - [`InterpND::new`](`interpolator::InterpND::new`) |
27 | 28 | //! |
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) |
29 | 30 | //! 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) |
31 | 33 | //! |
32 | 34 | //! By default, construction of interpolators uses *static dispatch*, |
33 | 35 | //! meaning strategy concrete types are determined at compilation. |
34 | 36 | //! This gives increased performance at the cost of runtime flexibility. |
35 | 37 | //! To allow swapping strategies at runtime, |
36 | 38 | //! use *dynamic dispatch* by providing a trait object `Box<dyn Strategy1D>`/etc. to the `new` method. |
37 | 39 | //! |
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) |
39 | 42 | //! |
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) |
41 | 45 | //! |
42 | 46 | //! # Overview |
43 | 47 | //! A prelude module has been defined: |
|
73 | 77 | //! [`Linear`] and [`Nearest`] are implemented for all dimensionalities. |
74 | 78 | //! |
75 | 79 | //! 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) |
77 | 81 | //! for an example. |
78 | 82 | //! |
79 | 83 | //! ## Extrapolation |
|
94 | 98 | //! The length of the interpolant point slice must be equal to the interpolator dimensionality. |
95 | 99 | //! The interpolator dimensionality can be retrieved by calling [`Interpolator::ndim`]. |
96 | 100 |
|
97 | | -/// The `prelude` module exposes: |
| 101 | +/// The `prelude` module exposes a variety of types: |
98 | 102 | /// - All interpolator structs: |
99 | 103 | /// - [`Interp0D`](`interpolator::Interp0D`) |
100 | 104 | /// - [`Interp1D`](`interpolator::Interp1D`) |
|
0 commit comments