Mercurial > hg > octave-lojdl
changeset 2730:b7758860ea6b
[project @ 1997-02-24 23:33:06 by jwe]
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/chol-1.m @@ -0,0 +1,2 @@ +rt2 = sqrt (2); +all (all (abs (chol ([2, 1; 1, 1]) - [rt2, 1/rt2; 0, 1/rt2]) < sqrt (eps)))
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/chol-2.m @@ -0,0 +1,1 @@ +chol ([1, 2; 3, 4])
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/chol-3.m @@ -0,0 +1,1 @@ +chol ([1, 2; 3, 4; 5, 6])
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/chol-5.m @@ -0,0 +1,1 @@ +chol (1, 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/hess-1.m @@ -0,0 +1,3 @@ +a = [1, 2, 3; 5, 4, 6; 8, 7, 9]; +[p, h] = hess (a); +size (p) == [3, 3] && size (h) == [3, 3] && abs (a - p * h * p') < sqrt (eps)
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/hess-3.m @@ -0,0 +1,1 @@ +hess ([1, 2; 3, 4], 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/hess-4.m @@ -0,0 +1,1 @@ +hess ([1, 2; 3, 4; 5, 6])
--- a/test/octave.test/linalg/linalg.exp +++ b/test/octave.test/linalg/linalg.exp @@ -1,5 +1,20 @@ # balance -# cond + +set test cond-1 +set prog_output "ans = 1" +do_test cond-1.m + +set test cond-2 +set prog_output "ans = 1" +do_test cond-2.m + +set test cond-3 +set prog_output "usage:.*" +do_test cond-3.m + +set test cond-4 +set prog_output "usage:.*" +do_test cond-4.m set test det-1 set prog_output "ans = 1" @@ -60,9 +75,62 @@ # orth # pinv # rank -# trace -# chol -# hess + +set test trace-1 +set prog_output "ans = 1" +do_test trace-1.m + +set test trace-2 +set prog_output "ans = 1" +do_test trace-2.m + +set test trace-3 +set prog_output "ans = 1" +do_test trace-3.m + +set test trace-4 +set prog_output "usage:.*" +do_test trace-4.m + +set test trace-5 +set prog_output "usage:.*" +do_test trace-5.m + +set test chol-1 +set prog_output "ans = 1" +do_test chol-1.m + +set test chol-2 +set prog_output "error:.*" +do_test chol-2.m + +set test chol-3 +set prog_output "error:.*" +do_test chol-3.m + +set test chol-4 +set prog_output "\n... chol:.*" +do_test chol-4.m + +set test chol-5 +set prog_output "\n... chol:.*" +do_test chol-5.m + +set test hess-1 +set prog_output "ans = 1" +do_test hess-1.m + +set test hess-2 +set prog_output "\n... hess:.*" +do_test hess-2.m + +set test hess-3 +set prog_output "\n... hess:.*" +do_test hess-3.m + +set test hess-4 +set prog_output "error:.*" +do_test hess-4.m set test lu-1 set prog_output "ans = 1" @@ -112,7 +180,21 @@ set prog_output "\n... qr:.*" do_test qr-6.m -# schur +set test schur-1 +set prog_output "ans = 1" +do_test schur-1.m + +set test schur-2 +set prog_output "\n... schur:.*" +do_test schur-2.m + +set test schur-3 +set prog_output "error:.*" +do_test schur-3.m + +set test schur-4 +set prog_output "error:.*" +do_test schur-4.m set test svd-1 set prog_output "ans = 1" @@ -156,4 +238,19 @@ # kron # qzhess # qzval -# syl + +set test syl-1 +set prog_output "ans = 1" +do_test syl-1.m + +set test syl-2 +set prog_output "\n... syl:.*" +do_test syl-2.m + +set test syl-3 +set prog_output "\n... syl:.*" +do_test syl-3.m + +set test syl-4 +set prog_output "error:.*" +do_test syl-4.m
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/schur-1.m @@ -0,0 +1,3 @@ +a = [1, 2, 3; 4, 5, 9; 7, 8, 6]; +[u, s] = schur (a); +size (u) == [3, 3] && size (s) == [3, 3] && abs (s - u' * a * u) < sqrt (eps)
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/schur-2.m @@ -0,0 +1,1 @@ +schur ()
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/schur-3.m @@ -0,0 +1,1 @@ +schur ([1, 2; 3, 4], 2)
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/schur-4.m @@ -0,0 +1,1 @@ +schur ([1, 2, 3; 4, 5, 6])
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/syl-1.m @@ -0,0 +1,2 @@ +x = syl ([1, 2; 3, 4], [5, 6; 7, 8], [9, 10; 11, 12]); +all (all (abs (x - [-1/2, -2/3; -2/3, -1/2]) < sqrt (eps)))
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/syl-3.m @@ -0,0 +1,1 @@ +syl (1, 2, 3, 4)
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/syl-4.m @@ -0,0 +1,1 @@ +syl ([1, 2; 3, 4], [1, 2, 3; 4, 5, 6], [4, 3])
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/trace-1.m @@ -0,0 +1,1 @@ +trace ([1, 2; 3, 4]) == 5
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/trace-2.m @@ -0,0 +1,1 @@ +trace ([1, 2; 3, 4; 5, 6]) == 5
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/trace-3.m @@ -0,0 +1,1 @@ +trace ([1, 3, 5; 2, 4, 6]) == 5