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

◆ max()

std::vector< double > MayaFlux::Kinesis::Discrete::max ( std::span< const double >  data,
size_t  n_windows,
uint32_t  hop_size,
uint32_t  window_size 
)

Maximum value per window.

Definition at line 436 of file Analysis.cpp.

437{
438 std::vector<double> out(n_windows);
439 std::vector<size_t> idx(n_windows);
440 std::iota(idx.begin(), idx.end(), 0);
441
442 Parallel::for_each(Parallel::par_unseq, idx.begin(), idx.end(),
443 [&](size_t i) {
444 const size_t start = i * hop_size;
445 auto w = data.subspan(start, std::min<size_t>(window_size, data.size() - start));
446 out[i] = *std::ranges::max_element(w);
447 });
448
449 return out;
450}

References max().

Referenced by max().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: