From fc5f9d03c6d8173ea4b239f53956ec2a753091cb Mon Sep 17 00:00:00 2001 From: Andy Zhang <37402126+AnzhiZhang@users.noreply.github.com> Date: Thu, 8 Aug 2024 12:13:45 +0100 Subject: [PATCH] test(matrices): add clement tests --- test/matrices/clement.jl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/matrices/clement.jl diff --git a/test/matrices/clement.jl b/test/matrices/clement.jl new file mode 100644 index 0000000..802e3e1 --- /dev/null +++ b/test/matrices/clement.jl @@ -0,0 +1,18 @@ +# constructors +@test allequal([ + Clement(5), + Clement(5, 0), + Clement{Float64}(5), + Clement{Float64}(5, 0), +]) + +# linear algebra functions +test_linearalgrbra_functions(Clement.(1:5)) + +# eltype +@test test_matrix_elements(Clement{Float32}(5)) + +# content +@test Clement(1) ≈ [0] +@test Clement(5) ≈ [0 1 0 0 0; 4 0 2 0 0; 0 3 0 3 0; 0 0 2 0 4; 0 0 0 1 0] +@test Clement(5, 1) ≈ [0.0 2.0 0.0 0.0 0.0; 2.0 0.0 2.449489742783178 0.0 0.0; 0.0 2.449489742783178 0.0 2.449489742783178 0.0; 0.0 0.0 2.449489742783178 0.0 2.0; 0.0 0.0 0.0 2.0 0.0]