Mercurial > hg > octave-lyh
diff liboctave/fMatrix.cc @ 9527:6a9fd5f653c9
make single prec. matrix mutliply tests really single
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Sun, 16 Aug 2009 07:04:40 +0200 |
parents | 0ce82753dd72 |
children | ec066ba012c8 |
line wrap: on
line diff
--- a/liboctave/fMatrix.cc +++ b/liboctave/fMatrix.cc @@ -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 *