2024-02-12 11:56:51 +01:00

27 lines
655 B
C++

#ifndef MATRIX_H
#define MATRIX_H
#include "Vector3.h"
/// @brief Single precision float matrix
template <typename T> class MatrixOf {
public:
MatrixOf(int rows, 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<T> *r);
static void Multiply(MatrixOf<T> *m1, MatrixOf<T> *m2, MatrixOf<T> *r);
void Multiply(MatrixOf<T> *m, MatrixOf<T> *r);
static Vector3 Multiply(MatrixOf<T> *m, Vector3 v);
private:
int rows;
int cols;
T *data;
};
#endif