diff --git a/CHANGELOG.md b/CHANGELOG.md index 800fbde..999cf04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - make not-a-knot boundary condition the default - allow any first or second derivative as boundary condition - fix typo `Biliniar` -> `Bilinear` + - change `new_unchecked` methods to be marked as `unsafe` # 0.4.1 - major performance improvement for `interp_scalar()` methods ~-50% diff --git a/src/interp1d/mod.rs b/src/interp1d/mod.rs index b1980eb..ac45d7a 100644 --- a/src/interp1d/mod.rs +++ b/src/interp1d/mod.rs @@ -359,7 +359,7 @@ where /// - `x` is stricktly monotonic rising /// - `data.shape()[0] == x.len()` /// - the `strategy` is porperly initialized with the data - pub fn new_unchecked(x: ArrayBase, data: ArrayBase, strategy: Strat) -> Self { + pub unsafe fn new_unchecked(x: ArrayBase, data: ArrayBase, strategy: Strat) -> Self { Interp1D { x, data, strategy } } diff --git a/src/interp2d/mod.rs b/src/interp2d/mod.rs index f336c5c..e516caf 100644 --- a/src/interp2d/mod.rs +++ b/src/interp2d/mod.rs @@ -327,7 +327,7 @@ where /// - `x` and `y` are stricktly monotonic rising /// - `data.shape()[0] == x.len()`, `data.shape()[1] == y.len()` /// - the `strategy` is porperly initialized with the data - pub fn new_unchecked( + pub unsafe fn new_unchecked( x: ArrayBase, y: ArrayBase, data: ArrayBase,