From 4db9b0d4d646dc903c2c4a94b27112866484c623 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 7 Sep 2024 11:31:07 +0900 Subject: 14-Matrix-Square: testcase 1 - double 4x4 --- problems/14-Matrix-Square/answer_1_double_4x4.vsm | 5 +++++ problems/14-Matrix-Square/testcase_1_double_4x4.rb | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 problems/14-Matrix-Square/testcase_1_double_4x4.rb (limited to 'problems/14-Matrix-Square') diff --git a/problems/14-Matrix-Square/answer_1_double_4x4.vsm b/problems/14-Matrix-Square/answer_1_double_4x4.vsm index e69de29..94a3569 100644 --- a/problems/14-Matrix-Square/answer_1_double_4x4.vsm +++ b/problems/14-Matrix-Square/answer_1_double_4x4.vsm @@ -0,0 +1,5 @@ +dmwrite $lm0v $ly0 +dmread $ly0 $nowrite; dbfn $lm0v $nowrite +dbfn $mreadf $lr0v; dmwrite $aluf $lx0 +dmmulu $lx $aluf $nowrite +dmfmad $lx $lr0v $mauf $ln0v diff --git a/problems/14-Matrix-Square/testcase_1_double_4x4.rb b/problems/14-Matrix-Square/testcase_1_double_4x4.rb new file mode 100644 index 0000000..106e48a --- /dev/null +++ b/problems/14-Matrix-Square/testcase_1_double_4x4.rb @@ -0,0 +1,10 @@ +require 'matrix' + +a = Matrix[ + [3.0, 9.0, 7.0, 5.0], + [1.0, 1.0, 0.0, 8.0], + [6.0, 7.0, 0.0, 9.0], + [8.0, 2.0, 1.0, 1.0], +] + +puts a**2 -- cgit v1.2.3-70-g09d2