00001 #ifndef MAT_MORPH_CLASS
00002 #define MAT_MORPH_CLASS
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "amorph.h"
00019
00021
00029 template <class contents>
00030 class mat_morph : protected amorph<contents>
00031 {
00032 public:
00033 mat_morph(int rows = 0, int cols = 0);
00034 inline ~mat_morph() {}
00035
00036 inline int rows() const { return _rows; }
00037 inline int columns() const { return _cols; }
00038
00039 contents *get(int row, int column);
00040 const contents *get(int row, int column) const;
00042
00043 contents *acquire(int row, int column);
00045
00048 bool put(int row, int column, const contents *to_put);
00050
00051 void reset(int rows = 0, int columns = 0);
00053
00054 void redimension(int new_rows, int new_columns);
00056
00059 bool zap_row(int row_to_zap);
00061
00063 bool zap_column(int column_to_zap);
00065
00066 bool insert_row(int before_row);
00068
00070 bool insert_column(int before_column);
00071
00072
00073 private:
00074 int _rows;
00075 int _cols;
00076
00077 int compute_index(int row, int column) const;
00079 };
00080
00081 #endif
00082