Mercurial > octave
diff test/test_diag_perm.m @ 14131:c3309e1ec50d stable
test: Use Octave coding and spacing conventions for fixed test scripts
* build_bc_overload_tests.sh, build_bc_overloads_expected.m,
build_sparse_tests.sh, test_args.m, test_contin.m, test_diag_perm.m,
test_error.m, test_eval-catch.m, test_for.m, test_func.m, test_global.m,
test_if.m, test_index.m, test_io.m, test_logical_index.m, test_null_assign.m,
test_parser.m, test_prefer.m, test_range.m, test_recursion.m, test_return.m,
test_slice.m, test_struct.m, test_switch.m, test_system.m, test_transpose.m,
test_try.m, test_unwind.m, test_while.m:
Use Octave coding and spacing conventions for fixed test scripts.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 01 Jan 2012 20:04:52 -0800 |
parents | 1a93988610a3 |
children | 72c96de7a403 |
line wrap: on
line diff
--- a/test/test_diag_perm.m Sun Jan 01 19:17:02 2012 -0500 +++ b/test/test_diag_perm.m Sun Jan 01 20:04:52 2012 -0800 @@ -219,7 +219,7 @@ %! A = sprand (n, n, .5); %! scalefact = rand (n-2, 1); %! Dr = diag (scalefact, n, n-2); -%! assert (full (Dr \ A), Dr \ full(A)) +%! assert (full (Dr \ A), Dr \ full(A)); ## sparse inverse column scaling with a zero factor %!test @@ -229,7 +229,7 @@ %! Dc = diag (scalefact); %! scalefact(n-1) = Inf; %! Dc(n-1, n-1) = 0; -%! assert (full (A / Dc), full(A) / Dc) +%! assert (full (A / Dc), full(A) / Dc); ## short sparse inverse column scaling %!test @@ -237,29 +237,29 @@ %! A = sprand (n, n, .5); %! scalefact = rand (1, n-2) + I () * rand(1, n-2); %! Dc = diag (scalefact, n-2, n); -%! assert (full (A / Dc), full(A) / Dc) +%! assert (full (A / Dc), full(A) / Dc); ## adding sparse and diagonal stays sparse %!test %! n = 9; %! A = sprand (n, n, .5); %! D = 2 * eye (n); -%! assert (typeinfo (A + D), "sparse matrix") -%! assert (typeinfo (A - D), "sparse matrix") +%! assert (typeinfo (A + D), "sparse matrix"); +%! assert (typeinfo (A - D), "sparse matrix"); %! D = D * I () + D; -%! assert (typeinfo (A - D), "sparse complex matrix") +%! assert (typeinfo (A - D), "sparse complex matrix"); %! A = A * I () + A; -%! assert (typeinfo (D - A), "sparse complex matrix") +%! assert (typeinfo (D - A), "sparse complex matrix"); ## adding sparse and diagonal stays sparse %!test %! n = 9; %! A = sprand (n, n, .5); %! D = 2 * eye (n); -%! assert (full (A + D), full (A) + D) -%! assert (full (A - D), full (A) - D) +%! assert (full (A + D), full (A) + D); +%! assert (full (A - D), full (A) - D); %! D = D * I () + D; -%! assert (full (D + A), D + full (A)) +%! assert (full (D + A), D + full (A)); %! A = A * I () + A; %! A(6, 4) = nan (); -%! assert (full (D - A), D - full (A)) +%! assert (full (D - A), D - full (A));