diff --git a/src/parallel/impl_par_methods.rs b/src/parallel/impl_par_methods.rs index 189436c3d..f825daa51 100644 --- a/src/parallel/impl_par_methods.rs +++ b/src/parallel/impl_par_methods.rs @@ -196,5 +196,8 @@ zip_impl! { [true P1 P2 P3], [true P1 P2 P3 P4], [true P1 P2 P3 P4 P5], - [false P1 P2 P3 P4 P5 P6], + [true P1 P2 P3 P4 P5 P6], + [true P1 P2 P3 P4 P5 P6 P7], + [true P1 P2 P3 P4 P5 P6 P7 P8], + [false P1 P2 P3 P4 P5 P6 P7 P8 P9], } diff --git a/src/parallel/par.rs b/src/parallel/par.rs index b59af4c8e..efff8e6b7 100644 --- a/src/parallel/par.rs +++ b/src/parallel/par.rs @@ -307,6 +307,9 @@ zip_impl! { [P1 P2 P3 P4], [P1 P2 P3 P4 P5], [P1 P2 P3 P4 P5 P6], + [P1 P2 P3 P4 P5 P6 P7], + [P1 P2 P3 P4 P5 P6 P7 P8], + [P1 P2 P3 P4 P5 P6 P7 P8 P9], } impl Parallel> diff --git a/src/zip/mod.rs b/src/zip/mod.rs index 668eac093..c481e481f 100644 --- a/src/zip/mod.rs +++ b/src/zip/mod.rs @@ -504,6 +504,9 @@ offset_impl! { [A B C D][ a b c d], [A B C D E][ a b c d e], [A B C D E F][ a b c d e f], + [A B C D E F G][ a b c d e f g], + [A B C D E F G H][ a b c d e f g h], + [A B C D E F G H I][ a b c d e f g h i], } macro_rules! zipt_impl { @@ -563,6 +566,9 @@ zipt_impl! { [A B C D][ a b c d], [A B C D E][ a b c d e], [A B C D E F][ a b c d e f], + [A B C D E F G][ a b c d e f g], + [A B C D E F G H][ a b c d e f g h], + [A B C D E F G H I][ a b c d e f g h i], } macro_rules! map_impl { @@ -914,7 +920,10 @@ map_impl! { [true P1 P2 P3], [true P1 P2 P3 P4], [true P1 P2 P3 P4 P5], - [false P1 P2 P3 P4 P5 P6], + [true P1 P2 P3 P4 P5 P6], + [true P1 P2 P3 P4 P5 P6 P7], + [true P1 P2 P3 P4 P5 P6 P7 P8], + [false P1 P2 P3 P4 P5 P6 P7 P8 P9], } /// Value controlling the execution of `.fold_while` on `Zip`. diff --git a/tests/azip.rs b/tests/azip.rs index 9d8bebab7..c7ec15399 100644 --- a/tests/azip.rs +++ b/tests/azip.rs @@ -483,3 +483,22 @@ fn test_zip_all_empty_array() assert!(Zip::from(&a).and(&b).all(|&_x, &_y| true)); assert!(Zip::from(&a).and(&b).all(|&_x, &_y| false)); } + +#[test] +fn test_azip9() +{ + let mut a = Array::::zeros(62); + let b = Array::from_shape_fn(a.dim(), |j| j as i32); + let c = Array::from_shape_fn(a.dim(), |j| (j * 2) as i32); + let d = Array::from_shape_fn(a.dim(), |j| (j * 4) as i32); + let e = Array::from_shape_fn(a.dim(), |j| (j * 8) as i32); + let f = Array::from_shape_fn(a.dim(), |j| (j * 16) as i32); + let g = Array::from_shape_fn(a.dim(), |j| (j * 32) as i32); + let h = Array::from_shape_fn(a.dim(), |j| (j * 64) as i32); + let i = Array::from_shape_fn(a.dim(), |j| (j * 128) as i32); + azip!((a in &mut a, &b in &b, &c in &c, &d in &d, &e in &e, &f in &f, &g in &g, &h in &h, &i in &i){ + *a = b + c + d + e + f + g + h + i; + }); + let x = Array::from_shape_fn(a.dim(), |j| (j * 255) as i32); + assert_equal(cloned(&a), x); +} diff --git a/tests/par_azip.rs b/tests/par_azip.rs index 418c21ef8..cbe2edc7e 100644 --- a/tests/par_azip.rs +++ b/tests/par_azip.rs @@ -71,3 +71,22 @@ fn test_indices_1() }); assert_eq!(count.load(Ordering::SeqCst), a1.len()); } + +#[test] +fn test_par_azip9() +{ + let mut a = Array::::zeros(62); + let b = Array::from_shape_fn(a.dim(), |j| j as i32); + let c = Array::from_shape_fn(a.dim(), |j| (j * 2) as i32); + let d = Array::from_shape_fn(a.dim(), |j| (j * 4) as i32); + let e = Array::from_shape_fn(a.dim(), |j| (j * 8) as i32); + let f = Array::from_shape_fn(a.dim(), |j| (j * 16) as i32); + let g = Array::from_shape_fn(a.dim(), |j| (j * 32) as i32); + let h = Array::from_shape_fn(a.dim(), |j| (j * 64) as i32); + let i = Array::from_shape_fn(a.dim(), |j| (j * 128) as i32); + par_azip!((a in &mut a, &b in &b, &c in &c, &d in &d, &e in &e, &f in &f, &g in &g, &h in &h, &i in &i){ + *a = b + c + d + e + f + g + h + i; + }); + let x = Array::from_shape_fn(a.dim(), |j| (j * 255) as i32); + assert_equal(cloned(&a), x); +}