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

◆ logarithmic()

void MayaFlux::Kinesis::Discrete::logarithmic ( std::span< double >  data,
double  a,
double  b,
double  c,
double  base = std::numbers::e 
)
noexcept

Logarithmic map y = a * log_base(b*x + c) applied in-place Values where (b*x + c) <= 0 are mapped to 0.

Scalar transcendental — not SIMD hot-path.

Parameters
dataTarget span
aScale factor
bInput scale
cInput offset
baseLogarithm base (default: e)

Definition at line 34 of file Transform.cpp.

35{
36 const double log_factor = (base == std::numbers::e) ? 1.0 : (1.0 / std::log(base));
37 std::ranges::transform(data, data.begin(),
38 [a, b, c, log_factor](double x) {
39 const double arg = b * x + c;
40 return (arg > 0.0) ? a * std::log(arg) * log_factor : 0.0;
41 });
42}
size_t a
size_t b

References a, and b.