C++ signal processing
Find the first true element index from a boolean vector.
Namespace: dsp
dsp
int find_first(const Vecb &x)
let x = linspace(-2, 2, 5); // -2, -1, 0, 1, 2 let idx = find_first(x >= 0); // idx = 2
find(), find_last()