351 {
352 if (input.data.empty()) {
353 throw std::runtime_error("Input is empty");
354 }
355 try {
358
359 std::vector<std::span<const double>> channel_spans;
360 for (const auto& span : data_span)
361 channel_spans.emplace_back(span.data(), span.size());
362
363 std::vector<std::vector<double>> stat_values;
364 stat_values.reserve(channel_spans.size());
365 for (const auto& ch_span : channel_spans) {
367 }
368
370 stat_values, channel_spans, structure_info);
371
374 } catch (const std::exception& e) {
375 std::cerr << "Energy analysis failed: " << e.what() << '\n';
377 error_result.
metadata = input.metadata;
378 error_result.metadata["error"] = std::string("Analysis failed: ") + e.what();
379 return error_result;
380 }
381 }
static std::tuple< std::vector< std::span< double > >, DataStructureInfo > extract_structured_double(T &compute_data)
Extract structured double data from IO container or direct ComputeData with automatic container handl...
IO< InputType > input_type
StatisticalMethod m_method
StatisticalAnalysis create_analysis_result(const std::vector< std::vector< double > > &stat_values, std::vector< std::span< const double > > original_data, const auto &) const
Create comprehensive analysis result.
std::vector< double > compute_statistical_values(std::span< const double > data, StatisticalMethod method) const
Compute statistical values using span (zero-copy processing)
output_type create_pipeline_output(const input_type &input, const StatisticalAnalysis &analysis_result, DataStructureInfo &info)
Create pipeline output for operation chaining.
IO< OutputType > output_type
void store_current_analysis(AnalysisResultType &&result) const
std::unordered_map< std::string, std::any > metadata
Associated metadata.