Skip to content

Commit e585262

Browse files
committed
API: Remove deprecated .all_close()
Replaced by .abs_diff_eq (using the approx feature)
1 parent 49b315a commit e585262

File tree

2 files changed

+0
-41
lines changed

2 files changed

+0
-41
lines changed

src/numeric/impl_numeric.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ use crate::imp_prelude::*;
1313
use crate::itertools::enumerate;
1414
use crate::numeric_util;
1515

16-
use crate::{FoldWhile, Zip};
17-
1816
/// # Numerical Methods for Arrays
1917
impl<A, S, D> ArrayBase<S, D>
2018
where
@@ -304,32 +302,4 @@ where
304302
{
305303
self.var_axis(axis, ddof).mapv_into(|x| x.sqrt())
306304
}
307-
308-
/// Return `true` if the arrays' elementwise differences are all within
309-
/// the given absolute tolerance, `false` otherwise.
310-
///
311-
/// If their shapes disagree, `rhs` is broadcast to the shape of `self`.
312-
///
313-
/// **Panics** if broadcasting to the same shape isn’t possible.
314-
#[deprecated(
315-
note = "Use `abs_diff_eq` - it requires the `approx` crate feature",
316-
since = "0.13.0"
317-
)]
318-
pub fn all_close<S2, E>(&self, rhs: &ArrayBase<S2, E>, tol: A) -> bool
319-
where
320-
A: Float,
321-
S2: Data<Elem = A>,
322-
E: Dimension,
323-
{
324-
!Zip::from(self)
325-
.and(rhs.broadcast_unwrap(self.raw_dim()))
326-
.fold_while((), |_, x, y| {
327-
if (*x - *y).abs() <= tol {
328-
FoldWhile::Continue(())
329-
} else {
330-
FoldWhile::Done(())
331-
}
332-
})
333-
.is_done()
334-
}
335305
}

tests/array.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,17 +1786,6 @@ fn test_contiguous() {
17861786
assert!(b.as_slice_memory_order().is_some());
17871787
}
17881788

1789-
#[test]
1790-
#[allow(deprecated)]
1791-
fn test_all_close() {
1792-
let c = arr3(&[
1793-
[[1., 2., 3.], [1.5, 1.5, 3.]],
1794-
[[1., 2., 3.], [1., 2.5, 3.]],
1795-
]);
1796-
assert!(c.all_close(&aview1(&[1., 2., 3.]), 1.));
1797-
assert!(!c.all_close(&aview1(&[1., 2., 3.]), 0.1));
1798-
}
1799-
18001789
#[test]
18011790
fn test_swap() {
18021791
let mut a = arr2(&[[1, 2, 3], [4, 5, 6], [7, 8, 9]]);

0 commit comments

Comments
 (0)