mat_morph.h

Go to the documentation of this file.
00001 #ifndef MAT_MORPH_CLASS
00002 #define MAT_MORPH_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : mat_morph                                                         *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 2003-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
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     // inserts a column into the matrix before the "before_" parameter.
00072 
00073 private:
00074   int _rows;  
00075   int _cols;  
00076 
00077   int compute_index(int row, int column) const;
00079 };
00080 
00081 #endif
00082 

Generated on Fri Nov 28 04:29:12 2008 for HOOPLE Libraries by  doxygen 1.5.1