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

◆ compute_max_statistic()

std::vector< double > MayaFlux::Yantra::compute_max_statistic ( std::span< const double >  data,
const size_t  num_windows,
const uint32_t  hop_size,
const uint32_t  window_size 
)

Compute max statistic using zero-copy processing.

Definition at line 666 of file AnalysisHelper.cpp.

667{
668 std::vector<double> max_values(num_windows);
669
670 std::vector<size_t> indices(num_windows);
671 std::iota(indices.begin(), indices.end(), 0);
672
673 std::for_each(std::execution::par_unseq, indices.begin(), indices.end(),
674 [&](size_t i) {
675 const size_t start_idx = i * hop_size;
676 const size_t end_idx = std::min(start_idx + window_size, data.size());
677 auto window = data.subspan(start_idx, end_idx - start_idx);
678
679 max_values[i] = *std::ranges::max_element(window);
680 });
681
682 return max_values;
683}

References compute_max_statistic().

Referenced by compute_max_statistic(), and MayaFlux::Yantra::StatisticalAnalyzer< InputType, OutputType >::compute_statistical_values().

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