|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Triangular lattice with parity helpers over a 2D storage. More...
#include <tpl_ca_triangular_lattice.H>
Public Types | |
| using | base_type = Lattice< Storage, Boundary > |
| using | state_type = typename base_type::state_type |
| using | coord_type = typename base_type::coord_type |
| using | extents_type = typename base_type::extents_type |
Public Types inherited from Aleph::CA::Lattice< Storage, Boundary > | |
| using | storage_type = Storage |
| using | boundary_type = Boundary |
| using | state_type = typename Storage::state_type |
| using | coord_type = typename Storage::coord_type |
| using | extents_type = typename Storage::extents_type |
Public Member Functions | |
| ca_size_t | rows () const noexcept |
| < inherit constructors | |
| ca_size_t | cols () const noexcept |
| Number of columns (axis 1). | |
| state_type | at_tri (Tri_Coord c) const |
| void | set_tri (Tri_Coord c, const state_type &v) |
Write cell value at triangular coords (i, j) (strict). | |
| state_type | at_tri_safe (Tri_Coord c) const |
| Boundary-aware read at triangular coords. | |
Public Member Functions inherited from Aleph::CA::Lattice< Storage, Boundary > | |
| Lattice ()=default | |
| Construct an empty lattice (no cells allocated). | |
| Lattice (const extents_type &extents, const state_type &init=state_type{}) | |
| Construct a lattice with the given extents and initial value. | |
| Lattice (Storage &&s) noexcept(std::is_nothrow_move_constructible_v< Storage >) | |
| Wrap an existing storage by move. | |
| ca_size_t | size () const noexcept |
| ca_size_t | size (std::size_t d) const |
| const extents_type & | extents () const noexcept |
| state_type | at (const coord_type &c) const |
Strict access: throws if c is out of range. | |
| void | set (const coord_type &c, const state_type &v) |
Strict write: throws if c is out of range. | |
| state_type | at_safe (coord_type c) const |
| Boundary-aware read. | |
| const Storage & | storage () const noexcept |
| Direct read access to the underlying storage (read-only). | |
| Storage & | storage () noexcept |
| Direct read-write access to the underlying storage. | |
| void | fill (const state_type &value) |
Set every cell to value. | |
| void | swap (Lattice &other) noexcept(noexcept(store_.swap(other.store_))) |
| O(1) swap. | |
Static Public Attributes | |
| static constexpr std::size_t | rank = base_type::rank |
Static Public Attributes inherited from Aleph::CA::Lattice< Storage, Boundary > | |
| static constexpr std::size_t | rank = Storage::rank |
Additional Inherited Members | |
Static Public Member Functions inherited from Aleph::CA::Lattice< Storage, Boundary > | |
| static constexpr std::size_t | dimension () noexcept |
Triangular lattice with parity helpers over a 2D storage.
Inherits the full Lattice API. Iteration order, double buffering and engine integration work the same way as for any rectangular lattice; the only difference is that the rule should consume Triangular_Neighborhood (three edge-neighbours, parity-aware) rather than Moore / Von Neumann.
| Storage | storage type (rank 2) satisfying LatticeLike. |
| Boundary | boundary tag, default OpenBoundary. |
Definition at line 150 of file tpl_ca_triangular_lattice.H.
| using Aleph::CA::Triangular_Lattice< Storage, Boundary >::base_type = Lattice<Storage, Boundary> |
Definition at line 155 of file tpl_ca_triangular_lattice.H.
| using Aleph::CA::Triangular_Lattice< Storage, Boundary >::coord_type = typename base_type::coord_type |
Definition at line 157 of file tpl_ca_triangular_lattice.H.
| using Aleph::CA::Triangular_Lattice< Storage, Boundary >::extents_type = typename base_type::extents_type |
Definition at line 158 of file tpl_ca_triangular_lattice.H.
| using Aleph::CA::Triangular_Lattice< Storage, Boundary >::state_type = typename base_type::state_type |
Definition at line 156 of file tpl_ca_triangular_lattice.H.
|
inline |
(i, j) (strict). Definition at line 170 of file tpl_ca_triangular_lattice.H.
References Aleph::CA::Lattice< Storage, Boundary >::at(), Aleph::CA::Tri_Coord::i, and Aleph::CA::Tri_Coord::j.
|
inline |
Boundary-aware read at triangular coords.
Definition at line 182 of file tpl_ca_triangular_lattice.H.
References Aleph::CA::Lattice< Storage, Boundary >::at_safe(), Aleph::CA::Tri_Coord::i, and Aleph::CA::Tri_Coord::j.
|
inlinenoexcept |
Number of columns (axis 1).
Definition at line 167 of file tpl_ca_triangular_lattice.H.
References Aleph::CA::Lattice< Storage, Boundary >::size().
|
inlinenoexcept |
< inherit constructors
Number of rows (axis 0).
Definition at line 164 of file tpl_ca_triangular_lattice.H.
References Aleph::CA::Lattice< Storage, Boundary >::size().
|
inline |
Write cell value at triangular coords (i, j) (strict).
Definition at line 176 of file tpl_ca_triangular_lattice.H.
References Aleph::CA::Tri_Coord::i, Aleph::CA::Tri_Coord::j, and Aleph::CA::Lattice< Storage, Boundary >::set().
|
staticconstexpr |
Definition at line 159 of file tpl_ca_triangular_lattice.H.