00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef SELDON_FILE_ARRAY3D_HXX
00024
00025 #include "../Common/Common.hxx"
00026 #include "../Common/Errors.cxx"
00027 #include "../Common/Allocator.hxx"
00028
00029 namespace Seldon
00030 {
00031
00032
00034
00037 template <class T, class Allocator = SELDON_DEFAULT_ALLOCATOR<T> >
00038 class Array3D
00039 {
00040
00041 public:
00042 typedef typename Allocator::value_type value_type;
00043 typedef typename Allocator::pointer pointer;
00044 typedef typename Allocator::const_pointer const_pointer;
00045 typedef typename Allocator::reference reference;
00046 typedef typename Allocator::const_reference const_reference;
00047
00048
00049 protected:
00050 static Allocator array3D_allocator_;
00051
00052
00053 protected:
00054
00055 int length1_;
00056
00057 int length2_;
00058
00059 int length3_;
00060
00061
00062 int length23_;
00063
00064
00065 pointer data_;
00066
00067
00068 public:
00069
00070 Array3D();
00071 Array3D(int i, int j, int k);
00072
00073
00074 ~Array3D();
00075
00076
00077 int GetLength1() const;
00078 int GetLength2() const;
00079 int GetLength3() const;
00080 int GetSize() const;
00081 int GetDataSize() const;
00082 pointer GetData() const;
00083
00084
00085 void Reallocate(int i, int j, int k);
00086
00087
00088 reference operator() (int i, int j, int k);
00089 const_reference operator() (int i, int j, int k) const;
00090 void Copy(const Array3D<T, Allocator>& A);
00091
00092
00093 void Zero();
00094 void Fill();
00095 template <class T0>
00096 void Fill(const T0& x);
00097 void FillRand();
00098 void Print() const;
00099
00100 };
00101
00102
00103
00104 template <class T, class Allocator>
00105 Allocator Array3D<T, Allocator>::array3D_allocator_;
00106
00107
00108 template <class T, class Allocator>
00109 ostream& operator << (ostream& out,
00110 const Array3D<T, Allocator>& A);
00111
00112
00113 }
00114
00115
00116 #define SELDON_FILE_ARRAY3D_HXX
00117 #endif