+++ /dev/null
-#ifndef MSP_LINAL_SQUAREMATRIX_H_
-#define MSP_LINAL_SQUAREMATRIX_H_
-
-#include <cmath>
-#include "matrix.h"
-#include "matrixops.h"
-
-namespace Msp {
-namespace LinAl {
-
-/**
-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 *d): Matrix<T, S, S>(d) { }
- template<typename U>
- SquareMatrix(const Matrix<U, S, S> &m): Matrix<T, S, S>(m) { }
-
- static SquareMatrix identity();
-
- SquareMatrix &operator*=(const SquareMatrix &);
- using Matrix<T, S, S>::operator*=;
-
- SquareMatrix &invert();
-};
-
-template<typename T, unsigned S>
-inline SquareMatrix<T, S> SquareMatrix<T, S>::identity()
-{
- SquareMatrix<T, S> m;
- for(unsigned i=0; i<S; ++i)
- m(i, i) = T(1);
- return m;
-}
-
-template<typename T, unsigned S>
-SquareMatrix<T, S> &SquareMatrix<T, S>::operator*=(const SquareMatrix<T, S> &m)
-{
- return *this = *this*m;
-}
-
-template<typename T, unsigned S>
-SquareMatrix<T, S> &SquareMatrix<T, S>::invert()
-{
- SquareMatrix<T, S> r = identity();
- gauss_jordan(*this, r);
- return *this = r;
-}
-
-template<typename T, unsigned S>
-inline SquareMatrix<T, S> invert(const SquareMatrix<T, S> &m)
-{
- SquareMatrix<T, S> temp = m;
- SquareMatrix<T, S> r = SquareMatrix<T, S>::identity();
- return gauss_jordan(temp, r);
-}
-
-} // namespace LinAl
-} // namespace Msp
-
-#endif