Public Types | Public Member Functions | Protected Attributes | List of all members
Seldon::Array< T, N, Allocator > Class Template Reference

Multi-dimensional Array. More...

#include <Array.hxx>

Public Types

typedef Allocator::value_type value_type
 
typedef Allocator::pointer pointer
 
typedef Allocator::const_pointer const_pointer
 
typedef Allocator::reference reference
 
typedef Allocator::const_reference const_reference
 

Public Member Functions

 Array ()
 Default constructor. More...
 
 Array (int i)
 
 Array (int i, int j, int k)
 Main constructor. More...
 
 Array (int i, int j, int k, int l)
 Main constructor. More...
 
 Array (int i, int j, int k, int l, int m)
 Main constructor. More...
 
 Array (int i, int j, int k, int l, int m, int n)
 Main constructor. More...
 
 Array (int i, int j, int k, int l, int m, int n, int o)
 Main constructor. More...
 
 Array (int i, int j, int k, int l, int m, int n, int o, int p)
 Main constructor. More...
 
 Array (int i, int j, int k, int l, int m, int n, int o, int p, int q)
 Main constructor. More...
 
 Array (const Array< T, N, Allocator > &A)
 Copy constructor.
 
 ~Array ()
 Destructor.
 
int GetLength (int dimension) const
 Returns the length in dimension #1. More...
 
long GetSize () const
 Returns the number of elements in the 3D array. More...
 
long GetDataSize () const
 Returns the number of elements stored in memory. More...
 
pointer GetData () const
 Returns a pointer to the data array. More...
 
void Reallocate (int i, int j, int k)
 Reallocates memory to resize the 3D array. More...
 
void Reallocate (int i, int j, int k, int l)
 Reallocates memory to resize the 4D array. More...
 
void Reallocate (int i, int j, int k, int l, int m)
 Reallocates memory to resize the 5D array. More...
 
void Reallocate (int i, int j, int k, int l, int m, int n)
 Reallocates memory to resize the 6D array. More...
 
void Reallocate (int i, int j, int k, int l, int m, int n, int o)
 Reallocates memory to resize the 7D array. More...
 
void Reallocate (int i, int j, int k, int l, int m, int n, int o, int p)
 Reallocates memory to resize the 8D array. More...
 
void Reallocate (int i, int j, int k, int l, int m, int n, int o, int p, int q)
 Reallocates memory to resize the 9D array. More...
 
void Clear ()
 Clears the array. More...
 
reference operator() (int i, int j, int k)
 Access operator. More...
 
reference operator() (int i, int j, int k, int l)
 Access operator. More...
 
reference operator() (int i, int j, int k, int l, int m)
 Access operator. More...
 
reference operator() (int i, int j, int k, int l, int m, int n)
 Access operator. More...
 
reference operator() (int i, int j, int k, int l, int m, int n, int o)
 Access operator. More...
 
reference operator() (int i, int j, int k, int l, int m, int n, int o, int p)
 Access operator. More...
 
reference operator() (int i, int j, int k, int l, int m, int n, int o, int p, int q)
 Access operator. More...
 
const_reference operator() (int i, int j, int k) const
 Access operator. More...
 
const_reference operator() (int i, int j, int k, int l) const
 Access operator. More...
 
const_reference operator() (int i, int j, int k, int l, int m) const
 Access operator. More...
 
const_reference operator() (int i, int j, int k, int l, int m, int n) const
 Access operator. More...
 
const_reference operator() (int i, int j, int k, int l, int m, int n, int o) const
 Access operator. More...
 
const_reference operator() (int i, int j, int k, int l, int m, int n, int o, int p) const
 Access operator. More...
 
const_reference operator() (int i, int j, int k, int l, int m, int n, int o, int p, int q) const
 Access operator. More...
 
Array< T, N, Allocator > & operator= (const Array< T, N, Allocator > &A)
 Duplicates an array (assignment operator). More...
 
void Copy (const Array< T, N, Allocator > &A)
 Duplicates an array. More...
 
