File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 11include (" julia/Integers-test.jl" )
2+ include (" julia/Matrix-test.jl" )
23include (" broadcasting-test.jl" )
34
45# artificially low cutoffs for testing purposes
Original file line number Diff line number Diff line change 1+ @testset " Julia.Matrix.manipulation" begin
2+ r, c = 1 , 2
3+ A = zero_matrix (Int, r, c)
4+ A[1 , :] = [10 , - 2 ]
5+ B = Int[10 - 2 ]
6+
7+ @test A == B
8+ @test number_of_rows (A) == r
9+ @test number_of_columns (A) == c
10+ end
11+
12+ @testset " Julia.Matrix.array_creation" begin
13+ M = matrix_ring (ZZ, 2 )
14+ m1 = M (ZZ[1 2 ; 3 4 ])
15+ m2 = M (ZZ[1 0 ; 0 1 ])
16+ arr = Array (M, 2 )
17+ arr[1 ] = deepcopy (m1)
18+ arr[2 ] = deepcopy (m2)
19+ @test arr[1 ] == m1
20+ @test arr[2 ] == m2
21+ end
22+
23+ @testset " Julia.Matrix.permutations" begin
24+ M = matrix_ring (ZZ, 2 )
25+ m0 = M ([1 2 ; 3 4 ])
26+ m1 = M ([2 3 ; 4 5 ])
27+ m2 = M ([3 4 ; 5 6 ])
28+ m3 = M ([4 5 ; 6 7 ])
29+ m = elem_type (M)[m0 m1; m2 m3]
30+ Rm = elem_type (M)[m2 m3; m0 m1]
31+ Cm = elem_type (M)[m1 m0; m3 m2]
32+ rm = swap_rows (m, 2 , 1 )
33+ cm = swap_cols (m, 1 , 2 )
34+ @test rm == Rm
35+ @test cm == Cm
36+ end
You can’t perform that action at this time.
0 commit comments