File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 1
1
include (" julia/Integers-test.jl" )
2
+ include (" julia/Matrix-test.jl" )
2
3
include (" broadcasting-test.jl" )
3
4
4
5
# 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 , 2 )
25
+ m0 = ZZ[1 2 ; 3 4 ]
26
+ m1 = ZZ[2 3 ; 4 5 ]
27
+ m2 = ZZ[3 4 ; 5 6 ]
28
+ m3 = ZZ[4 5 ; 6 7 ]
29
+ m = [m0 m1; m2 m3]
30
+ rm = swap_rows (m, 2 , 1 )
31
+ cm = swap_columns (m, 1 , 2 )
32
+ @test rm == [m2 m3; m0 m1]
33
+ @test cm == [m1 m0; m3 m2]
34
+ end
You can’t perform that action at this time.
0 commit comments