Changeset 737 for trunk/yat/utility
 Timestamp:
 Jan 7, 2007, 2:48:38 PM (16 years ago)
 Location:
 trunk/yat/utility
 Files:

 4 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/utility/matrix.cc
r734 r737 437 437 } 438 438 439 440 vector operator*(const matrix& m, const vector& v) 441 { 442 utility::vector res(m.rows()); 443 for (size_t i=0; i<res.size(); ++i) 444 res(i) = vector(m,i) * v; 445 return res; 446 } 447 448 449 vector operator*(const vector& v, const matrix& m) 450 { 451 utility::vector res(m.columns()); 452 for (size_t i=0; i<res.size(); ++i) 453 res(i) = v * vector(m,i,false); 454 return res; 455 } 456 439 457 }}} // of namespace utility, yat and thep 
trunk/yat/utility/matrix.h
r735 r737 420 420 std::ostream& operator<< (std::ostream& s, const matrix&); 421 421 422 /** 423 @brief vector matrix multiplication 424 */ 425 vector operator*(const matrix&, const vector&); 426 427 /** 428 @brief matrix vector multiplication 429 */ 430 vector operator*(const vector&, const matrix&); 422 431 423 432 }}} // of namespace utility, yat, and theplu 
trunk/yat/utility/utility.cc
r734 r737 119 119 120 120 121 vector operator*(const matrix& m, const vector& v)122 {123 utility::vector res(m.rows());124 for (size_t i=0; i<res.size(); ++i)125 res(i) = vector(m,i) * v;126 return res;127 }128 129 130 vector operator*(const vector& v, const matrix& m)131 {132 utility::vector res(m.columns());133 for (size_t i=0; i<res.size(); ++i)134 res(i) = v * vector(m,i,false);135 return res;136 }137 138 121 }}} // end of namespace utility, yat and thep 
trunk/yat/utility/utility.h
r734 r737 33 33 /// 34 34 35 #include "vector.h"36 37 35 #include <string> 38 36 #include <utility> … … 43 41 namespace utility { 44 42 45 class matrix;43 class vector; 46 44 47 45 /// … … 86 84 87 85 88 /**89 @brief matrix vector multiplication90 */91 vector operator*(const matrix&, const vector&);92 93 94 /**95 @brief matrix vector multiplication96 */97 vector operator*(const vector&, const matrix&);98 99 86 }}} // of namespace utility, yat, and theplu 100 87
Note: See TracChangeset
for help on using the changeset viewer.