Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
tpl_ca_ghost_lattice_test.cc File Reference

Full-coverage tests for Aleph::CA::Ghost_Lattice (Phase 4). More...

#include <array>
#include <cstdint>
#include <stdexcept>
#include <gtest/gtest.h>
#include <ca-traits.H>
#include <tpl_ca_concepts.H>
#include <tpl_ca_storage.H>
#include <tpl_ca_lattice.H>
#include <tpl_ca_ghost_lattice.H>
#include <tpl_ca_neighborhood.H>
#include <tpl_ca_rule.H>
#include <tpl_ca_engine.H>
Include dependency graph for tpl_ca_ghost_lattice_test.cc:

Go to the source code of this file.

Functions

 TEST (CAGhostLatticeStrictAccess, InRangeMatchesStampedValues)
 
 TEST (CAGhostLatticeStrictAccess, OutOfRangeThrows)
 
 TEST (CAGhostLatticeShape, DimensionSizeExtentsHaloRadius)
 
 TEST (CAGhostLatticeShape, SizeAxisOutOfRangeThrows)
 
 TEST (CAGhostLatticeShapeEmptyExtents, OneDimensionalEmptyIsStable)
 
 TEST (CAGhostLatticeShapeEmptyExtents, TwoDimensionalEmptyAxesAreStable)
 
 TEST (CAGhostLatticeFill, FillSetsOnlyInteriorUntilRefresh)
 
 TEST (CAGhostLatticeHalo, OpenBoundaryHaloIsZero)
 
 TEST (CAGhostLatticeHalo, DirichletConstantValueHalo)
 
 TEST (CAGhostLatticeHalo, PeriodicHaloCopiesOppositeEdge)
 
 TEST (CAGhostLatticeHalo, ReflectiveHaloMirrorsInterior)
 
 TEST (CAGhostLatticeHalo, NeumannHaloClampsToBoundary)
 
template<typename Boundary >
static void expect_equivalent_at_safe ()
 
 TEST (CAGhostLatticeEquivalence, OpenMatchesClassic)
 
 TEST (CAGhostLatticeEquivalence, ToroidalMatchesClassic)
 
 TEST (CAGhostLatticeEquivalence, ReflectiveMatchesClassic)
 
 TEST (CAGhostLatticeEquivalence, NeumannMatchesClassic)
 
 TEST (CAGhostLatticeEquivalence, DirichletMatchesClassic)
 
 TEST (CAGhostLatticeHaloRadius2, BothRingsCarryPolicyValues)
 
 TEST (CAGhostLattice1D, PeriodicHaloAndEquivalence)
 
 TEST (CAGhostLattice3D, ReflectiveCornerConsistency)
 
 TEST (CAGhostLattice, SwapExchangesContents)
 
template<typename Boundary >
static void run_engine_equivalence (std::size_t steps)
 
 TEST (CAGhostEngineEquivalence, OpenBoundaryAt100Steps)
 
 TEST (CAGhostEngineEquivalence, ToroidalBoundaryAt150Steps)
 
 TEST (CAGhostEngineEquivalence, ReflectiveBoundaryAt120Steps)
 
 TEST (CAGhostEngineEquivalence, NeumannBoundaryAt100Steps)
 
 TEST (CAGhostEngineEquivalence, DirichletZeroAt100Steps)
 
 TEST (CAGhostEngineEquivalence, DirichletOneAt50Steps)
 
 TEST (CAGhostEngineRadius2, VonNeumannR2EquivalenceOnDirichlet)
 

Detailed Description

Full-coverage tests for Aleph::CA::Ghost_Lattice (Phase 4).

Scope:

  • Concept conformance (LatticeLike).
  • Strict at/set bounds-check semantics.
  • refresh_halo fills the halo correctly for every policy.
  • at_safe on the ghost lattice matches the classic Lattice at every in-halo coordinate, for every boundary policy (Open, Periodic/Toroidal, Reflective, Dirichlet/Constant, Neumann).
  • Engine equivalence: running Conway's Game of Life through the Synchronous_Engine for 100+ steps on a classic Lattice and on a Ghost_Lattice yields bit-identical states.
  • Halo radius >= 2 also works.
  • 1D and 3D sanity checks.

