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

◆ set_reset_latch()

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

Memory cell: slot 0 sets it, slot 1 resets it, reset wins.

coefs: [threshold, state]. Holds while neither is high.

Definition at line 257 of file Boolean.cpp.

258{
259 if (inputs.size() < 2 || coefs.size() < 2)
260 return false;
261
262 if (inputs[1] > coefs[0])
263 coefs[1] = 0.0;
264 else if (inputs[0] > coefs[0])
265 coefs[1] = 1.0;
266 return coefs[1] > 0.5;
267}