@@ -17,7 +17,7 @@ const Y: usize = 16;
1717
1818#[ bench]
1919fn map_regular ( bench : & mut Bencher ) {
20- let a = Array :: linspace ( 0. , 127. , N ) . into_shape ( ( X , Y ) ) . unwrap ( ) ;
20+ let a = Array :: linspace ( 0. , 127. , N ) . into_shape_with_order ( ( X , Y ) ) . unwrap ( ) ;
2121 bench. iter ( || a. map ( |& x| 2. * x) ) ;
2222}
2323
@@ -28,7 +28,7 @@ pub fn double_array(mut a: ArrayViewMut2<'_, f64>) {
2828#[ bench]
2929fn map_stride_double_f64 ( bench : & mut Bencher ) {
3030 let mut a = Array :: linspace ( 0. , 127. , N * 2 )
31- . into_shape ( [ X , Y * 2 ] )
31+ . into_shape_with_order ( [ X , Y * 2 ] )
3232 . unwrap ( ) ;
3333 let mut av = a. slice_mut ( s ! [ .., ..; 2 ] ) ;
3434 bench. iter ( || {
@@ -39,7 +39,7 @@ fn map_stride_double_f64(bench: &mut Bencher) {
3939#[ bench]
4040fn map_stride_f64 ( bench : & mut Bencher ) {
4141 let a = Array :: linspace ( 0. , 127. , N * 2 )
42- . into_shape ( [ X , Y * 2 ] )
42+ . into_shape_with_order ( [ X , Y * 2 ] )
4343 . unwrap ( ) ;
4444 let av = a. slice ( s ! [ .., ..; 2 ] ) ;
4545 bench. iter ( || av. map ( |& x| 2. * x) ) ;
@@ -48,7 +48,7 @@ fn map_stride_f64(bench: &mut Bencher) {
4848#[ bench]
4949fn map_stride_u32 ( bench : & mut Bencher ) {
5050 let a = Array :: linspace ( 0. , 127. , N * 2 )
51- . into_shape ( [ X , Y * 2 ] )
51+ . into_shape_with_order ( [ X , Y * 2 ] )
5252 . unwrap ( ) ;
5353 let b = a. mapv ( |x| x as u32 ) ;
5454 let av = b. slice ( s ! [ .., ..; 2 ] ) ;
@@ -58,7 +58,7 @@ fn map_stride_u32(bench: &mut Bencher) {
5858#[ bench]
5959fn fold_axis ( bench : & mut Bencher ) {
6060 let a = Array :: linspace ( 0. , 127. , N * 2 )
61- . into_shape ( [ X , Y * 2 ] )
61+ . into_shape_with_order ( [ X , Y * 2 ] )
6262 . unwrap ( ) ;
6363 bench. iter ( || a. fold_axis ( Axis ( 0 ) , 0. , |& acc, & elt| acc + elt) ) ;
6464}
@@ -69,15 +69,15 @@ const MASZ: usize = MA * MA;
6969#[ bench]
7070fn map_axis_0 ( bench : & mut Bencher ) {
7171 let a = Array :: from_iter ( 0 ..MASZ as i32 )
72- . into_shape ( [ MA , MA ] )
72+ . into_shape_with_order ( [ MA , MA ] )
7373 . unwrap ( ) ;
7474 bench. iter ( || a. map_axis ( Axis ( 0 ) , black_box) ) ;
7575}
7676
7777#[ bench]
7878fn map_axis_1 ( bench : & mut Bencher ) {
7979 let a = Array :: from_iter ( 0 ..MASZ as i32 )
80- . into_shape ( [ MA , MA ] )
80+ . into_shape_with_order ( [ MA , MA ] )
8181 . unwrap ( ) ;
8282 bench. iter ( || a. map_axis ( Axis ( 1 ) , black_box) ) ;
8383}
0 commit comments