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

◆ extract_structured_double()

template<OperationReadyData T>
requires (!detail::is_structured_operation_data_v<T>)
std::tuple< NumericChannels, DataStructureInfo > MayaFlux::Yantra::OperationHelper::extract_structured_double ( T & compute_data)
inlinestatic

Extract structured double data from Datum container or direct ComputeData with automatic container handling.

Template Parameters
TOperationReadyData type
Parameters
compute_dataor Datum container with data and optional container
Returns
Tuple of [channels, structure_info]. Keep the channels in scope while their spans are used.
Exceptions
std::runtime_errorif container required but not provided

Definition at line 561 of file OperationHelper.hpp.

562 {
563 if constexpr (is_IO<T>::value) {
564 DataStructureInfo info {};
565 info.original_type = std::type_index(typeid(std::decay_t<decltype(compute_data.data)>));
566 info.dimensions = compute_data.dimensions;
567 info.modality = compute_data.modality;
568
569 if constexpr (RequiresContainer<std::decay_t<decltype(compute_data.data)>>) {
570 const auto source = compute_data.get_container();
571 if (!source) {
572 error<std::runtime_error>(Journal::Component::Yantra, Journal::Context::ContainerProcessing, std::source_location::current(), "Container is required for region-like data extraction but not provided");
573 }
574 NumericChannels double_data = extract_numeric_data(compute_data.data, source);
575 return std::make_tuple(std::move(double_data), info);
576 } else if constexpr (requires { extract_numeric_data(compute_data.data, compute_data.needs_processig()); }) {
577 NumericChannels double_data = extract_numeric_data(compute_data.data, compute_data.needs_processig());
578 return std::make_tuple(std::move(double_data), info);
579 } else {
580 NumericChannels double_data = extract_numeric_data(compute_data.data);
581 return std::make_tuple(std::move(double_data), info);
582 }
583 } else {
584 DataStructureInfo info {};
585 info.original_type = std::type_index(typeid(T));
586 NumericChannels double_data = extract_numeric_data(compute_data);
587 auto [dimensions, modality] = infer_structure(compute_data);
588 info.dimensions = dimensions;
589 info.modality = modality;
590
591 return std::make_tuple(std::move(double_data), info);
592 }
593 }
static NumericChannels extract_numeric_data(const T &compute_data)
extract numeric data from single-variant types
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing).
@ Yantra
DSP algorithms, computational units, matrix operations, Grammar.
Source source()
Begin a Source chain.
Definition Plot.hpp:127
static std::pair< std::vector< Kakshya::DataDimension >, Kakshya::DataModality > infer_structure(const T &data, const std::shared_ptr< Kakshya::SignalSourceContainer > &container=nullptr)
Infer dimensions and modality from any ComputeData type.

References MayaFlux::Journal::ContainerProcessing, MayaFlux::Yantra::DataStructureInfo::dimensions, extract_numeric_data(), MayaFlux::Yantra::infer_structure(), MayaFlux::Yantra::DataStructureInfo::modality, MayaFlux::Yantra::DataStructureInfo::original_type, and MayaFlux::Journal::Yantra.

Referenced by MayaFlux::Yantra::EnergyAnalyzer< std::vector< Kakshya::DataVariant >, Eigen::MatrixXd >::analyze_implementation(), MayaFlux::Yantra::PhonemeAnalyzer< std::vector< Kakshya::DataVariant >, Eigen::MatrixXd >::analyze_implementation(), MayaFlux::Yantra::SpectralAnalyzer< std::vector< Kakshya::DataVariant >, Eigen::MatrixXd >::analyze_implementation(), MayaFlux::Yantra::StatisticalAnalyzer< std::vector< Kakshya::DataVariant >, Eigen::MatrixXd >::analyze_implementation(), MayaFlux::Yantra::VadAnalyzer< std::vector< Kakshya::DataVariant >, Eigen::MatrixXd >::analyze_implementation(), MayaFlux::Yantra::WaveformAnalyzer< std::vector< Kakshya::DataVariant >, Eigen::MatrixXd >::analyze_implementation(), MayaFlux::Yantra::WindowedKernelAnalyzer< std::vector< Kakshya::DataVariant >, Eigen::MatrixXd >::analyze_implementation(), MayaFlux::Yantra::ConvolutionTransformer< InputType, OutputType >::apply_per_channel(), MayaFlux::Yantra::MathematicalTransformer< InputType, OutputType >::apply_per_channel(), MayaFlux::Yantra::SpectralTransformer< InputType, OutputType >::apply_per_channel(), MayaFlux::Yantra::TemporalTransformer< InputType, OutputType >::apply_per_channel(), MayaFlux::Yantra::ConvolutionTransformer< InputType, OutputType >::create_output(), MayaFlux::Yantra::MathematicalTransformer< InputType, OutputType >::create_output(), MayaFlux::Yantra::SpectralTransformer< InputType, OutputType >::create_output(), MayaFlux::Yantra::TemporalTransformer< InputType, OutputType >::create_output(), MayaFlux::Yantra::FeatureExtractor< std::vector< Kakshya::DataVariant >, std::vector< std::vector< double > > >::extract_implementation(), MayaFlux::Yantra::IntervalExtractor< Eigen::MatrixXd, std::vector< std::vector< double > > >::extract_implementation(), MayaFlux::Yantra::PhonemeExtractor< std::vector< Kakshya::DataVariant >, Kakshya::CompositeArray >::extract_implementation(), MayaFlux::Yantra::SpeechSegmenter< std::vector< Kakshya::DataVariant >, Kakshya::RegionGroup >::extract_implementation(), MayaFlux::Yantra::GpuExecutionContext< std::vector< Kakshya::DataVariant >, std::vector< Kakshya::DataVariant > >::extract_inputs(), setup_operation_buffer(), MayaFlux::Yantra::StandardSorter< std::vector< Kakshya::DataVariant > >::sort_chunked(), MayaFlux::Yantra::IntervalExtractor< Eigen::MatrixXd, std::vector< std::vector< double > > >::submit(), MayaFlux::Yantra::transform_by_energy(), MayaFlux::Yantra::transform_channel_operation(), MayaFlux::Yantra::transform_crossfade_regions(), MayaFlux::Yantra::transform_matrix(), MayaFlux::Yantra::transform_matrix_multichannel(), MayaFlux::Yantra::transform_outliers(), and MayaFlux::Yantra::transform_regions().

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