size_t GetMemorySize () const
 Returns the memory used by the object in bytes. More...
 
void Zero ()
 Sets all elements to zero. More...
 
void Fill ()
 Fills the array. More...
 
template<class T0 >
void Fill (const T0 &x)
 Fills the array with a given value. More...
 
void FillRand ()
 Fills the array randomly. More...
 
void Print () const
 Displays the array on the standard output. More...
 
void Write (string FileName, bool with_size=true) const
 Writes the array in a file. More...
 
void Write (ofstream &FileStream, bool with_size=true) const
 Writes the array to an output stream. More...
 
void Read (string FileName, bool with_size=true)
 Reads the array from a file. More...
 
void Read (ifstream &FileStream, bool with_size=true)
 Reads the array from an input stream. More...
 

Protected Attributes

int length_ [N]
 
long offset_ [N]
 
pointer data_
 

Detailed Description

template<class T, int N, class Allocator>
class Seldon::Array< T, N, Allocator >

Multi-dimensional Array.

This class implements multi-dimensional arrays.

Definition at line 33 of file Array.hxx.

Constructor & Destructor Documentation

◆ Array() [1/8]

template<class T , int N, class Allocator >
Seldon::Array< T, N, Allocator >::Array

Default constructor.

On exit, the array is an empty array.

Definition at line 37 of file Array.cxx.

◆ Array() [2/8]

template<class T , int N, class Allocator >
Seldon::Array< T, N, Allocator >::Array ( int  i,
int  j,
int  k 
)

Main constructor.

Builds a i x j x k 3D array, but data is not initialized.

Parameters
ilength in dimension #1.
jlength in dimension #2.
klength in dimension #3.

Definition at line 62 of file Array.cxx.

◆ Array() [3/8]

template<class T , int N, class Allocator >
Seldon::Array< T, N, Allocator >::Array ( int  i,
int  j,
int  k,
int  l 
)

Main constructor.

Builds a i x j x k x l 4D array, but data is not initialized.

Parameters
ilength in dimension #1.
jlength in dimension #2.
klength in dimension #3.
llength in dimension #4.

Definition at line 112 of file Array.cxx.

◆ Array() [4/8]

template<class T , int N, class Allocator >
Seldon::Array< T, N, Allocator >::Array ( int  i,
int  j,
int  k,
int  l,
int  m 
)

Main constructor.

Builds a i x j x k x l x m 5D array, but data is not initialized.

Parameters
ilength in dimension #1.
jlength in dimension #2.
klength in dimension #3.
llength in dimension #4.
mlength in dimension #5.

Definition at line 166 of file Array.cxx.

◆ Array() [5/8]

template<class T , int N, class Allocator >
Seldon::Array< T, N, Allocator >::Array ( int  i,
int  j,
int  k,
int  l,
int  m,
int  n 
)

Main constructor.

Builds a i x j x k x l x m x n 6D array, but data is not initialized.

Parameters
ilength in dimension #1.
jlength in dimension #2.
klength in dimension #3.
llength in dimension #4.
mlength in dimension #5.
nlength in dimension #6.

Definition at line 226 of file Array.cxx.

◆ Array() [6/8]

template<class T , int N, class Allocator >
Seldon::Array< T, N, Allocator >::Array ( int  i,
int  j,
int  k,
int  l,
int  m,
int  n,
int  o 
)

Main constructor.

Builds a i x j x k x l x m x n x o 7D array, but data is not initialized.

Parameters
ilength in dimension #1.
jlength in dimension #2.
klength in dimension #3.
llength in dimension #4.
mlength in dimension #5.
nlength in dimension #6.
olength in dimension #7.

Definition at line 294 of file Array.cxx.

◆ Array() [7/8]

template<class T , int N, class Allocator >
Seldon::Array< T, N, Allocator >::Array ( int  i,
int  j,
int  k,
int  l,
int  m,
int  n,
int  o,
int  p 
)

