Mercurial > hg > octave-nkf
changeset 5227:6c4677ba0784
[project @ 2005-03-18 04:04:04 by jwe]
author | jwe |
---|---|
date | Fri, 18 Mar 2005 04:04:04 +0000 |
parents | 316ddaa7ae5b |
children | 189fe4f85c77 |
files | test/octave.test/linalg/expm-1.m test/octave.test/linalg/expm-2.m test/octave.test/linalg/expm-3.m test/octave.test/linalg/expm-4.m test/octave.test/linalg/expm-5.m test/octave.test/linalg/linalg.exp |
diffstat | 6 files changed, 40 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/expm-1.m @@ -0,0 +1,4 @@ +arg = [-49, 24; -64, 31]; +result = [-0.735758758144742, 0.551819099658089; + -1.471517599088239, 1.103638240715556]; +all (all (abs (expm (arg) - result) < 8*eps))
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/expm-2.m @@ -0,0 +1,4 @@ +arg = [1, 1; 0, 1]; +result = [2.718281828459045, 2.718281828459045; + 0.000000000000000, 2.718281828459045]; +all (all (abs (expm (arg) - result) < 2*eps))
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/expm-3.m @@ -0,0 +1,6 @@ +arg = diag ([6, 6, 6], 1); +result = [1, 6, 18, 36; + 0, 1, 6, 18; + 0, 0, 1, 6; + 0, 0, 0, 1]; +all (all (expm (arg) == result))
new file mode 100644 --- /dev/null +++ b/test/octave.test/linalg/expm-5.m @@ -0,0 +1,1 @@ +expm (1, 2)
--- a/test/octave.test/linalg/linalg.exp +++ b/test/octave.test/linalg/linalg.exp @@ -7,7 +7,6 @@ # orth # pinv # rank -# expm # logm # sqrtm # kron @@ -66,6 +65,30 @@ set prog_output "^error:.*" do_test eig-5.m +set test expm-1 +set prog_output "^ans = 1" +do_test expm-1 + +set test expm-2 +set prog_output "^ans = 1" +do_test expm-2 + +set test expm-3 +set prog_output "^ans = 1" +do_test expm-3 + +set test expm-4 +set prog_output "^\n... expm:.*" +do_test expm-4 + +set test expm-5 +set prog_output "^\n... expm:.*" +do_test expm-5 + +set test expm-6 +set prog_output "^error:.*" +do_test expm-6 + set test inv-1 set prog_output "^ans = 1" do_test inv-1.m