39#define ALEPH_CA_C_API_BUILD 1
123 catch (
const std::bad_alloc &)
127 catch (
const std::exception &e)
152 *
rows =
static_cast<size_t>(
engine->engine.frame().size(0));
153 *
cols =
static_cast<size_t>(
engine->engine.frame().size(1));
166 auto &frame =
engine->engine.write_lattice();
167 if (
row >=
static_cast<size_t>(frame.size(0))
168 or col >=
static_cast<size_t>(frame.size(1)))
187 const auto &frame =
engine->engine.frame();
188 if (
row >=
static_cast<size_t>(frame.size(0))
189 or col >=
static_cast<size_t>(frame.size(1)))
212 catch (
const std::exception &e)
233 engine->engine.run(
static_cast<std::size_t
>(
steps));
236 catch (
const std::exception &e)
256 const auto &frame =
engine->engine.frame();
257 const size_t rows =
static_cast<size_t>(frame.size(0));
258 const size_t cols =
static_cast<size_t>(frame.size(1));
265 for (
size_t i = 0; i <
rows; ++i)
266 for (
size_t j = 0; j <
cols; ++j)
268 frame.at({static_cast<ca_index_t>(i), static_cast<ca_index_t>(j)}));
276 return static_cast<size_t>(
engine->engine.steps_run());
aleph_ca_engine_t * aleph_ca_create_gol_engine_v1(size_t rows, size_t cols)
int aleph_ca_copy_frame_v1(const aleph_ca_engine_t *engine, int32_t *out, size_t out_len)
void aleph_ca_destroy_engine_v1(aleph_ca_engine_t *engine)
int aleph_ca_extents_v1(const aleph_ca_engine_t *engine, size_t *rows, size_t *cols)
int aleph_ca_step_v1(aleph_ca_engine_t *engine)
int aleph_ca_set_cell_v1(aleph_ca_engine_t *engine, size_t row, size_t col, int32_t value)
int aleph_ca_run_v1(aleph_ca_engine_t *engine, size_t steps)
int aleph_ca_last_error_v1(void)
const char * aleph_ca_error_message_v1(void)
int aleph_ca_get_cell_v1(const aleph_ca_engine_t *engine, size_t row, size_t col, int32_t *out)
size_t aleph_ca_steps_run_v1(const aleph_ca_engine_t *engine)
uint32_t aleph_ca_api_version_v1(void)
size_t size_t int32_t value
size_t size_t int32_t * out
#define ALEPH_CA_API_VERSION_MAJOR
#define ALEPH_CA_API_VERSION_MINOR
Convenience builders for the Phase 3 synchronous engine.
Synchronous double-buffered engine.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
std::ptrdiff_t ca_index_t
Signed coordinate component used by lattices and neighborhoods.
Game_Of_Life_Engine make_gol_engine(ca_size_t rows, ca_size_t cols)
Build a Conway's Game of Life engine of the given shape.
std::size_t ca_size_t
Unsigned size component used for extents and counts.
Main namespace for Aleph-w library functions.
std::string code(Node *root)
Compute a string with the Lukasiewicz`s word of a tree.
Game_Of_Life_Engine engine
Synchronous double-buffered engine for cellular automata.
Cellular automata lattice with pluggable boundary policies.
Neighborhoods catalogue for Aleph::CA.
Rule mechanisms for Aleph::CA.
Dense, contiguous storage for cellular automata cells (1D/2D/3D).