Commit b36a3172 authored by CGoGN GIT Supervisor's avatar CGoGN GIT Supervisor

Merge branch 'master' of /home/vanhoey/CGoGN

* 'master' of /home/vanhoey/CGoGN:
  added matrix::operator/ (scalar)
parents 219aacb7 589aa662
......@@ -120,6 +120,9 @@ class Matrix
// Matrix / Scalar multiplication
Matrix<M,N,T> operator*(T s) const;
// Matrix / Scalar division
Matrix<M,N,T> operator/(T s) const;
/**********************************************/
/* UTILITY FUNCTIONS */
/**********************************************/
......
......@@ -299,6 +299,16 @@ Matrix<M,N,T> Matrix<M,N,T>::operator*(T s) const
return res ;
}
template <unsigned int M, unsigned int N, typename T>
Matrix<M,N,T> Matrix<M,N,T>::operator/(T s) const
{
Matrix<M,N,T> res ;
for(unsigned int i = 0; i < M; ++i)
for(unsigned int j = 0; j < N; ++j)
res(i,j) = m_data[i][j] / s ;
return res ;
}
/**********************************************/
/* UTILITY FUNCTIONS */
/**********************************************/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment