Template Class Array4D

Class Documentation

template<typename T>
class Array4D

4D array class

Template Parameters:

T – Type of the array elements

Public Functions

inline Array4D(int i_total_, int j_total_, int k_total_, int l_total_)

Constructor.

Parameters:
  • i_total_ – Total size in x direction including margin

  • j_total_ – Total size in y direction including margin

  • k_total_ – Total size in z direction including margin

  • l_total_ – Total size in w direction

inline T &operator()(int i, int j, int k, int l)

overload function for accessing the 4D array elements

Parameters:
  • i – i index

  • j – j index

  • k – k index

  • l – l index

Returns:

Reference to the element at (i, j, k, l)

inline const T &operator()(int i, int j, int k, int l) const

overload function for accessing the 4D array elements (const version)

Parameters:
  • i – i index

  • j – j index

  • k – k index

  • l – l index

Returns:

inline T *data()

overload function for accessing the 4D array elements

inline const T *data() const

overload function for accessing the 4D array elements (const version)

inline int size_x() const

Get size in x direction.

inline int size_y() const

Get size in y direction.

inline int size_z() const

Get size in z direction.

inline int size_w() const

Get size in type direction.

inline int size() const

Get total size of the array.

inline void copy_from(const Array4D &other)

Copy elements from another Array4D object.

The dimensions of the other array must match the current array.

Parameters:

other – copy source array