@@ -13,8 +13,6 @@ use crate::imp_prelude::*;
13
13
use crate :: itertools:: enumerate;
14
14
use crate :: numeric_util;
15
15
16
- use crate :: { FoldWhile , Zip } ;
17
-
18
16
/// # Numerical Methods for Arrays
19
17
impl < A , S , D > ArrayBase < S , D >
20
18
where
48
46
sum
49
47
}
50
48
49
+ /// Return the sum of all elements in the array.
50
+ ///
51
+ /// *This method has been renamed to `.sum()`*
52
+ #[ deprecated( note="renamed to `sum`" , since="0.15.0" ) ]
53
+ pub fn scalar_sum ( & self ) -> A
54
+ where
55
+ A : Clone + Add < Output = A > + num_traits:: Zero ,
56
+ {
57
+ self . sum ( )
58
+ }
59
+
51
60
/// Returns the [arithmetic mean] x̅ of all elements in the array:
52
61
///
53
62
/// ```text
75
84
}
76
85
}
77
86
78
- /// Return the sum of all elements in the array.
79
- ///
80
- /// *This method has been renamed to `.sum()` and will be deprecated in the
81
- /// next version.*
82
- // #[deprecated(note="renamed to `sum`", since="0.13")]
83
- pub fn scalar_sum ( & self ) -> A
84
- where
85
- A : Clone + Add < Output = A > + num_traits:: Zero ,
86
- {
87
- self . sum ( )
88
- }
89
-
90
87
/// Return the product of all elements in the array.
91
88
///
92
89
/// ```
@@ -305,32 +302,4 @@ where
305
302
{
306
303
self . var_axis ( axis, ddof) . mapv_into ( |x| x. sqrt ( ) )
307
304
}
308
-
309
- /// Return `true` if the arrays' elementwise differences are all within
310
- /// the given absolute tolerance, `false` otherwise.
311
- ///
312
- /// If their shapes disagree, `rhs` is broadcast to the shape of `self`.
313
- ///
314
- /// **Panics** if broadcasting to the same shape isn’t possible.
315
- #[ deprecated(
316
- note = "Use `abs_diff_eq` - it requires the `approx` crate feature" ,
317
- since = "0.13.0"
318
- ) ]
319
- pub fn all_close < S2 , E > ( & self , rhs : & ArrayBase < S2 , E > , tol : A ) -> bool
320
- where
321
- A : Float ,
322
- S2 : Data < Elem = A > ,
323
- E : Dimension ,
324
- {
325
- !Zip :: from ( self )
326
- . and ( rhs. broadcast_unwrap ( self . raw_dim ( ) ) )
327
- . fold_while ( ( ) , |_, x, y| {
328
- if ( * x - * y) . abs ( ) <= tol {
329
- FoldWhile :: Continue ( ( ) )
330
- } else {
331
- FoldWhile :: Done ( ( ) )
332
- }
333
- } )
334
- . is_done ( )
335
- }
336
305
}
0 commit comments