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

◆ signals_at_least()

MAYAFLUX_API bool MayaFlux::Kinesis::Discrete::signals_at_least ( const std::vector< double > &  inputs,
std::span< const double >  coefs 
)
noexcept

True when at least k of the input slots are high.

coefs: [threshold, k]. Coincidence at k equal to the slot count, any at 1, majority in between.

Definition at line 299 of file Boolean.cpp.

300{
301 if (coefs.size() < 2)
302 return false;
303
304 const double threshold = coefs[0];
305 const auto high = static_cast<size_t>(std::count_if(inputs.begin(), inputs.end(),
306 [threshold](double v) { return v > threshold; }));
307 return high >= index_of(coefs[1]);
308}
float threshold

References threshold.