Skip to content

Commit

Permalink
test(matrices): add chow tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AnzhiZhang committed Aug 8, 2024
1 parent 84cc105 commit 2a862a4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/matrices/chow.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# constructors
@test allequal([
Chow(5),
Chow(5, 1, 0),
Chow{Int}(5),
Chow{Int}(5, 1, 0),
])

# linear algebra functions
test_linearalgrbra_functions([Chow.(1:5); Chow.(1:5, 2, 3)])

# eltype
@test test_matrix_elements(Chow{Int32}(5))

# content
@test Chow(5) [1 1 0 0 0; 1 1 1 0 0; 1 1 1 1 0; 1 1 1 1 1; 1 1 1 1 1]
@test Chow(5, 2, 0) [2 1 0 0 0; 4 2 1 0 0; 8 4 2 1 0; 16 8 4 2 1; 32 16 8 4 2]
@test Chow(5, 1, 2) [3 1 0 0 0; 1 3 1 0 0; 1 1 3 1 0; 1 1 1 3 1; 1 1 1 1 3]
@test Chow(5, 3, 2) [5 1 0 0 0; 9 5 1 0 0; 27 9 5 1 0; 81 27 9 5 1; 243 81 27 9 5]

0 comments on commit 2a862a4

Please sign in to comment.