Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #if !defined(_MATRIX_H_)
00020 #define _MATRIX_H_
00021 #ifndef __GXX_EXPERIMENTAL_CXX0X__
00022 #define __GXX_EXPERIMENTAL_CXX0X__
00023 #endif
00024 #include <initializer_list>
00025
00026 template <class T>
00027 class Matrix {
00028 public:
00029 Matrix();
00030 Matrix(unsigned int rows, unsigned int columns);
00031
00032 Matrix(const Matrix<T> &other);
00033 Matrix<T> & operator= (const Matrix<T> &other);
00034 ~Matrix();
00035
00036 void resize(unsigned int rows, unsigned int columns, T default_value = 0);
00037 void clear(void);
00038 T& operator () (unsigned int x, unsigned int y);
00039 const T& operator () (unsigned int x, unsigned int y) const;
00040 const T min() const;
00041 const T max() const;
00042 inline unsigned int minsize(void) {
00043 return ((m_rows < m_columns) ? m_rows : m_columns);
00044 }
00045 inline unsigned int columns(void) const {
00046 return m_columns;
00047 }
00048 inline unsigned int rows(void) const {
00049 return m_rows;
00050 }
00051 private:
00052 T **m_matrix;
00053 unsigned int m_rows;
00054 unsigned int m_columns;
00055 };
00056
00057 #ifndef USE_EXPORT_KEYWORD
00058 #include "../src/src/matrix.cpp"
00059
00060 #endif
00061
00062 #endif
00063