Main constructor.

Builds a i x j x k x l x m x n x o x p 8D array, but data is not initialized.

Parameters
ilength in dimension #1.
jlength in dimension #2.
klength in dimension #3.
llength in dimension #4.
mlength in dimension #5.
nlength in dimension #6.
olength in dimension #7.
plength in dimension #8.

Definition at line 366 of file Array.cxx.

◆ Array() [8/8]

template<class T , int N, class Allocator >
Seldon::Array< T, N, Allocator >::Array ( int  i,
int  j,
int  k,
int  l,
int  m,
int  n,
int  o,
int  p,
int  q 
)

Main constructor.

Builds a i x j x k x l x m x n x o x p x q 9D array, but data is not initialized.

Parameters
ilength in dimension #1.
jlength in dimension #2.
klength in dimension #3.
llength in dimension #4.
mlength in dimension #5.
nlength in dimension #6.
olength in dimension #7.
plength in dimension #8.
qlength in dimension #9.

Definition at line 443 of file Array.cxx.

Member Function Documentation

◆ Clear()

template<class T , int N, class Allocator >
void Seldon::Array< T, N, Allocator >::Clear

Clears the array.

Destructs the array.

Warning
On exit, the array is empty.

Definition at line 1053 of file Array.cxx.

◆ Copy()

template<class T , int N, class Allocator >
void Seldon::Array< T, N, Allocator >::Copy ( const Array< T, N, Allocator > &  A)

Duplicates an array.

Parameters
Aarray to be copied.
Note
Memory is duplicated: 'A' is therefore independent from the current instance after the copy.

Definition at line 1085 of file Array.cxx.

◆ Fill() [1/2]

template<class T , int N, class Allocator >
void Seldon::Array< T, N, Allocator >::Fill

Fills the array.

On exit, the array is filled with 1, 2, 3, 4, ... The order of those numbers depends on the storage.

Definition at line 1153 of file Array.cxx.

◆ Fill() [2/2]

template<class T , int N, class Allocator >
template<class T0 >
void Seldon::Array< T, N, Allocator >::Fill ( const T0 &  x)

Fills the array with a given value.

On exit, the array is filled with 'x'.

Parameters
xthe value to fill the array with.

Definition at line 1167 of file Array.cxx.

◆ FillRand()

template<class T , int N, class Allocator >
void Seldon::Array< T, N, Allocator >::FillRand

Fills the array randomly.

On exit, the array is filled with random values.

Definition at line 1181 of file Array.cxx.

◆ GetData()

template<class T , int N, class Allocator >
Array< T, N, Allocator >::pointer Seldon::Array< T, N, Allocator >::GetData
inline

Returns a pointer to the data array.

Returns a pointer to data, i.e. the data array 'data_' which stores the values.

Returns
A pointer to the data array.

Definition at line 91 of file ArrayInline.cxx.

◆ GetDataSize()

template<class T , int N, class Allocator >
long Seldon::Array< T, N, Allocator >::GetDataSize
inline

Returns the number of elements stored in memory.

Returns the number of elements stored in memory by the array, i.e. the product of lengths in the three dimensions.

Returns
The number of elements stored in the array.

Definition at line 77 of file ArrayInline.cxx.

◆ GetLength()

template<class T , int N, class Allocator >
int Seldon::Array< T, N, Allocator >::GetLength ( int  dimension) const
inline

Returns the length in dimension #1.

Parameters
dimensionindex for dimension.
Returns
The length in dimension #1.

Definition at line 50 of file ArrayInline.cxx.

◆ GetMemorySize()

template<class T , int N, class Allocator >
size_t Seldon::Array< T, N, Allocator >::GetMemorySize

Returns the memory used by the object in bytes.

In this method, the type T is assumed to be "static" such that sizeof(T) provides the correct size

Definition at line 1126 of file Array.cxx.

◆ GetSize()

template<class T , int N, class Allocator >
long Seldon::Array< T, N, Allocator >::GetSize
inline

