virtual ~not_invertible() throw() { }
};
+/**
+A mathematical matrix with S rows and columns. Some operations are provided
+here that are only possible for square matrices.
+*/
template<typename T, unsigned S>
class SquareMatrix: public Matrix<T, S, S>
{
public:
SquareMatrix() { }
- SquareMatrix(const T *);
+ SquareMatrix(const T *d): Matrix<T, S, S>(d) { }
template<typename U>
- SquareMatrix(const Matrix<U, S, S> &);
+ SquareMatrix(const Matrix<U, S, S> &m): Matrix<T, S, S>(m) { }
static SquareMatrix identity();
SquareMatrix &invert();
};
-template<typename T, unsigned S>
-SquareMatrix<T, S>::SquareMatrix(const T *d):
- Matrix<T, S, S>(d)
-{ }
-
-template<typename T, unsigned S>
-template<typename U>
-SquareMatrix<T, S>::SquareMatrix(const Matrix<U, S, S> &m):
- Matrix<T, S, S>(m)
-{ }
-
template<typename T, unsigned S>
inline SquareMatrix<T, S> SquareMatrix<T, S>::identity()
{
template<typename T, unsigned S>
SquareMatrix<T, S> &SquareMatrix<T, S>::operator*=(const SquareMatrix<T, S> &m)
{
- Matrix<T, S, S>::operator*=(m);
- return *this;
+ return *this = *this*m;
}
template<typename T, unsigned S>