# HG changeset patch # User jwe # Date 1163518402 0 # Node ID b3c425131211134d7aea27b129e4b30ed0ce2925 # Parent 4d90ee4061ef977fd97c96032d5da43d1c4d0697 [project @ 2006-11-14 15:33:22 by jwe] diff -r 4d90ee4061ef -r b3c425131211 liboctave/CMatrix.cc --- a/liboctave/CMatrix.cc Tue Nov 14 15:12:04 2006 +0000 +++ b/liboctave/CMatrix.cc Tue Nov 14 15:33:22 2006 +0000 @@ -3605,6 +3605,22 @@ return tmp * a; } +/* Simple Dot Product, Matrix-Vector and Matrix-Matrix Unit tests +%!assert([1+i 2+i 3+i] * [ 4+i ; 5+i ; 6+i], 29+21i, 1e-14) +%!assert([1+i 2+i ; 3+i 4+i ] * [5+i ; 6+i], [15 + 14i ; 37 + 18i], 1e-14) +%!assert([1+i 2+i ; 3+i 4+i ] * [5+i 6+i ; 7+i 8+i], [17 + 15i 20 + 17i; 41 + 19i 48 + 21i], 1e-14) +*/ + +/* Test some simple identities +%!shared M, cv, rv +%! M = randn(10,10)+i*rand(10,10); +%! cv = randn(10,1)+i*rand(10,1); +%! rv = randn(1,10)+i*rand(1,10); +%!assert([M*cv,M*cv],M*[cv,cv],1e-14) +%!assert([rv*M;rv*M],[rv;rv]*M,1e-14) +%!assert(2*rv*cv,[rv,rv]*[cv;cv],1e-14) +*/ + ComplexMatrix operator * (const ComplexMatrix& m, const ComplexMatrix& a) { diff -r 4d90ee4061ef -r b3c425131211 liboctave/ChangeLog --- a/liboctave/ChangeLog Tue Nov 14 15:12:04 2006 +0000 +++ b/liboctave/ChangeLog Tue Nov 14 15:33:22 2006 +0000 @@ -1,3 +1,7 @@ +2006-11-14 Luis F. Ortiz + + * CMatrix.cc, dMatrix.cc: New tests. + 2006-11-13 Michael Goffioul * Array-d.cc, dDiagMatrix.h: Sprinkle with OCTAVE_API as needed. diff -r 4d90ee4061ef -r b3c425131211 liboctave/dMatrix.cc --- a/liboctave/dMatrix.cc Tue Nov 14 15:12:04 2006 +0000 +++ b/liboctave/dMatrix.cc Tue Nov 14 15:33:22 2006 +0000 @@ -2980,6 +2980,23 @@ // matrix by matrix -> matrix operations +/* Simple Dot Product, Matrix-Vector and Matrix-Matrix Unit tests +%!assert([1 2 3] * [ 4 ; 5 ; 6], 32, 1e-14) +%!assert([1 2 ; 3 4 ] * [5 ; 6], [17 ; 39 ], 1e-14) +%!assert([1 2 ; 3 4 ] * [5 6 ; 7 8], [19 22; 43 50], 1e-14) +*/ + +/* Test some simple identities +%!shared M, cv, rv +%! M = randn(10,10); +%! cv = randn(10,1); +%! rv = randn(1,10); +%!assert([M*cv,M*cv],M*[cv,cv],1e-14) +%!assert([rv*M;rv*M],[rv;rv]*M,1e-14) +%!assert(2*rv*cv,[rv,rv]*[cv;cv],1e-14) +*/ + + Matrix operator * (const Matrix& m, const Matrix& a) { diff -r 4d90ee4061ef -r b3c425131211 test/ChangeLog --- a/test/ChangeLog Tue Nov 14 15:12:04 2006 +0000 +++ b/test/ChangeLog Tue Nov 14 15:33:22 2006 +0000 @@ -1,3 +1,7 @@ +2006-11-14 Luis F. Ortiz + + * fntests.m: Include liboctave in the list of directories to test. + 2006-08-25 John W. Eaton * test_io.m (testls): Allow for small variance in loaded values diff -r 4d90ee4061ef -r b3c425131211 test/fntests.m --- a/test/fntests.m Tue Nov 14 15:12:04 2006 +0000 +++ b/test/fntests.m Tue Nov 14 15:33:22 2006 +0000 @@ -23,7 +23,8 @@ src_tree = canonicalize_file_name (fullfile (topsrcdir, "src")); script_tree = canonicalize_file_name (fullfile (topsrcdir, "scripts")); -fundirs = {src_tree, script_tree}; +liboctave_tree = canonicalize_file_name (fullfile (topsrcdir, "liboctave")); +fundirs = {src_tree, liboctave_tree, script_tree}; function print_test_file_name (nm) filler = repmat (".", 1, 55-length (nm));