Add tridiagonal() and its tests.
[octave.git] / tests / tridiagonal_tests.m
1 A = tridiagonal(0, -1, 2, -1);
2 expected = [];
3 unit_test_equals("poisson tridiagonal of size zero is correct", ...
4 expected, ...
5 A);
6
7 A = tridiagonal(1, -1, 2, -1);
8 expected = [2];
9 unit_test_equals("poisson tridiagonal of size one is correct", ...
10 expected, ...
11 A);
12
13 A = tridiagonal(2, -1, 2, -1);
14 expected = [2, -1; ...
15 -1, 2];
16 unit_test_equals("poisson tridiagonal of size two is correct", ...
17 expected, ...
18 A);
19
20 A = tridiagonal(3, -1, 2, -1);
21 expected = [2, -1, 0; ...
22 -1, 2, -1;
23 0, -1, 2];
24 unit_test_equals("poisson tridiagonal of size three is correct", ...
25 expected, ...
26 A);