Mercurial > hg > octave-nkf
changeset 2739:1aeffa048808
[project @ 1997-02-25 08:02:47 by jwe]
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/all-1.m @@ -0,0 +1,3 @@ +x = ones (3); +x(1,1) = 0; +all (all (rand (3) + 1) == [1, 1, 1]) == 1 && all (all (x) == [0, 1, 1]) == 1
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/all-3.m @@ -0,0 +1,1 @@ +all (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/any-1.m @@ -0,0 +1,3 @@ +x = zeros (3); +x(3,3) = 1; +all (any (x) == [0, 0, 1]) == 1 && all (any (ones (3)) == [1, 1, 1]) == 1
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/any-3.m @@ -0,0 +1,1 @@ +any (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/eye-1.m @@ -0,0 +1,4 @@ +i33 = [1, 0, 0; 0, 1, 0; 0, 0, 1]; +i23 = [1, 0, 0; 0, 1, 0]; +(eye (3) == i33 && eye (size (i33)) == i33 && eye (3, 3) == i33 + && eye (2, 3) == i23 && eye (3, 2) == i23')
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/eye-2.m @@ -0,0 +1,1 @@ +eye (1, 2, 3)
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/fliplr-1.m @@ -0,0 +1,3 @@ +(fliplr ([1, 2; 3, 4]) == [2, 1; 4, 3] + && fliplr ([1, 2; 3, 4; 5, 6]) == [2, 1; 4, 3; 6, 5] + && fliplr ([1, 2, 3; 4, 5, 6]) == [3, 2, 1; 6, 5, 4])
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/fliplr-2.m @@ -0,0 +1,2 @@ +fliplr () +
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/fliplr-3.m @@ -0,0 +1,1 @@ +fliplr (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/flipud-1.m @@ -0,0 +1,3 @@ +(flipud ([1, 2; 3, 4]) == [3, 4; 1, 2] + && flipud ([1, 2; 3, 4; 5, 6]) == [5, 6; 3, 4; 1, 2] + && flipud ([1, 2, 3; 4, 5, 6]) == [4, 5, 6; 1, 2, 3])
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/flipud-2.m @@ -0,0 +1,1 @@ +flipud ()
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/flipud-3.m @@ -0,0 +1,1 @@ +flipud (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/hilb-1.m @@ -0,0 +1,2 @@ +(hilb (2) == [1, 1/2; 1/2, 1/3] + && hilb (3) == [1, 1/2, 1/3; 1/2, 1/3, 1/4; 1/3, 1/4, 1/5])
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/hilb-3.m @@ -0,0 +1,1 @@ +hilb (1, 2)
--- a/test/octave.test/matrix/matrix.exp +++ b/test/octave.test/matrix/matrix.exp @@ -1,13 +1,66 @@ -# all -# any +set test all-1 +set prog_output "ans = 1" +do_test all-1.m + +set test all-2 +set prog_output "\n... all:.*" +do_test all-2.m + +set test all-3 +set prog_output "\n... all:.*" +do_test all-3.m + +set test any-1 +set prog_output "ans = 1" +do_test any-1.m + +set test any-2 +set prog_output "\n... any:.*" +do_test any-2.m + +set test any-3 +set prog_output "\n... any:.*" +do_test any-3.m + # diff -# isinf -# isnan -# finite # find -# fliplr -# flipud -# rot90 + +set test fliplr-1 +set prog_output "ans = 1" +do_test fliplr-1.m + +set test fliplr-2 +set prog_output "usage:.*" +do_test fliplr-2.m + +set test fliplr-3 +set prog_output "usage:.*" +do_test fliplr-3.m + +set test flipud-1 +set prog_output "ans = 1" +do_test flipud-1.m + +set test flipud-2 +set prog_output "usage:.*" +do_test flipud-2.m + +set test flipud-3 +set prog_output "usage:.*" +do_test flipud-3.m + +set test rot90-1 +set prog_output "ans = 1" +do_test rot90-1.m + +set test rot90-2 +set prog_output "usage:.*" +do_test rot90-2.m + +set test rot90-3 +set prog_output "usage:.*" +do_test rot90-3.m + # reshape # shift # sort @@ -15,9 +68,31 @@ # triu # vec # vech -# eye -# ones -# zeros + +set test eye-1 +set prog_output "ans = 1" +do_test eye-1.m + +set test eye-2 +set prog_output "\n... eye:.*" +do_test eye-2.m + +set test ones-1 +set prog_output "ans = 1" +do_test ones-1.m + +set test ones-2 +set prog_output "\n... ones:.*" +do_test ones-2.m + +set test zeros-1 +set prog_output "ans = 1" +do_test zeros-1.m + +set test zeros-2 +set prog_output "\n... zeros:.*" +do_test zeros-2.m + # rand # randn # diag @@ -25,7 +100,19 @@ # logspace # hadamard # hankel -# hilb + +set test hilb-1 +set prog_output "ans = 1" +do_test hilb-1.m + +set test hilb-2 +set prog_output "usage:.*" +do_test hilb-2.m + +set test hilb-3 +set prog_output "usage:.*" +do_test hilb-3.m + # invhilb # toeplitz # vander
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/ones-1.m @@ -0,0 +1,4 @@ +x33 = [1, 1, 1; 1, 1, 1; 1, 1, 1]; +x23 = [1, 1, 1; 1, 1, 1]; +(ones (3) == x33 && ones (size (x33)) == x33 && ones (3, 3) == x33 + && ones (2, 3) == x23 && ones (3, 2) == x23')
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/ones-2.m @@ -0,0 +1,1 @@ +ones (1, 2, 3)
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/rot90-1.m @@ -0,0 +1,11 @@ +x1 = [1, 2; + 3, 4]; +x2 = [2, 4; + 1, 3]; +x3 = [4, 3; + 2, 1]; +x4 = [3, 1; + 4, 2]; + +(rot90 (x1)== x2 && rot90 (x1, 2) == x3 && rot90 (x1, 3) == x4 + && rot90 (x1, 4) == x1 && rot90 (x1, 5) == x2 && rot90 (x1, -1) == x4)
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/rot90-2.m @@ -0,0 +1,1 @@ +rot90 ()
new file mode 100644 --- /dev/null +++ b/test/octave.test/matrix/rot90-3.m @@ -0,0 +1,1 @@ +rot90 (1, 2, 3)