Returns the number of elements in the 3D array.

Returns the number of elements stored by the 3D array, i.e. the product of the lengths in the three dimensions.

Returns
The number of elements in the 3D array.

Definition at line 63 of file ArrayInline.cxx.

◆ operator()() [1/14]

template<class T , int N, class Allocator >
Array< T, N, Allocator >::reference Seldon::Array< T, N, Allocator >::operator() ( int  i,
int  j,
int  k 
)
inline

Access operator.

Returns the value of element (i, j, k).

Parameters
iindex along dimension #1.
jindex along dimension #2.
kindex along dimension #3.
Returns
Element (i, j, k) of the 3D array.

Definition at line 112 of file ArrayInline.cxx.

◆ operator()() [2/14]

template<class T , int N, class Allocator >
Array< T, N, Allocator >::const_reference Seldon::Array< T, N, Allocator >::operator() ( int  i,
int  j,
int  k 
) const
inline

Access operator.

Returns the value of element (i, j, k).

Parameters
iindex along dimension #1.
jindex along dimension #2.
kindex along dimension #3.
Returns
Element (i, j, k) of the 3D array.

Definition at line 136 of file ArrayInline.cxx.

◆ operator()() [3/14]

template<class T , int N, class Allocator >
Array< T, N, Allocator >::reference Seldon::Array< T, N, Allocator >::operator() ( int  i,
int  j,
int  k,
int  l 
)
inline

Access operator.

Returns the value of element (i, j, k, l).

Parameters
iindex along dimension #1.
jindex along dimension #2.
kindex along dimension #3.
lindex along dimension #4.
Returns
Element (i, j, k, l) of the 4D array.

Definition at line 161 of file ArrayInline.cxx.

◆ operator()() [4/14]

template<class T , int N, class Allocator >
Array< T, N, Allocator >::const_reference Seldon::Array< T, N, Allocator >::operator() ( int  i,
int  j,
int  k,
int  l 
) const
inline

Access operator.

Returns the value of element (i, j, k, l).

Parameters
iindex along dimension #1.
jindex along dimension #2.
kindex along dimension #3.
lindex along dimension #4.
Returns
Element (i, j, k, l) of the 4D array.

Definition at line 187 of file ArrayInline.cxx.

◆ operator()() [5/14]

template<class T , int N, class Allocator >
Array< T, N, Allocator >::reference Seldon::Array< T, N, Allocator >::operator() ( int  i,
int  j,
int  k,
int  l,
int  m 
)
inline

Access operator.

Returns the value of element (i, j, k, l, m).

Parameters
iindex along dimension #1.
jindex along dimension #2.
kindex along dimension #3.
lindex along dimension #4.
mindex along dimension #5.
Returns
Element (i, j, k, l, m) of the 5D array.

Definition at line 214 of file ArrayInline.cxx.

◆ operator()() [6/14]

template<class T , int N, class Allocator >
Array< T, N, Allocator >::const_reference Seldon::Array< T, N, Allocator >::operator() ( int  i,
int  j,
int  k,
int  l,
int  m 
) const
inline

Access operator.

Returns the value of element (i, j, k, l, m).

Parameters
iindex along dimension #1.
jindex along dimension #2.
kindex along dimension #3.
lindex along dimension #4.
mindex along dimension #5.
Returns
Element (i, j, k, l, m) of the 5D array.

Definition at line 242 of file ArrayInline.cxx.

◆ operator()() [7/14]

template<class T , int N, class Allocator >
Array< T, N, Allocator >::reference Seldon::Array< T, N, Allocator >::operator() ( int  i,
int  j,
int  k,
int  l,
int  m,
int  n 
)
inline

Access operator.

Returns the value of element (i, j, k, l, m, n).

Parameters
iindex along dimension #1.
jindex along dimension #2.
kindex along dimension #3.
lindex along dimension #4.
mindex along dimension #5.
nindex along dimension #6.
Returns
Element (i, j, k, l, m, n) of the 6D array.

