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

◆ range()

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

Value range (max - min) per window.

Definition at line 452 of file Analysis.cpp.

453{
454 std::vector<double> out(n_windows);
455 std::vector<size_t> idx(n_windows);
456 std::iota(idx.begin(), idx.end(), 0);
457
458 Parallel::for_each(Parallel::par_unseq, idx.begin(), idx.end(),
459 [&](size_t i) {
460 const size_t start = i * hop_size;
461 auto w = data.subspan(start, std::min<size_t>(window_size, data.size() - start));
462 const auto [mn, mx] = std::ranges::minmax(w);
463 out[i] = mx - mn;
464 });
465
466 return out;
467}

References range().

Referenced by range().

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