Skip to content

Commit

Permalink
test(matrices): add forsythe tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AnzhiZhang committed Aug 8, 2024
1 parent 9d7052d commit e335fa6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/matrices/forsythe.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# constructors
@test allequal([
Forsythe(5),
Forsythe{Float64}(5),
Forsythe(5, sqrt(eps(Float64)), zero(Float64)),
Forsythe{Float64}(5, sqrt(eps(Float64)), zero(Float64)),
])

# linear algebra functions
test_linearalgrbra_functions(Forsythe.(1:5))

# eltype
@test test_matrix_elements(Forsythe{Float32}(5))

# content
@test Forsythe(5) [0.0 1.0 0.0 0.0 0.0; 0.0 0.0 1.0 0.0 0.0; 0.0 0.0 0.0 1.0 0.0; 0.0 0.0 0.0 0.0 1.0; 1.4901161193847656e-8 0.0 0.0 0.0 0.0]
@test Forsythe(5, 2, 3) [3.0 1.0 0.0 0.0 0.0; 0.0 3.0 1.0 0.0 0.0; 0.0 0.0 3.0 1.0 0.0; 0.0 0.0 0.0 3.0 1.0; 2.0 0.0 0.0 0.0 3.0]
@test Forsythe(5, 3, -5) [-5.0 1.0 0.0 0.0 0.0; 0.0 -5.0 1.0 0.0 0.0; 0.0 0.0 -5.0 1.0 0.0; 0.0 0.0 0.0 -5.0 1.0; 3.0 0.0 0.0 0.0 -5.0]

0 comments on commit e335fa6

Please sign in to comment.