23 #ifndef _TLP_GEO_MATRIX_H 24 #define _TLP_GEO_MATRIX_H 29 #include <tulip/Vector.h> 33 #define MATRIX tlp::Matrix<Obj, SIZE> 49 template <
typename Obj,
size_t SIZE>
50 class Matrix :
public Array<Vector<Obj, SIZE>, SIZE> {
53 Matrix(
const Array<Vector<Obj, SIZE>, SIZE> &a) : Array<Vector<Obj, SIZE>, SIZE>(a) {}
56 Matrix(
const std::vector<std::vector<Obj>> &covarianceMatrix);
61 inline MATRIX &fill(Obj obj);
65 Obj determinant()
const;
77 inline MATRIX &operator+=(
const MATRIX &mat);
81 inline MATRIX &operator-=(
const MATRIX &mat);
85 inline bool operator==(
const MATRIX &)
const;
89 inline bool operator!=(
const MATRIX &)
const;
93 inline MATRIX &operator*=(
const MATRIX &mat);
97 inline MATRIX &operator*=(
const Obj &obj);
101 inline MATRIX &operator/=(
const MATRIX &mat);
105 inline MATRIX &operator/=(
const Obj &obj);
109 MATRIX cofactor()
const;
114 MATRIX operator/(
const MATRIX &mat2)
const;
120 MATRIX operator/(
const Obj &obj)
const;
126 inline Vector<Obj, SIZE> powerIteration(
const unsigned int nIterations)
const;
132 inline bool simplify(Matrix<Obj, 2> &simplifiedMatrix)
const;
138 inline bool computeEigenVector(
const float x, Vector<Obj, 3> &eigenVector)
const;
142 typedef Matrix<float, 3> Mat3f;
143 typedef Matrix<double, 3> Mat3d;
144 typedef Matrix<float, 4> Mat4f;
145 typedef Matrix<double, 4> Mat4d;
150 template <
typename Obj,
size_t SIZE>
151 inline MATRIX operator+(
const MATRIX &mat1,
const MATRIX &mat2);
155 template <
typename Obj,
size_t SIZE>
156 inline MATRIX operator-(
const MATRIX &mat1,
const MATRIX &mat2);
161 template <
typename Obj,
size_t SIZE>
162 inline MATRIX operator*(
const MATRIX &mat,
const Obj &obj);
167 template <
typename Obj,
size_t SIZE>
168 inline MATRIX operator*(
const MATRIX &mat1,
const MATRIX &mat2);
173 template <
typename Obj,
size_t SIZE>
174 inline Vector<Obj, SIZE> operator*(
const Vector<Obj, SIZE> &vec,
const tlp::Matrix<Obj, SIZE> &);
179 template <
typename Obj,
size_t SIZE>
180 inline Vector<Obj, SIZE> operator*(
const Matrix<Obj, SIZE> &,
const Vector<Obj, SIZE> &vec);
183 #include "cxx/Matrix.cxx"