Skip to content

Commit 62ba446

Browse files
committed
Upgrade ndarray to 0.15.0
1 parent 56b1e1b commit 62ba446

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ keywords = ["array", "multidimensional", "statistics", "matrix", "ndarray"]
1616
categories = ["data-structures", "science"]
1717

1818
[dependencies]
19-
ndarray = "0.14"
19+
ndarray = "0.15.0"
2020
noisy_float = "0.2.0"
2121
num-integer = "0.1"
2222
num-traits = "0.2"
@@ -25,10 +25,10 @@ itertools = { version = "0.10.0", default-features = false }
2525
indexmap = "1.6.2"
2626

2727
[dev-dependencies]
28-
ndarray = { version = "0.14", features = ["approx"] }
29-
criterion = "0.3.4"
28+
ndarray = { version = "0.15.0", features = ["approx"] }
29+
criterion = "0.3"
3030
quickcheck = { version = "0.9.2", default-features = false }
31-
ndarray-rand = "0.13.0"
31+
ndarray-rand = "0.14.0"
3232
approx = "0.4"
3333
quickcheck_macros = "1.0.0"
3434
num-bigint = "0.4.0"

src/deviation.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ where
232232

233233
let mut count = 0;
234234

235-
Zip::from(self).and(other).apply(|a, b| {
235+
Zip::from(self).and(other).for_each(|a, b| {
236236
if a == b {
237237
count += 1;
238238
}
@@ -259,7 +259,7 @@ where
259259

260260
let mut result = A::zero();
261261

262-
Zip::from(self).and(other).apply(|self_i, other_i| {
262+
Zip::from(self).and(other).for_each(|self_i, other_i| {
263263
let (a, b) = (self_i.clone(), other_i.clone());
264264
let diff = a - b;
265265
result += diff.clone() * diff;
@@ -291,7 +291,7 @@ where
291291

292292
let mut result = A::zero();
293293

294-
Zip::from(self).and(other).apply(|self_i, other_i| {
294+
Zip::from(self).and(other).for_each(|self_i, other_i| {
295295
let (a, b) = (self_i.clone(), other_i.clone());
296296
result += (a - b).abs();
297297
});
@@ -309,7 +309,7 @@ where
309309

310310
let mut max = A::zero();
311311

312-
Zip::from(self).and(other).apply(|self_i, other_i| {
312+
Zip::from(self).and(other).for_each(|self_i, other_i| {
313313
let (a, b) = (self_i.clone(), other_i.clone());
314314
let diff = (a - b).abs();
315315
if diff > max {

src/entropy.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ where
169169
Zip::from(&mut temp)
170170
.and(self)
171171
.and(q)
172-
.apply(|result, &p, &q| {
172+
.for_each(|result, &p, &q| {
173173
*result = {
174174
if p == A::zero() {
175175
A::zero()
@@ -202,7 +202,7 @@ where
202202
Zip::from(&mut temp)
203203
.and(self)
204204
.and(q)
205-
.apply(|result, &p, &q| {
205+
.for_each(|result, &p, &q| {
206206
*result = {
207207
if p == A::zero() {
208208
A::zero()

src/maybe_nan/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ where
332332
A: 'a,
333333
F: FnMut(&'a A::NotNan),
334334
{
335-
self.visit(|elem| {
335+
self.for_each(|elem| {
336336
if let Some(not_nan) = elem.try_as_not_nan() {
337337
f(not_nan)
338338
}

src/quantile/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ where
477477
let mut results = Array::from_elem(results_shape, data.first().unwrap().clone());
478478
Zip::from(results.lanes_mut(axis))
479479
.and(data.lanes_mut(axis))
480-
.apply(|mut results, mut data| {
480+
.for_each(|mut results, mut data| {
481481
let index_map =
482482
get_many_from_sorted_mut_unchecked(&mut data, &searched_indexes);
483483
for (result, &q) in results.iter_mut().zip(qs) {

0 commit comments

Comments
 (0)