|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Neighborhoods catalogue for Aleph::CA.
More...
#include <array>#include <cstddef>#include <span>#include <utility>#include <ah-errors.H>#include <ca-traits.H>#include <tpl_ca_concepts.H>Go to the source code of this file.
Classes | |
| class | Aleph::CA::Moore< N, R > |
Moore (Chebyshev) neighborhood of radius R in N dimensions. More... | |
| class | Aleph::CA::Von_Neumann< N, R > |
Von Neumann (L1) neighborhood of radius R in N dimensions. More... | |
| class | Aleph::CA::Hex_Neighborhood |
| Six-neighbour hex pattern in axial coordinates over a 2D lattice. More... | |
| class | Aleph::CA::Triangular_Neighborhood |
| Three edge-neighbours over a 2D lattice with parity coupling. More... | |
| class | Aleph::CA::Custom_Neighborhood< N, K, Radius > |
| User-supplied list of offsets for arbitrary connectivity. More... | |
Namespaces | |
| namespace | Aleph |
| Main namespace for Aleph-w library functions. | |
| namespace | Aleph::CA |
| namespace | Aleph::CA::ca_neighborhood_detail |
Functions | |
| constexpr std::size_t | Aleph::CA::ca_neighborhood_detail::static_pow (std::size_t base, std::size_t exp) noexcept |
| Compile-time integer power. | |
| template<std::size_t N, std::size_t R> | |
| constexpr std::size_t | Aleph::CA::ca_neighborhood_detail::von_neumann_count () noexcept |
Number of integer points in the L1 ball of radius R in N dimensions, excluding the origin. | |
| template<std::size_t N, std::size_t R> | |
| constexpr auto | Aleph::CA::ca_neighborhood_detail::compute_moore_offsets () noexcept |
Generate the canonical-ordered list of Moore offsets for N/R. | |
| template<std::size_t N, std::size_t R> | |
| constexpr auto | Aleph::CA::ca_neighborhood_detail::compute_von_neumann_offsets () noexcept |
Generate the canonical-ordered list of Von Neumann offsets for N/R (L1 radius). | |
| template<typename Nbh , typename L , typename T > | |
| void | Aleph::CA::gather_neighbors (const Nbh &nh, const L &lat, const typename L::coord_type ¢er, std::span< T > out) |
Populate out[0..nh.size()) with neighbour values of center. | |
Neighborhoods catalogue for Aleph::CA.
Provides:
Moore<N, R> — Chebyshev-radius neighborhood ((2R+1)^N - 1).Von_Neumann<N, R> — L1-radius neighborhood.Hex_Neighborhood — 6 axial-coord neighbours over a 2D lattice.Triangular_Neighborhood— 3 edge neighbours, parity-dependent.Custom_Neighborhood<N, K, Radius> — explicit list of offsets supplied at runtime.Every neighborhood satisfies the NeighborhoodLike concept and publishes a uniform compile-time API:
Plus a free function template:
which fills the caller-supplied stack buffer with the values returned by lat.at_safe(center + offset) in canonical order. No heap.
Definition in file tpl_ca_neighborhood.H.