@@ -68,17 +68,16 @@ fn arrayviewmut_shrink_lifetime<'a, 'b: 'a>(view: ArrayViewMut1<'b, f64>) -> Arr
68
68
}
69
69
70
70
#[ test]
71
- #[ cfg( feature = "std" ) ]
72
71
fn test_mat_mul ( )
73
72
{
74
73
// smoke test, a big matrix multiplication of uneven size
75
74
let ( n, m) = ( 45 , 33 ) ;
76
- let a = ArcArray :: linspace ( 0. , ( ( n * m) - 1 ) as f32 , n as usize * m as usize )
75
+ let a = Array :: from_iter ( 0 .. ( n * m) )
77
76
. into_shape_with_order ( ( n, m) )
78
77
. unwrap ( ) ;
79
- let b = ArcArray :: eye ( m) ;
78
+ let b = Array :: eye ( m) ;
80
79
assert_eq ! ( a. dot( & b) , a) ;
81
- let c = ArcArray :: eye ( n) ;
80
+ let c = Array :: eye ( n) ;
82
81
assert_eq ! ( c. dot( & a) , a) ;
83
82
}
84
83
@@ -692,32 +691,30 @@ fn test_cow_shrink()
692
691
}
693
692
694
693
#[ test]
695
- #[ cfg( feature = "std" ) ]
696
694
fn test_sub ( )
697
695
{
698
- let mat = ArcArray :: linspace ( 0. , 15. , 16 )
696
+ let mat = Array :: from_iter ( 0 .. 16 )
699
697
. into_shape_with_order ( ( 2 , 4 , 2 ) )
700
698
. unwrap ( ) ;
701
699
let s1 = mat. index_axis ( Axis ( 0 ) , 0 ) ;
702
700
let s2 = mat. index_axis ( Axis ( 0 ) , 1 ) ;
703
701
assert_eq ! ( s1. shape( ) , & [ 4 , 2 ] ) ;
704
702
assert_eq ! ( s2. shape( ) , & [ 4 , 2 ] ) ;
705
- let n = ArcArray :: linspace ( 8. , 15. , 8 )
703
+ let n = Array :: from_iter ( 8 .. 16 )
706
704
. into_shape_with_order ( ( 4 , 2 ) )
707
705
. unwrap ( ) ;
708
706
assert_eq ! ( n, s2) ;
709
- let m = ArcArray :: from ( vec ! [ 2. , 3. , 10. , 11. ] )
707
+ let m = Array :: from ( vec ! [ 2 , 3 , 10 , 11 ] )
710
708
. into_shape_with_order ( ( 2 , 2 ) )
711
709
. unwrap ( ) ;
712
710
assert_eq ! ( m, mat. index_axis( Axis ( 1 ) , 1 ) ) ;
713
711
}
714
712
715
713
#[ should_panic]
716
714
#[ test]
717
- #[ cfg( feature = "std" ) ]
718
715
fn test_sub_oob_1 ( )
719
716
{
720
- let mat = ArcArray :: linspace ( 0. , 15. , 16 )
717
+ let mat = Array :: from_iter ( 0 .. 16 )
721
718
. into_shape_with_order ( ( 2 , 4 , 2 ) )
722
719
. unwrap ( ) ;
723
720
mat. index_axis ( Axis ( 0 ) , 2 ) ;
@@ -1845,7 +1842,6 @@ fn scalar_ops()
1845
1842
}
1846
1843
1847
1844
#[ test]
1848
- #[ cfg( feature = "std" ) ]
1849
1845
fn split_at ( )
1850
1846
{
1851
1847
let mut a = arr2 ( & [ [ 1. , 2. ] , [ 3. , 4. ] ] ) ;
@@ -1864,7 +1860,7 @@ fn split_at()
1864
1860
}
1865
1861
assert_eq ! ( a, arr2( & [ [ 1. , 5. ] , [ 8. , 4. ] ] ) ) ;
1866
1862
1867
- let b = ArcArray :: linspace ( 0. , 59. , 60 )
1863
+ let b = ArcArray :: from_iter ( 0 .. 60 )
1868
1864
. into_shape_with_order ( ( 3 , 4 , 5 ) )
1869
1865
. unwrap ( ) ;
1870
1866
@@ -1874,9 +1870,9 @@ fn split_at()
1874
1870
assert_eq ! (
1875
1871
left,
1876
1872
arr3( & [
1877
- [ [ 0. , 1. ] , [ 5. , 6. ] , [ 10. , 11. ] , [ 15. , 16. ] ] ,
1878
- [ [ 20. , 21. ] , [ 25. , 26. ] , [ 30. , 31. ] , [ 35. , 36. ] ] ,
1879
- [ [ 40. , 41. ] , [ 45. , 46. ] , [ 50. , 51. ] , [ 55. , 56. ] ]
1873
+ [ [ 0 , 1 ] , [ 5 , 6 ] , [ 10 , 11 ] , [ 15 , 16 ] ] ,
1874
+ [ [ 20 , 21 ] , [ 25 , 26 ] , [ 30 , 31 ] , [ 35 , 36 ] ] ,
1875
+ [ [ 40 , 41 ] , [ 45 , 46 ] , [ 50 , 51 ] , [ 55 , 56 ] ]
1880
1876
] )
1881
1877
) ;
1882
1878
0 commit comments