Mercurial > octave
diff liboctave/fMatrix.cc @ 12064:8e8da2c36e7e release-3-2-x
make single prec. matrix mutliply tests really single
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Sun, 23 Aug 2009 11:11:27 +0200 |
parents | a9d20c890190 |
children | 899122410ea5 |
line wrap: on
line diff
--- a/liboctave/fMatrix.cc Sun Aug 23 11:10:35 2009 +0200 +++ b/liboctave/fMatrix.cc Sun Aug 23 11:11:27 2009 +0200 @@ -3147,19 +3147,19 @@ // 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) +%!assert(single([1 2 3]) * single([ 4 ; 5 ; 6]), single(32), 5e-7) +%!assert(single([1 2 ; 3 4 ]) * single([5 ; 6]), single([17 ; 39 ]), 5e-7) +%!assert(single([1 2 ; 3 4 ]) * single([5 6 ; 7 8]), single([19 22; 43 50]), 5e-7) */ /* 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) +%! M = single(randn(10,10)); +%! cv = single(randn(10,1)); +%! rv = single(randn(1,10)); +%!assert([M*cv,M*cv],M*[cv,cv],5e-7) +%!assert([rv*M;rv*M],[rv;rv]*M,5e-7) +%!assert(2*rv*cv,[rv,rv]*[cv;cv],5e-7) */ static const char *