]> gitweb.michael.orlitzky.com - octave.git/commitdiff
Add a test for the poisson_matrix function.
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 15 Oct 2012 19:07:18 +0000 (15:07 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 15 Oct 2012 19:07:18 +0000 (15:07 -0400)
run-tests.m

index 1f6d561f00904f5e9852d224d7d117695d5125bc..1682d18d20acbdf7938ba5d81c68780bd2df3351 100755 (executable)
@@ -42,3 +42,12 @@ unit_test_equals("2 is not odd", ...
 unit_test_equals("2 is even", ...
                 true, ...
                 even(2));
 unit_test_equals("2 is even", ...
                 true, ...
                 even(2));
+
+expected_A = [1, 0, 0, 0, 0; ...
+              16, -32,  16,  0,  0; ...
+             0,   16, -32,  16, 0; ...
+             0,   0,   16, -32, 16; ...
+             0,   0,   0,   0,  1];
+unit_test_equals("Homework #1 problem #1 Poisson matrix is correct", ...
+                true, ...
+                expected_A == poisson_matrix(4, 0, 1));