From bf1e6bff2a97879fb9133bce47e7924a59ccff73 Mon Sep 17 00:00:00 2001 From: Andy Zhang <37402126+AnzhiZhang@users.noreply.github.com> Date: Thu, 8 Aug 2024 18:00:22 +0100 Subject: [PATCH] test(matrices): add frank tests --- test/matrices/frank.jl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/matrices/frank.jl diff --git a/test/matrices/frank.jl b/test/matrices/frank.jl new file mode 100644 index 0000000..5ee6041 --- /dev/null +++ b/test/matrices/frank.jl @@ -0,0 +1,17 @@ +# constructors +@test allequal([ + Frank(5), + Frank(5, 0), + Frank{Int}(5), + Frank{Int}(5, 0), +]) + +# linear algebra functions +test_linearalgrbra_functions(Frank.(1:5)) + +# eltype +@test test_matrix_elements(Frank{Int32}(5)) + +# content +@test Frank(5) ≈ [5 4 3 2 1; 4 4 3 2 1; 0 3 3 2 1; 0 0 2 2 1; 0 0 0 1 1] +@test Frank(5, 1) ≈ [1 1 1 1 1; 1 2 2 2 2; 0 2 3 3 3; 0 0 3 4 4; 0 0 0 4 5]