00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if !defined (octave_Array3_h)
00025 #define octave_Array3_h 1
00026
00027 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
00028 #pragma interface
00029 #endif
00030
00031 #include <cassert>
00032 #include <cstdlib>
00033
00034 #include "Array.h"
00035 #include "lo-error.h"
00036
00037 class idx_vector;
00038
00039
00040
00041 template <class T>
00042 class
00043 Array3 : public Array<T>
00044 {
00045 protected:
00046
00047 static int get_size (int r, int c, int p)
00048 { return Array<T>::get_size (r, c, p); }
00049
00050 Array3 (T *d, int r, int c, int p) : Array<T> (d, dim_vector (r, c, p)) { }
00051
00052 public:
00053
00054 Array3 (void) : Array<T> (dim_vector (0, 0, 0)) { }
00055
00056 Array3 (int r, int c, int p) : Array<T> (dim_vector (r, c, p)) { }
00057
00058 Array3 (int r, int c, int p, const T& val)
00059 : Array<T> (dim_vector (r, c, p), val) { }
00060
00061 Array3 (const Array3<T>& a)
00062 : Array<T> (a, a.dims ()) { }
00063
00064 Array3 (const Array<T>& a, int r, int c, int p)
00065 : Array<T> (a, dim_vector (r, c, p)) { }
00066
00067 ~Array3 (void) { }
00068
00069 Array3<T>& operator = (const Array3<T>& a)
00070 {
00071 if (this != &a)
00072 Array<T>::operator = (a);
00073
00074 return *this;
00075 }
00076
00077 void resize (int r, int c, int p) { this->resize_no_fill (r, c, p); }
00078
00079 void resize (int r, int c, int p, const T& val)
00080 { this->resize_and_fill (r, c, p, val); }
00081 };
00082
00083 #endif
00084
00085
00086
00087
00088
00089