comparison liboctave/dMatrix.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
3111 return retval; 3111 return retval;
3112 } 3112 }
3113 3113
3114 // matrix by matrix -> matrix operations 3114 // matrix by matrix -> matrix operations
3115 3115
3116 /* Simple Dot Product, Matrix-Vector and Matrix-Matrix Unit tests 3116 /*
3117 %!assert([1 2 3] * [ 4 ; 5 ; 6], 32, 1e-14) 3117
3118 %!assert([1 2 ; 3 4 ] * [5 ; 6], [17 ; 39 ], 1e-14) 3118 ## Simple Dot Product, Matrix-Vector and Matrix-Matrix Unit tests
3119 %!assert([1 2 ; 3 4 ] * [5 6 ; 7 8], [19 22; 43 50], 1e-14) 3119 %!assert ([1 2 3] * [ 4 ; 5 ; 6], 32, 1e-14)
3120 */ 3120 %!assert ([1 2 ; 3 4 ] * [5 ; 6], [17 ; 39 ], 1e-14)
3121 3121 %!assert ([1 2 ; 3 4 ] * [5 6 ; 7 8], [19 22; 43 50], 1e-14)
3122 /* Test some simple identities 3122
3123 ## Test some simple identities
3123 %!shared M, cv, rv, Mt, rvt 3124 %!shared M, cv, rv, Mt, rvt
3124 %! M = randn(10,10)+100*eye(10,10); 3125 %! M = randn (10,10) + 100*eye (10,10);
3125 %! Mt = M'; 3126 %! Mt = M';
3126 %! cv = randn(10,1); 3127 %! cv = randn (10,1);
3127 %! rv = randn(1,10); 3128 %! rv = randn (1,10);
3128 %! rvt = rv'; 3129 %! rvt = rv';
3129 %!assert([M*cv,M*cv],M*[cv,cv],1e-13) 3130 %!assert ([M*cv,M*cv], M*[cv,cv], 1e-13)
3130 %!assert([M'*cv,M'*cv],M'*[cv,cv],1e-13) 3131 %!assert ([M'*cv,M'*cv], M'*[cv,cv], 1e-13)
3131 %!assert([rv*M;rv*M],[rv;rv]*M,1e-13) 3132 %!assert ([rv*M;rv*M], [rv;rv]*M, 1e-13)
3132 %!assert([rv*M';rv*M'],[rv;rv]*M',1e-13) 3133 %!assert ([rv*M';rv*M'], [rv;rv]*M', 1e-13)
3133 %!assert(2*rv*cv,[rv,rv]*[cv;cv],1e-13) 3134 %!assert (2*rv*cv, [rv,rv]*[cv;cv], 1e-13)
3134 %!assert(M'\cv,Mt\cv,1e-14) 3135 %!assert (M'\cv, Mt\cv, 1e-14)
3135 %!assert(M'\rv',Mt\rvt,1e-14) 3136 %!assert (M'\rv', Mt\rvt, 1e-14)
3137
3136 */ 3138 */
3137 3139
3138 static inline char 3140 static inline char
3139 get_blas_trans_arg (bool trans) 3141 get_blas_trans_arg (bool trans)
3140 { 3142 {