static Matrix from_columns(const Vector<T, M> *);
static Matrix from_rows(const Vector<T, N> *);
- T &element(unsigned, unsigned);
- const T &element(unsigned, unsigned) const;
- T &operator()(unsigned, unsigned);
- const T &operator()(unsigned, unsigned) const;
+ T &element(unsigned i, unsigned j) { return data[i+M*j]; }
+ const T &element(unsigned i, unsigned j) const { return data[i+M*j]; }
+ T &operator()(unsigned i, unsigned j) { return element(i, j); }
+ const T &operator()(unsigned i, unsigned j) const { return element(i, j); }
Matrix &operator*=(T);
Matrix &operator/=(T);
m(i, j) = v[i][j];
}
-template<typename T, unsigned M, unsigned N>
-inline T &Matrix<T, M, N>::element(unsigned i, unsigned j)
-{
- return data[i+M*j];
-}
-
-template<typename T, unsigned M, unsigned N>
-inline const T &Matrix<T, M, N>::element(unsigned i, unsigned j) const
-{
- return data[i+M*j];
-}
-
-template<typename T, unsigned M, unsigned N>
-inline T &Matrix<T, M, N>::operator()(unsigned i, unsigned j)
-{
- return element(i, j);
-}
-
-template<typename T, unsigned M, unsigned N>
-inline const T &Matrix<T, M, N>::operator()(unsigned i, unsigned j) const
-{
- return element(i, j);
-}
-
template<typename T, unsigned M, unsigned N>
inline Matrix<T, M, N> &Matrix<T, M, N>::operator*=(T s)
{