21 #ifndef SELDON_FILE_ARRAY_HXX
32 template <
class T,
int N,
class Allocator>
37 typedef typename Allocator::value_type value_type;
38 typedef typename Allocator::pointer pointer;
39 typedef typename Allocator::const_pointer const_pointer;
40 typedef typename Allocator::reference reference;
41 typedef typename Allocator::const_reference const_reference;
58 Array(
int i,
int j,
int k);
59 Array(
int i,
int j,
int k,
int l);
60 Array(
int i,
int j,
int k,
int l,
int m);
61 Array(
int i,
int j,
int k,
int l,
int m,
int n);
62 Array(
int i,
int j,
int k,
int l,
int m,
int n,
int o);
63 Array(
int i,
int j,
int k,
int l,
int m,
int n,
int o,
int p);
64 Array(
int i,
int j,
int k,
int l,
int m,
int n,
int o,
int p,
int q);
80 void Reallocate(
int i,
int j,
int k,
int l,
int m);
81 void Reallocate(
int i,
int j,
int k,
int l,
int m,
int n);
82 void Reallocate(
int i,
int j,
int k,
int l,
int m,
int n,
int o);
83 void Reallocate(
int i,
int j,
int k,
int l,
int m,
int n,
int o,
int p);
84 void Reallocate(
int i,
int j,
int k,
int l,
int m,
int n,
int o,
int p,
90 reference
operator() (
int i,
int j,
int k,
int l);
91 reference
operator() (
int i,
int j,
int k,
int l,
int m);
92 reference
operator() (
int i,
int j,
int k,
int l,
int m,
int n);
93 reference
operator() (
int i,
int j,
int k,
int l,
int m,
int n,
int o);
94 reference
operator() (
int i,
int j,
int k,
int l,
int m,
int n,
int o,
96 reference
operator() (
int i,
int j,
int k,
int l,
int m,
int n,
int o,
99 const_reference
operator() (
int i,
int j,
int k)
const;
100 const_reference
operator() (
int i,
int j,
int k,
int l)
const;
101 const_reference
operator() (
int i,
int j,
int k,
int l,
int m)
const;
102 const_reference operator()
103 (
int i,
int j,
int k,
int l,
int m,
int n)
const;
104 const_reference operator()
105 (
int i,
int j,
int k,
int l,
int m,
int n,
int o)
const;
106 const_reference operator()
107 (
int i,
int j,
int k,
int l,
int m,
int n,
int o,
int p)
const;
108 const_reference operator()
109 (
int i,
int j,
int k,
int l,
int m,
int n,
int o,
int p,
int q)
const;
119 void Fill(
const T0& x);
124 void Write(
string FileName,
bool with_size =
true)
const;
125 void Write(ofstream& FileStream,
bool with_size =
true)
const;
126 void Read(
string FileName,
bool with_size =
true);
127 void Read(ifstream& FileStream,
bool with_size =
true);
132 template <
class T,
int N,
class Allocator>
141 #define SELDON_FILE_ARRAY_HXX
void Clear()
Clears the array.
long GetDataSize() const
Returns the number of elements stored in memory.
int GetLength(int dimension) const
Returns the length in dimension #1.
void Read(string FileName, bool with_size=true)
Reads the array from a file.
size_t GetMemorySize() const
Returns the memory used by the object in bytes.
Array< T, N, Allocator > & operator=(const Array< T, N, Allocator > &A)
Duplicates an array (assignment operator).
void Zero()
Sets all elements to zero.
void Write(string FileName, bool with_size=true) const
Writes the array in a file.
void Reallocate(int i, int j, int k)
Reallocates memory to resize the 3D array.
Array()
Default constructor.
void FillRand()
Fills the array randomly.
void Fill()
Fills the array.
void Copy(const Array< T, N, Allocator > &A)
Duplicates an array.
void Print() const
Displays the array on the standard output.
ostream & operator<<(ostream &out, const Array< T, N, Allocator > &A)
operator<< overloaded for a 3D array.
pointer GetData() const
Returns a pointer to the data array.
long GetSize() const
Returns the number of elements in the 3D array.
reference operator()(int i, int j, int k)
Access operator.