proj home

Files   Classes   Functions   Hierarchy  

array2D.h

Go to the documentation of this file.
00001 #ifndef ARRAY2D_H
00002 #define ARRAY2D_H
00003 
00004 #include <print.h>
00005 
00012 template< typename T >
00013 class array2D
00014 {
00015 public:
00016 
00017   uintc m;
00018   uintc n;
00019 
00020   T * arr;
00021 
00022   array2D(uintc m_, uintc n_)
00023     : m(m_), n(n_)
00024   {
00025     arr = new T[m*n];
00026   }
00027 
00028   ~array2D()
00029     { delete[] arr; }
00030 
00031   T & get(uintc i, uintc k)
00032     { return arr[i*n+k]; }
00033   T const & get(uintc i, uintc k) const
00034     { return arr[i*n+k]; }
00035 };
00036 
00037 
00038 #endif
00039 

Generated on Fri Mar 4 00:49:29 2011 for Chelton Evans Source by  doxygen 1.5.8