48 template <
typename T_GRID,
typename T_ARRAY>
70 const std::size_t
size()
const;
74 const T_GRID &
grid()
const;
88 const std::vector<T_ARRAY> &
data()
const {
return m_data; }
96 const T_ARRAY &
operator[](
const std::size_t idx)
const;
114 const T_ARRAY &
operator()(
const int i,
const int j,
const int k)
const;
124 T_ARRAY &
operator()(
const int i,
const int j,
const int k);
155 friend std::ostream &operator<<(std::ostream &out, const Array<T_GRID, T_ARRAY> &array)
158 const auto num_cells = array.
numCells();
160 for (
int i = 0; i < num_cells[0]; ++i)
161 for (
int j = 0; j < num_cells[1]; ++j)
162 for (
int k = 0; k < num_cells[2]; ++k) out <<
grid(i, j, k) <<
"\t" << array(i, j, k) <<
"\n";
168 const T_GRID &m_grid;
169 const int m_nx, m_ny, m_nz, m_pad;
170 std::vector<T_ARRAY> m_data;
const std::size_t size() const
const Vec3< int > numCells() const
Array(const Grid< typename T_GRID::value_type, T_GRID::dim > &grid)
const T_ARRAY & operator()(const int i, const int j, const int k) const
void operator=(const Array< T_GRID, T_ARRAY > &array)
const T_GRID & grid() const
const std::vector< T_ARRAY > & data() const
const T_ARRAY & operator[](const std::size_t idx) const