File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
Expand file tree Collapse file tree 2 files changed +31
-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_space (ZZ, 2 , 3 )
25+ m1 = M (ZZ[1 2 3 ; 3 4 5 ])
26+ m2 = swap_rows (m1, 1 , 2 )
27+ m3 = swap_cols (m1, 3 , 1 )
28+ @test m2 == M (ZZ[3 4 5 ; 1 2 3 ])
29+ @test m3 == M (ZZ[3 2 1 ; 5 4 3 ])
30+ end
You can’t perform that action at this time.
0 commit comments