Definition at line 272 of file ArrayInline.cxx.

◆ operator()() [8/14]

template<class T , int N, class Allocator >
Array< T, N, Allocator >::const_reference Seldon::Array< T, N, Allocator >::operator() ( int  i,
int  j,
int  k,
int  l,
int  m,
int  n 
) const
inline

Access operator.

Returns the value of element (i, j, k, l, m, n).

Parameters
iindex along dimension #1.
jindex along dimension #2.
kindex along dimension #3.
lindex along dimension #4.
mindex along dimension #5.
nindex along dimension #6.
Returns
Element (i, j, k, l, m, n) of the 6D array.

Definition at line 302 of file ArrayInline.cxx.

◆ operator()() [9/14]

template<class T , int N, class Allocator >
Array< T, N, Allocator >::reference Seldon::Array< T, N, Allocator >::operator() ( int  i,
int  j,
int  k,
int  l,
int  m,
int  n,
int  o 
)
inline

Access operator.

Returns the value of element (i, j, k, l, m, n, o).

Parameters
iindex along dimension #1.
jindex along dimension #2.
kindex along dimension #3.
lindex along dimension #4.
mindex along dimension #5.
nindex along dimension #6.
oindex along dimension #7.
Returns
Element (i, j, k, l, m, n, o) of the 7D array.

Definition at line 333 of file ArrayInline.cxx.

◆ operator()() [10/14]

template<class T , int N, class Allocator >
Array< T, N, Allocator >::const_reference Seldon::Array< T, N, Allocator >::operator() ( int  i,
int  j,
int  k,
int  l,
int  m,
int  n,
int  o 
) const
inline

Access operator.

Returns the value of element (i, j, k, l, m, n, o).

Parameters
iindex along dimension #1.
jindex along dimension #2.
kindex along dimension #3.
lindex along dimension #4.
mindex along dimension #5.
nindex along dimension #6.
oindex along dimension #7.
Returns
Element (i, j, k, l, m, n, o) of the 7D array.

Definition at line 364 of file ArrayInline.cxx.

◆ operator()() [11/14]

template<class T , int N, class Allocator >
Array< T, N, Allocator >::reference Seldon::Array< T, N, Allocator >::operator() ( int  i,
int  j,
int  k,
int  l,
int  m,
int  n,
int  o,
int  p 
)
inline

Access operator.

Returns the value of element (i, j, k, l, m, n, o, p).

Parameters
iindex along dimension #1.
jindex along dimension #2.
kindex along dimension #3.
lindex along dimension #4.
mindex along dimension #5.
nindex along dimension #6.
oindex along dimension #7.
pindex along dimension #8.
Returns
Element (i, j, k, l, m, n, o, p) of the 8D array.

Definition at line 396 of file ArrayInline.cxx.

◆ operator()() [12/14]

template<class T , int N, class Allocator >
Array< T, N, Allocator >::const_reference Seldon::Array< T, N, Allocator >::operator() ( int  i,
int  j,
int  k,
int  l,
int  m,
int  n,
int  o,
int  p 
) const
inline

Access operator.

Returns the value of element (i, j, k, l, m, n, o, p).

Parameters
iindex along dimension #1.
jindex along dimension #2.
kindex along dimension #3.
lindex along dimension #4.
mindex along dimension #5.
nindex along dimension #6.
oindex along dimension #7.
pindex along dimension #8.
Returns
Element (i, j, k, l, m, n, o, p) of the 8D array.

Definition at line 430 of file ArrayInline.cxx.

◆ operator()() [13/14]

template<class T , int N, class Allocator >
Array< T, N, Allocator >::reference Seldon::Array< T, N, Allocator >::operator() ( int  i,
int  j,
int  k,
int  l,
int  m,
int  n,
int  o,
int  p,
int  q 
)
inline

Access operator.

Returns the value of element (i, j, k, l, m, n, o, p, q).

