356 {
357 if constexpr (requires { input.data.empty(); }) {
358 if (input.data.empty()) {
360 }
361 } else if constexpr (std::is_same_v<InputType, Kakshya::RegionGroup>) {
362 if (input.data.regions.empty()) {
364 }
365 }
366 try {
369
370 std::vector<std::span<const double>> channel_spans;
371 for (const auto& span : data_span)
372 channel_spans.emplace_back(span.data(), span.
size());
373
374 std::vector<std::vector<double>> stat_values;
375 stat_values.reserve(channel_spans.size());
376 for (const auto& ch_span : channel_spans) {
378 }
379
381 stat_values, channel_spans, structure_info);
382
385 } catch (const std::exception& e) {
388 error_result.
metadata = input.metadata;
389 error_result.metadata["error"] = std::string("Analysis failed: ") + e.what();
390 return error_result;
391 }
392 }
#define MF_ERROR(comp, ctx,...)
static std::tuple< std::vector< std::span< double > >, DataStructureInfo > extract_structured_double(T &compute_data)
Extract structured double data from Datum container or direct ComputeData with automatic container ha...
Datum< OutputType > output_type
Datum< 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.
void store_current_analysis(AnalysisResultType &&result) const
@ ComputeMatrix
Compute operations (Yantra - algorithms, matrices, DSP)
@ Yantra
DSP algorithms, computational units, matrix operations, Grammar.
std::unordered_map< std::string, std::any > metadata
Associated metadata.