comparison liboctave/CMatrix.cc @ 14427:d07e989686b0

Use Octave coding conventions in liboctave %!test blocks * Array.cc, CMatrix.cc, Sparse.cc, dMatrix.cc, fCMatrix.cc, fMatrix.cc, oct-inttypes.cc: Use Octave coding conventions in liboctave %!test blocks
author Rik <octave@nomad.inbox5.com>
date Fri, 02 Mar 2012 22:13:16 -0800
parents 72c96de7a403
children e8e86ae3abbc
comparison
equal deleted inserted replaced
14426:e28a1723d5a2 14427:d07e989686b0
3700 return ComplexMatrix (m * real (a), m * imag (a)); 3700 return ComplexMatrix (m * real (a), m * imag (a));
3701 else 3701 else
3702 return ComplexMatrix (m) * a; 3702 return ComplexMatrix (m) * a;
3703 } 3703 }
3704 3704
3705 /* Simple Dot Product, Matrix-Vector and Matrix-Matrix Unit tests 3705 /*
3706 %!assert([1+i 2+i 3+i] * [ 4+i ; 5+i ; 6+i], 29+21i, 1e-14) 3706
3707 %!assert([1+i 2+i ; 3+i 4+i ] * [5+i ; 6+i], [15 + 14i ; 37 + 18i], 1e-14) 3707 ## Simple Dot Product, Matrix-Vector, and Matrix-Matrix Unit tests
3708 %!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) 3708 %!assert ([1+i 2+i 3+i] * [ 4+i ; 5+i ; 6+i], 29+21i, 1e-14)
3709 %!assert([1 i]*[i 0]', -i); 3709 %!assert ([1+i 2+i ; 3+i 4+i ] * [5+i ; 6+i], [15 + 14i ; 37 + 18i], 1e-14)
3710 */ 3710 %!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)
3711 3711 %!assert ([1 i]*[i 0]', -i);
3712 /* Test some simple identities 3712
3713 ## Test some simple identities
3713 %!shared M, cv, rv 3714 %!shared M, cv, rv
3714 %! M = randn(10,10)+i*rand(10,10); 3715 %! M = randn (10,10) + i*rand (10,10);
3715 %! cv = randn(10,1)+i*rand(10,1); 3716 %! cv = randn (10,1) + i*rand (10,1);
3716 %! rv = randn(1,10)+i*rand(1,10); 3717 %! rv = randn (1,10) + i*rand (1,10);
3717 %!assert([M*cv,M*cv],M*[cv,cv],1e-14) 3718 %!assert ([M*cv,M*cv], M*[cv,cv], 1e-14)
3718 %!assert([M.'*cv,M.'*cv],M.'*[cv,cv],1e-14) 3719 %!assert ([M.'*cv,M.'*cv], M.'*[cv,cv], 1e-14)
3719 %!assert([M'*cv,M'*cv],M'*[cv,cv],1e-14) 3720 %!assert ([M'*cv,M'*cv], M'*[cv,cv], 1e-14)
3720 %!assert([rv*M;rv*M],[rv;rv]*M,1e-14) 3721 %!assert ([rv*M;rv*M], [rv;rv]*M, 1e-14)
3721 %!assert([rv*M.';rv*M.'],[rv;rv]*M.',1e-14) 3722 %!assert ([rv*M.';rv*M.'], [rv;rv]*M.', 1e-14)
3722 %!assert([rv*M';rv*M'],[rv;rv]*M',1e-14) 3723 %!assert ([rv*M';rv*M'], [rv;rv]*M', 1e-14)
3723 %!assert(2*rv*cv,[rv,rv]*[cv;cv],1e-14) 3724 %!assert (2*rv*cv, [rv,rv]*[cv;cv], 1e-14)
3725
3724 */ 3726 */
3725 3727
3726 static inline char 3728 static inline char
3727 get_blas_trans_arg (bool trans, bool conj) 3729 get_blas_trans_arg (bool trans, bool conj)
3728 { 3730 {