Definition in file tpl_ca_ghost_lattice_test.cc.

Function Documentation

◆ expect_equivalent_at_safe()

template<typename Boundary >
static void expect_equivalent_at_safe ( )
static

◆ run_engine_equivalence()

template<typename Boundary >
static void run_engine_equivalence ( std::size_t  steps)
static

◆ TEST() [1/28]

TEST ( CAGhostEngineEquivalence  ,
DirichletOneAt50Steps   
)

◆ TEST() [2/28]

TEST ( CAGhostEngineEquivalence  ,
DirichletZeroAt100Steps   
)

◆ TEST() [3/28]

TEST ( CAGhostEngineEquivalence  ,
NeumannBoundaryAt100Steps   
)

◆ TEST() [4/28]

TEST ( CAGhostEngineEquivalence  ,
OpenBoundaryAt100Steps   
)

◆ TEST() [5/28]

TEST ( CAGhostEngineEquivalence  ,
ReflectiveBoundaryAt120Steps   
)

◆ TEST() [6/28]

TEST ( CAGhostEngineEquivalence  ,
ToroidalBoundaryAt150Steps   
)

◆ TEST() [7/28]

◆ TEST() [8/28]

TEST ( CAGhostLattice  ,
SwapExchangesContents   
)

◆ TEST() [9/28]

TEST ( CAGhostLattice1D  ,
PeriodicHaloAndEquivalence   
)

◆ TEST() [10/28]

TEST ( CAGhostLattice3D  ,
ReflectiveCornerConsistency   
)

Definition at line 411 of file tpl_ca_ghost_lattice_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), k, and l.

◆ TEST() [11/28]

TEST ( CAGhostLatticeEquivalence  ,
DirichletMatchesClassic   
)

◆ TEST() [12/28]

TEST ( CAGhostLatticeEquivalence  ,
NeumannMatchesClassic   
)

◆ TEST() [13/28]

TEST ( CAGhostLatticeEquivalence  ,
OpenMatchesClassic   
)

◆ TEST() [14/28]

TEST ( CAGhostLatticeEquivalence  ,
ReflectiveMatchesClassic   
)

◆ TEST() [15/28]

TEST ( CAGhostLatticeEquivalence  ,
ToroidalMatchesClassic   
)

◆ TEST() [16/28]

TEST ( CAGhostLatticeFill  ,
FillSetsOnlyInteriorUntilRefresh   
)

◆ TEST() [17/28]

TEST ( CAGhostLatticeHalo  ,
DirichletConstantValueHalo   
)

◆ TEST() [18/28]

TEST ( CAGhostLatticeHalo  ,
NeumannHaloClampsToBoundary   
)

◆ TEST() [19/28]

TEST ( CAGhostLatticeHalo  ,
OpenBoundaryHaloIsZero   
)

◆ TEST() [20/28]

TEST ( CAGhostLatticeHalo  ,
PeriodicHaloCopiesOppositeEdge   
)

◆ TEST() [21/28]

TEST ( CAGhostLatticeHalo  ,
ReflectiveHaloMirrorsInterior   
)

◆ TEST() [22/28]

TEST ( CAGhostLatticeHaloRadius2  ,
BothRingsCarryPolicyValues   
)

◆ TEST() [23/28]

TEST ( CAGhostLatticeShape  ,
DimensionSizeExtentsHaloRadius   
)

◆ TEST() [24/28]

TEST ( CAGhostLatticeShape  ,
SizeAxisOutOfRangeThrows   
)

◆ TEST() [25/28]

TEST ( CAGhostLatticeShapeEmptyExtents  ,
OneDimensionalEmptyIsStable   
)

◆ TEST() [26/28]

TEST ( CAGhostLatticeShapeEmptyExtents  ,
TwoDimensionalEmptyAxesAreStable   
)

◆ TEST() [27/28]

TEST ( CAGhostLatticeStrictAccess  ,
InRangeMatchesStampedValues   
)

◆ TEST() [28/28]

TEST ( CAGhostLatticeStrictAccess  ,
OutOfRangeThrows   
)