Parameters
iindex along dimension #1.
jindex along dimension #2.
kindex along dimension #3.
lindex along dimension #4.
mindex along dimension #5.
nindex along dimension #6.
oindex along dimension #7.
pindex along dimension #8.
qindex along dimension #9.
Returns
Element (i, j, k, l, m, n, o, p, q) of the 9D array.

Definition at line 464 of file ArrayInline.cxx.

◆ operator()() [14/14]

template<class T , int N, class Allocator >
Array< T, N, Allocator >::const_reference Seldon::Array< T, N, Allocator >::operator() ( int  i,
int  j,
int  k,
int  l,
int  m,
int  n,
int  o,
int  p,
int  q 
) const
inline

Access operator.

Returns the value of element (i, j, k, l, m, n, o, p, q).

Parameters
iindex along dimension #1.
jindex along dimension #2.
kindex along dimension #3.
lindex along dimension #4.
mindex along dimension #5.
nindex along dimension #6.
oindex along dimension #7.
pindex along dimension #8.
qindex along dimension #9.
Returns
Element (i, j, k, l, m, n, o, p, q) of the 9D array.

Definition at line 499 of file ArrayInline.cxx.

◆ operator=()

template<class T , int N, class Allocator >
Array< T, N, Allocator > & Seldon::Array< T, N, Allocator >::operator= ( const Array< T, N, Allocator > &  A)
inline

Duplicates an array (assignment operator).

Parameters
Aarray to be copied.
Note
Memory is duplicated: 'A' is therefore independent from the current instance after the copy.

Definition at line 526 of file ArrayInline.cxx.

◆ Print()

template<class T , int N, class Allocator >
void Seldon::Array< T, N, Allocator >::Print

Displays the array on the standard output.

Displays elements on the standard output, in text format.

Definition at line 1196 of file Array.cxx.

◆ Read() [1/2]

template<class T , int N, class Allocator >
void Seldon::Array< T, N, Allocator >::Read ( ifstream &  FileStream,
bool  with_size = true 
)

Reads the array from an input stream.

Reads a array in binary format from an input stream. The dimensions (integers) of the array are read, and array elements are then read in the same order as it should be in memory.

Parameters
FileStreaminput stream.

Definition at line 1500 of file Array.cxx.

◆ Read() [2/2]

template<class T , int N, class Allocator >
void Seldon::Array< T, N, Allocator >::Read ( string  FileName,
bool  with_size = true 
)

Reads the array from a file.

Reads a array stored in binary format in a file. The dimensions (integers) of the array are read, and array elements are then read in the same order as it should be in memory

Parameters
FileNameinput file name.

Definition at line 1473 of file Array.cxx.

◆ Reallocate() [1/7]

template<class T , int N, class Allocator >
void Seldon::Array< T, N, Allocator >::Reallocate ( int  i,
int  j,
int  k 
)

Reallocates memory to resize the 3D array.

On exit, the array is a i x j x k 3D array.

Parameters
ilength in dimension #1.
jlength in dimension #2.
klength in dimension #3.
Warning
Depending on your allocator, data may be lost.

Definition at line 532 of file Array.cxx.

◆ Reallocate() [2/7]

template<class T , int N, class Allocator >
void Seldon::Array< T, N, Allocator >::Reallocate ( int  i,
int  j,
int  k,
int  l 
)

Reallocates memory to resize the 4D array.

On exit, the array is a i x j x k x l 4D array.

Parameters
ilength in dimension #1.
jlength in dimension #2.
klength in dimension #3.
llength in dimension #4.
Warning
Depending on your allocator, data may be lost.

Definition at line 592 of file Array.cxx.

◆ Reallocate() [3/7]

template<class T , int N, class Allocator >
void Seldon::Array< T, N, Allocator >::Reallocate ( int  i,
int  j,
int  k,
int  l,
int  m 
)

Reallocates memory to resize the 5D array.

On exit, the array is a i x j x k x l x m 5D array.

