Fabio Bobrow / Cubli
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Matrix.h Source File

Matrix.h

00001 #ifndef Matrix_h
00002 #define Matrix_h
00003 
00004 #include "stdlib.h"
00005 #include "math.h"
00006 
00007 /** Matrix class */
00008 class Matrix
00009 {
00010 public:
00011     /** Constructors */
00012     Matrix();
00013     Matrix(int, int);
00014     /** Destructor */
00015     ~Matrix();
00016     /** Assignment */
00017     Matrix& operator=(const Matrix&);
00018     /** Cell data */
00019     float& operator()(int, int);
00020     /** Parameters */
00021     int rows, cols;
00022     float **data;
00023 private:
00024     /** Memmory managment **/
00025     void allocate_memmory();
00026     void deallocate_memmory();
00027 };
00028 
00029 /** Math operators */
00030 Matrix operator+(const Matrix&, const Matrix&);
00031 Matrix operator-(const Matrix&, const Matrix&);
00032 Matrix operator-(const Matrix&);
00033 Matrix operator*(const Matrix&, const Matrix&);
00034 Matrix operator*(float, const Matrix&);
00035 Matrix operator*(const Matrix&, float);
00036 Matrix operator/(const Matrix&, float);
00037 
00038 /** Matriz algebra */
00039 Matrix eye(int, int = 0);
00040 Matrix zeros(int, int = 0);
00041 Matrix transpose(const Matrix&);
00042 Matrix inverse(const Matrix&);
00043 float trace(const Matrix&);
00044 
00045 /** Vector algebra **/
00046 Matrix cross(const Matrix&, const Matrix&);
00047 float norm(const Matrix&);
00048 
00049 /** Orientation algebra **/
00050 Matrix dcm2quat(const Matrix&);
00051 
00052 #endif