Add the advection_matrix() function and a test for it.
[octave.git] / tests / advection_matrix_tests.m
1 ## Try a 4x4 advection matrix. See the docstring in advection_matrix.m
2 ## for an explanation of the expected result.
3
4 expected = (1/2) * [ 0, 1, 0, -1; ...
5 -1, 0, 1, 0; ...
6 0, -1, 0, 1; ...
7 1, 0, -1, 0 ];
8
9 actual = advection_matrix(4, 0, 1);
10
11 unit_test_equals("4x4 advection matrix is correct", ...
12 true, ...
13 expected == actual);