Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::CA::Triangular_Neighborhood Class Reference

Three edge-neighbours over a 2D lattice with parity coupling. More...

#include <tpl_ca_neighborhood.H>

Public Types

using coord_type = Coord_Vec< 2 >
 Coordinate type accepted by for_each_offset.
 

Static Public Member Functions

static constexpr std::size_t radius () noexcept
 Return the radius of the neighborhood (always 1).
 
static constexpr std::size_t size () noexcept
 Return the number of neighbours (always 3).
 
template<typename F >
static constexpr void for_each_offset (const Coord_Vec< 2 > &center, F &&f)
 Apply a functor to the three parity-dependent triangle offsets.
 

Static Public Attributes

static constexpr std::size_t rank_v = 2
 Lattice dimension.
 
static constexpr std::size_t radius_v = 1
 Chebyshev radius (always 1).
 
static constexpr std::size_t size_v = 3
 Number of neighbours (always 3).
 

Detailed Description

Three edge-neighbours over a 2D lattice with parity coupling.

Each cell is interpreted as a triangle whose orientation depends on (i + j) % 2. "Up" triangles (even parity) connect to (i, j-1), (i, j+1), (i+1, j); "down" triangles (odd parity) to (i, j-1), (i, j+1), (i-1, j). The third offset is therefore parity-dependent, so this class is the only one whose offsets cannot be cached as a static array.

Definition at line 416 of file tpl_ca_neighborhood.H.

Member Typedef Documentation

◆ coord_type

Coordinate type accepted by for_each_offset.

Definition at line 426 of file tpl_ca_neighborhood.H.

Member Function Documentation

◆ for_each_offset()

template<typename F >
static constexpr void Aleph::CA::Triangular_Neighborhood::for_each_offset ( const Coord_Vec< 2 > &  center,
F &&  f 
)
inlinestaticconstexpr

Apply a functor to the three parity-dependent triangle offsets.

Template Parameters
Ffunctor type.
Parameters
[in]centerthe coordinate of the center cell; parity is derived from (center[0] + center[1]) & 1.
[in]ffunctor to apply to each Offset_Vec<2>.

Definition at line 451 of file tpl_ca_neighborhood.H.

References Aleph::blossom_maximum_cardinality_matching().

◆ radius()

static constexpr std::size_t Aleph::CA::Triangular_Neighborhood::radius ( )
inlinestaticconstexprnoexcept

Return the radius of the neighborhood (always 1).

Returns
1.

Definition at line 431 of file tpl_ca_neighborhood.H.

◆ size()

static constexpr std::size_t Aleph::CA::Triangular_Neighborhood::size ( )
inlinestaticconstexprnoexcept

Return the number of neighbours (always 3).

Returns
3.

Definition at line 439 of file tpl_ca_neighborhood.H.

Member Data Documentation

◆ radius_v

constexpr std::size_t Aleph::CA::Triangular_Neighborhood::radius_v = 1
staticconstexpr

Chebyshev radius (always 1).

Definition at line 422 of file tpl_ca_neighborhood.H.

◆ rank_v

constexpr std::size_t Aleph::CA::Triangular_Neighborhood::rank_v = 2
staticconstexpr

Lattice dimension.

Definition at line 420 of file tpl_ca_neighborhood.H.

◆ size_v

constexpr std::size_t Aleph::CA::Triangular_Neighborhood::size_v = 3
staticconstexpr

Number of neighbours (always 3).

Definition at line 424 of file tpl_ca_neighborhood.H.


The documentation for this class was generated from the following file: