Beluga named requirements: LinearGrid2

Linear grids use contiguous memory layouts, and thus afford integer indexes. Linear grids are dense grids, meaning they satisfy Beluga named requirements: DenseGrid2 requirements.

A type G satisfies LinearGrid2 requirements if it satisfies Beluga named requirements: DenseGrid2 and given g a possibly const instance of G:

  • g.data() returns a possibly const reference to an indexable, random access linear data structure containing grid cell data values;

  • given possibly const grid cell index i of std::size_t type, g.data_at(i) optionally returns cell data, if cell is included;

  • given possibly const grid cell index i of std::size_t type, g.coordinates_at(i) returns embedding space coordinates as an Eigen::Vector2d value;

  • given possibly const grid cell index i of std::size_t type, g.neighborhood4(i) computes the cell 4-connected neighborhood as a range of std::size_t indices.