#ifndef MATRIX_H #define MATRIX_H #include "Vector3.h" /// @brief Single precision float matrix template class MatrixOf { public: MatrixOf(unsigned int rows, unsigned int cols, T *data) : rows(rows), cols(cols), data(data) {} // MatrixOf(Vector3 v); // creates a 3,1 matrix /// @brief Transpose with result in matrix m /// @param r The matrix in which the transposed matrix is stored void Transpose(MatrixOf *r); static void Multiply(const MatrixOf *m1, MatrixOf *m2, MatrixOf *r); void Multiply(MatrixOf *m, MatrixOf *r); static Vector3 Multiply(const MatrixOf *m, Vector3 v); Vector3 operator*(const Vector3 v) const; T Get(unsigned int rowIx, unsigned int colIx); unsigned int RowCount(); unsigned int ColCount(); private: unsigned int rows; unsigned int cols; T *data; }; #endif