33#ifndef ALEPH_REPRODUCTIONS_SOURCE_DIR
34# define ALEPH_REPRODUCTIONS_SOURCE_DIR "reproductions"
50 const auto start = std::chrono::steady_clock::now();
52 return std::chrono::duration<double>(std::chrono::steady_clock::now() - start).count();
59std::size_t population(
const Grid &frame)
61 std::size_t
count = 0;
63 for (
ca_size_t column = 0; column < frame.size(1); ++column)
64 if (frame.at({static_cast<ca_index_t>(row), static_cast<ca_index_t>(column)}) != 0)
75 constexpr std::int64_t
offset = 32;
96 std::filesystem::create_directories(
root /
"results");
97 std::ofstream
summary(
root /
"results" /
"game_of_life_bench.csv");
100 std::cerr <<
"Cannot write Game of Life benchmark\n";
103 summary <<
"engine,requested_generations,actual_generations,population,seconds\n"
109 std::cout <<
"Game of Life Gosper gun benchmark (informational only)\n"
110 <<
" dense step: " << std::fixed << std::setprecision(6)
115 std::cout <<
" population match: "
116 << (population(
dense.frame()) ==
hashlife.population() ?
"yes" :
"no")
Internal helpers shared by the cellular-automata reproductions.
Hashlife engine for outer-totalistic binary cellular automata.
Lattice that adds boundary-aware access on top of a storage.
Synchronous double-buffered engine.
#define ALEPH_REPRODUCTIONS_SOURCE_DIR
__gmp_expr< T, __gmp_binary_expr< __gmp_expr< T, U >, unsigned long int, __gmp_root_function > > root(const __gmp_expr< T, U > &expr, unsigned long int l)
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
const long double offset[]
Offset values indexed by symbol string length (bounded by MAX_OFFSET_INDEX)
void for_each_gosper_gun_cell(F &&visitor, const std::int64_t offset_x=0, const std::int64_t offset_y=0)
Visit every live coordinate in the canonical Gosper gun.
constexpr Game_Of_Life_Rule make_game_of_life_rule() noexcept
Build the canonical Game of Life rule.
std::size_t ca_size_t
Unsigned size component used for extents and counts.
Itor::difference_type count(const Itor &beg, const Itor &end, const T &value)
Count elements equal to a value.
Out-of-range neighbours behave as if the lattice ended.
Hashlife engine for outer-totalistic binary cellular automata.
Rule mechanisms for Aleph::CA.