MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ coupled_map_lattice()

MAYAFLUX_API double MayaFlux::Kinesis::Discrete::coupled_map_lattice ( std::span< const double >  window,
std::span< double >  coefs 
)
noexcept

Ring of logistic maps with nearest neighbour coupling.

Each call maps every cell, f(x) = r x (1 - x), then mixes each cell with its two neighbours (periodic): x' = (1 - eps) f(x) + eps / 2 (f(left) + f(right)). Returns the mean cell minus one half. Uniform cells stay uniform; different cells give the pattern formation the coupling allows.

Definition at line 561 of file Kernels.cpp.

562{
563 if (coefs.size() < 3)
564 return 0.0;
565
566 const auto n = static_cast<size_t>(std::max(coefs.front(), 0.0));
567 if (n == 0 || coefs.size() < 3 + 2 * n)
568 return 0.0;
569
570 const double r = coefs[1];
571 const double epsilon = coefs[2];
572 const auto cells = coefs.subspan(3, n);
573 const auto mapped = coefs.subspan(3 + n, n);
574
575 logistic_map(cells.data(), mapped.data(), r, n);
576 blend_neighbours(cells.data(), mapped.data(), epsilon, n);
577 return sum_of(cells) / static_cast<double>(n) - 0.5;
578}