matrix: add matrix multiplication assignment

This commit is contained in:
Danny Robson 2015-01-13 18:38:12 +11:00
parent 616f6f1db9
commit 7f152e5350
2 changed files with 10 additions and 0 deletions

View File

@ -303,6 +303,14 @@ matrix<T>::operator* (const matrix<T> &rhs) const {
} }
//-----------------------------------------------------------------------------
template <typename T>
matrix<T>&
matrix<T>::operator*=(const matrix<T> &rhs) {
return *this = *this * rhs;
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template <typename T> template <typename T>
vector<4,T> vector<4,T>

View File

@ -43,6 +43,8 @@ namespace util {
T det (void) const; T det (void) const;
matrix<T> operator* (const matrix<T>&) const; matrix<T> operator* (const matrix<T>&) const;
matrix<T>& operator*=(const matrix<T>&);
vector<4,T> operator* (const vector<4,T>&) const; vector<4,T> operator* (const vector<4,T>&) const;
point<4,T> operator* (const point<4,T> &) const; point<4,T> operator* (const point<4,T> &) const;