Beluga named requirements: DenseGrid2

Dense grids support random, indexed access to each cell. These grids have a finite extent and thus can hold cell data in finite memory. Dense grids are regular grids, meaning they satisfy Beluga named requirements: RegularGrid requirements.

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

  • g.width() returns the grid width, in grid cells along the grid x-axis, as an std::size_t value.

  • g.height() returns the grid height, in grid cells along the grid y-axis, as an std::size_t value.

  • given possibly const grid cell coordinates xi and yi of type int, g.contains(xi, yi) checks whether such cell is included in the grid;

  • given possibly const grid cell coordinates pi of Eigen::Vector2i type, g.contains(p) checks whether such cell is included in the grid;

  • given possibly const grid cell coordinates xi and yi of type int, g.index_at(xi, yi) retrieves the corresponding cell index of some type;

  • given possibly const grid cell coordinates pi of Eigen::Vector2i type, g.index_at(pi) retrieves the corresponding cell index of some type;

  • given possibly const grid cell coordinates xi and yi of type int, g.data_at(xi, yi) optionally returns cell data, if cell is included;

  • given possibly const grid cell coordinates pi of Eigen::Vector2i type, g.data_at(p) optionally returns cell data, if cell is included;

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

  • given possibly const embedding space coordinates x and y of type double, g.data_near(x, y) optionally returns cell data, if cell is included;

  • given possibly const embedding space coordinates p of Eigen::Vector2d type, g.data_near(p) optionally returns cell data, if cell is included;

  • given possibly const grid cell coordinates xi and yi of type int, g.neighborhood4(xi, yi) computes the cell 4-connected neighborhood as a range of Eigen::Vector2i type;

  • given possibly const grid cell coordinates pi of Eigen::Vector2i type, g.neighborhood4(p) computes the cell 4-connected neighborhood as a range of Eigen::Vector2i type.