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

Tests for Aleph::CA metric helpers (Phase 7). More...

#include <cmath>
#include <cstdint>
#include <vector>
#include <gtest/gtest.h>
#include <ca-metrics.H>
#include <ca-traits.H>
#include <tpl_ca_concepts.H>
#include <tpl_ca_graph_automaton.H>
#include <tpl_ca_lattice.H>
#include <tpl_ca_storage.H>
Include dependency graph for ca_metrics_test.cc:

Go to the source code of this file.

Functions

 TEST (CAMetrics, CountStateAndCountAliveAreConsistent)
 
 TEST (CAMetrics, DensityIsZeroOnEmptyLattice)
 
 TEST (CAMetrics, DensityMatchesCountOverTotal)
 
 TEST (CAMetrics, StateHistogramSumsToTotal)
 
 TEST (CAMetrics, ShannonEntropyZeroForUniformLattice)
 
 TEST (CAMetrics, ShannonEntropyForBalancedBinaryReachesLn2)
 
 TEST (CAMetrics, FrameHashEqualForEqualFrames)
 
 TEST (CAMetrics, FrameHashDiffersForDifferentFrames)
 
 TEST (CAMetrics, FrameHashStableAcrossLatticeReconstruction)
 
 TEST (CAMetrics, CellDiffCountMatchesActivity)
 
 TEST (CAMetrics, ForEachCellWalksRank1And3LatticesToo)
 
 TEST (CAMetrics, MetricsWorkOnGraphLattice)
 

Detailed Description

Tests for Aleph::CA metric helpers (Phase 7).

Scope:

  • count_state, count_alive, density on rectangular and graph lattices.
  • state_histogram and shannon_entropy edge cases.
  • frame_hash determinism: identical frames hash the same; the hash is stable across an entire test process.
  • frames_equal and cell_diff_count consistency with frame_hash.
  • for_each_cell visits every cell in row-major order.

Definition in file ca_metrics_test.cc.

Function Documentation

◆ TEST() [1/12]

TEST ( CAMetrics  ,
CellDiffCountMatchesActivity   
)

Definition at line 167 of file ca_metrics_test.cc.

References Aleph::CA::cell_diff_count().

◆ TEST() [2/12]

TEST ( CAMetrics  ,
CountStateAndCountAliveAreConsistent   
)

Definition at line 69 of file ca_metrics_test.cc.

References Aleph::CA::count_alive(), and Aleph::CA::count_state().

◆ TEST() [3/12]

TEST ( CAMetrics  ,
DensityIsZeroOnEmptyLattice   
)

Definition at line 85 of file ca_metrics_test.cc.

References Aleph::CA::alive_density(), and Aleph::CA::density().

◆ TEST() [4/12]

TEST ( CAMetrics  ,
DensityMatchesCountOverTotal   
)

Definition at line 92 of file ca_metrics_test.cc.

References Aleph::CA::alive_density(), and Aleph::CA::density().

◆ TEST() [5/12]

TEST ( CAMetrics  ,
ForEachCellWalksRank1And3LatticesToo   
)

Definition at line 185 of file ca_metrics_test.cc.

References Aleph::CA::for_each_cell().

◆ TEST() [6/12]

TEST ( CAMetrics  ,
FrameHashDiffersForDifferentFrames   
)

Definition at line 143 of file ca_metrics_test.cc.

References Aleph::CA::frame_hash(), and Aleph::CA::frames_equal().

◆ TEST() [7/12]

TEST ( CAMetrics  ,
FrameHashEqualForEqualFrames   
)

Definition at line 131 of file ca_metrics_test.cc.

References Aleph::CA::frame_hash(), and Aleph::CA::frames_equal().

◆ TEST() [8/12]

TEST ( CAMetrics  ,
FrameHashStableAcrossLatticeReconstruction   
)

Definition at line 153 of file ca_metrics_test.cc.

References Aleph::CA::frame_hash().

◆ TEST() [9/12]

◆ TEST() [10/12]

TEST ( CAMetrics  ,
ShannonEntropyForBalancedBinaryReachesLn2   
)

Definition at line 121 of file ca_metrics_test.cc.

References Aleph::CA::shannon_entropy().

◆ TEST() [11/12]

TEST ( CAMetrics  ,
ShannonEntropyZeroForUniformLattice   
)

Definition at line 115 of file ca_metrics_test.cc.

References Aleph::CA::shannon_entropy().

◆ TEST() [12/12]

TEST ( CAMetrics  ,
StateHistogramSumsToTotal   
)

Definition at line 102 of file ca_metrics_test.cc.

References h, and Aleph::CA::state_histogram().