|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Von Neumann (L1) neighborhood of radius R in N dimensions.
More...
#include <tpl_ca_neighborhood.H>
Public Types | |
| using | coord_type = Coord_Vec< N > |
| Coordinate type accepted by for_each_offset. | |
Public Member Functions | |
| template<typename F > | |
| constexpr void | for_each_offset (const Coord_Vec< N > ¢er, F &&f) const |
| Apply a functor to each offset in the neighborhood. | |
Static Public Member Functions | |
| static constexpr std::size_t | radius () noexcept |
| Return the L1 radius of the neighborhood. | |
| static constexpr std::size_t | size () noexcept |
| Return the number of neighbours in the neighborhood. | |
Static Public Attributes | |
| static constexpr std::size_t | rank_v = N |
| Lattice dimension. | |
| static constexpr std::size_t | radius_v = R |
| L1 radius. | |
| static constexpr std::size_t | size_v = ca_neighborhood_detail::von_neumann_count<N, R>() |
| Number of neighbours (excluding center). | |
| static constexpr std::array< Offset_Vec< N >, size_v > | offsets = ca_neighborhood_detail::compute_von_neumann_offsets<N, R>() |
| Compile-time, canonical-ordered offsets array. | |
Von Neumann (L1) neighborhood of radius R in N dimensions.
Enumerates every offset whose |x|_1 lies in [1, R]. For 2D radius 1 this is the classic 4-neighbour cross.
Definition at line 290 of file tpl_ca_neighborhood.H.
| using Aleph::CA::Von_Neumann< N, R >::coord_type = Coord_Vec<N> |
Coordinate type accepted by for_each_offset.
Definition at line 303 of file tpl_ca_neighborhood.H.
|
inlineconstexpr |
Apply a functor to each offset in the neighborhood.
| F | functor type. |
| [in] | center | the coordinate of the center cell (unused). |
| [in] | f | functor to apply to each Offset_Vec<N>. |
Definition at line 334 of file tpl_ca_neighborhood.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Von_Neumann< N, R >::offsets, and Aleph::CA::Von_Neumann< N, R >::size_v.
Referenced by TEST().
|
inlinestaticconstexprnoexcept |
Return the L1 radius of the neighborhood.
R. Definition at line 315 of file tpl_ca_neighborhood.H.
References Aleph::CA::R.
|
inlinestaticconstexprnoexcept |
Return the number of neighbours in the neighborhood.
size_v. Definition at line 323 of file tpl_ca_neighborhood.H.
References Aleph::CA::Von_Neumann< N, R >::size_v.
|
staticconstexpr |
Compile-time, canonical-ordered offsets array.
Contains all size_v offsets satisfying 1 <= |off|_1 <= R.
Definition at line 309 of file tpl_ca_neighborhood.H.
Referenced by Aleph::CA::Von_Neumann< N, R >::for_each_offset().
|
staticconstexpr |
L1 radius.
Definition at line 299 of file tpl_ca_neighborhood.H.
|
staticconstexpr |
Lattice dimension.
Definition at line 297 of file tpl_ca_neighborhood.H.
|
staticconstexpr |
Number of neighbours (excluding center).
Definition at line 301 of file tpl_ca_neighborhood.H.
Referenced by Aleph::CA::Von_Neumann< N, R >::for_each_offset(), and Aleph::CA::Von_Neumann< N, R >::size().