Parameters
ilength in dimension #1.
jlength in dimension #2.
klength in dimension #3.
llength in dimension #4.
mlength in dimension #5.
Warning
Depending on your allocator, data may be lost.

Definition at line 658 of file Array.cxx.

◆ Reallocate() [4/7]

template<class T , int N, class Allocator >
void Seldon::Array< T, N, Allocator >::Reallocate ( int  i,
int  j,
int  k,
int  l,
int  m,
int  n 
)

Reallocates memory to resize the 6D array.

On exit, the array is a i x j x k x l x m x n 6D array.

Parameters
ilength in dimension #1.
jlength in dimension #2.
klength in dimension #3.
llength in dimension #4.
mlength in dimension #5.
nlength in dimension #6.
Warning
Depending on your allocator, data may be lost.

Definition at line 728 of file Array.cxx.

◆ Reallocate() [5/7]

template<class T , int N, class Allocator >
void Seldon::Array< T, N, Allocator >::Reallocate ( int  i,
int  j,
int  k,
int  l,
int  m,
int  n,
int  o 
)

Reallocates memory to resize the 7D array.

On exit, the array is a i x j x k x l x m x n x o 7D array.

Parameters
ilength in dimension #1.
jlength in dimension #2.
klength in dimension #3.
llength in dimension #4.
mlength in dimension #5.
nlength in dimension #6.
olength in dimension #7.
Warning
Depending on your allocator, data may be lost.

Definition at line 806 of file Array.cxx.

◆ Reallocate() [6/7]

template<class T , int N, class Allocator >
void Seldon::Array< T, N, Allocator >::Reallocate ( int  i,
int  j,
int  k,
int  l,
int  m,
int  n,
int  o,
int  p 
)

Reallocates memory to resize the 8D array.

On exit, the array is a i x j x k x l x m x n x o x p 8D array.

Parameters
ilength in dimension #1.
jlength in dimension #2.
klength in dimension #3.
llength in dimension #4.
mlength in dimension #5.
nlength in dimension #6.
olength in dimension #7.
plength in dimension #8.
Warning
Depending on your allocator, data may be lost.

Definition at line 887 of file Array.cxx.

◆ Reallocate() [7/7]

template<class T , int N, class Allocator >
void Seldon::Array< T, N, Allocator >::Reallocate ( int  i,
int  j,
int  k,
int  l,
int  m,
int  n,
int  o,
int  p,
int  q 
)

Reallocates memory to resize the 9D array.

On exit, the array is a i x j x k x l x m x n x o x p x q 9D array.

Parameters
ilength in dimension #1.
jlength in dimension #2.
klength in dimension #3.
llength in dimension #4.
mlength in dimension #5.
nlength in dimension #6.
olength in dimension #7.
plength in dimension #8.
qlength in dimension #9.
Warning
Depending on your allocator, data may be lost.

Definition at line 973 of file Array.cxx.

◆ Write() [1/2]

template<class T , int N, class Allocator >
void Seldon::Array< T, N, Allocator >::Write ( ofstream &  FileStream,
bool  with_size = true 
) const

Writes the array to an output stream.

Writes the array to an output stream in binary format. The dimensions (integerS) are written, and array elements are then written in the same order as in memory.

Parameters
FileStreamoutput stream.

Definition at line 1432 of file Array.cxx.

◆ Write() [2/2]

template<class T , int N, class Allocator >
void Seldon::Array< T, N, Allocator >::Write ( string  FileName,
bool  with_size = true 
) const

Writes the array in a file.

Stores the array in a file in binary format. The dimensions (integer) are written, and array elements are then written in the same order as in memory.

Parameters
FileNameoutput file name.

Definition at line 1406 of file Array.cxx.

◆ Zero()

template<class T , int N, class Allocator >
void Seldon::Array< T, N, Allocator >::Zero

Sets all elements to zero.

Warning
It fills the memory with zeros. If the array stores complex structures, use 'Fill' instead.

Definition at line 1140 of file Array.cxx.


The documentation for this class was generated from the following files: