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
00022 #include <initializer_list>
00023
00024 template <class T>
00025 class Matrix {
00026 public:
00027 Matrix();
00028 Matrix(unsigned int rows, unsigned int columns);
00029
00030 Matrix(const Matrix<T> &other);
00031 Matrix<T> & operator= (const Matrix<T> &other);
00032 ~Matrix();
00033
00034 void resize(unsigned int rows, unsigned int columns, T default_value = 0);
00035 void clear(void);
00036 T& operator () (unsigned int x, unsigned int y);
00037 const T& operator () (unsigned int x, unsigned int y) const;
00038 const T min() const;
00039 const T max() const;
00040 inline unsigned int minsize(void) {
00041 return ((m_rows < m_columns) ? m_rows : m_columns);
00042 }
00043 inline unsigned int columns(void) const {
00044 return m_columns;
00045 }
00046 inline unsigned int rows(void) const {
00047 return m_rows;
00048 }
00049 private:
00050 T **m_matrix;
00051 unsigned int m_rows;
00052 unsigned int m_columns;
00053 };
00054
00055 #ifndef USE_EXPORT_KEYWORD
00056 #include "matrix.cpp"
00057
00058 #endif
00059
00060 #endif
00061