Skip to content

Commit

Permalink
mark new_unchecked methods as unsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasBoss committed Feb 12, 2024
1 parent ee4dab4 commit 87d3484
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand Down
2 changes: 1 addition & 1 deletion src/interp1d/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Sx, Ix1>, data: ArrayBase<Sd, D>, strategy: Strat) -> Self {
pub unsafe fn new_unchecked(x: ArrayBase<Sx, Ix1>, data: ArrayBase<Sd, D>, strategy: Strat) -> Self {
Interp1D { x, data, strategy }
}

Expand Down
2 changes: 1 addition & 1 deletion src/interp2d/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Sx, Ix1>,
y: ArrayBase<Sy, Ix1>,
data: ArrayBase<Sd, D>,
Expand Down

0 comments on commit 87d3484

Please sign in to comment.