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

◆ set_analysis_parameter()

template<ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = Eigen::VectorXd>
void MayaFlux::Yantra::StatisticalAnalyzer< InputType, OutputType >::set_analysis_parameter ( const std::string &  name,
std::any  value 
)
inlineoverrideprotectedvirtual

Handle analysis-specific parameters.

Reimplemented from MayaFlux::Yantra::UniversalAnalyzer< InputType, OutputType >.

Definition at line 440 of file StatisticalAnalyzer.hpp.

441 {
442 try {
443 if (name == "method") {
444 try {
445 auto method_str = safe_any_cast_or_throw<std::string>(value);
446 m_method = string_to_method(method_str);
447 } catch (const std::runtime_error&) {
448 auto method_enum = safe_any_cast_or_throw<StatisticalMethod>(value);
449 m_method = method_enum;
450 }
451 } else if (name == "window_size") {
452 auto size = safe_any_cast_or_throw<uint32_t>(value);
455 } else if (name == "hop_size") {
456 auto size = safe_any_cast_or_throw<uint32_t>(value);
459 } else if (name == "classification_enabled") {
460 auto enabled = safe_any_cast_or_throw<bool>(value);
461 m_classification_enabled = enabled;
462 } else if (name == "percentile") {
463 auto percentile = safe_any_cast_or_throw<double>(value);
464 if (percentile < 0.0 || percentile > 100.0) {
465 error<std::invalid_argument>(Journal::Component::Yantra, Journal::Context::ComputeMatrix, std::source_location::current(), "Percentile must be between 0.0 and 100.0, got: {}", percentile);
466 }
468 } else if (name == "sample_variance") {
469 auto sample = safe_any_cast_or_throw<bool>(value);
470 m_sample_variance = sample;
471 } else {
473 }
474 } catch (const std::runtime_error& e) {
475 error_rethrow(Journal::Component::Yantra, Journal::Context::ComputeMatrix, std::source_location::current(), "Failed to set parameter '{}': {}", name, e.what());
476 }
477 }
bool size
glm::vec3 value
std::string name
Definition VKDevice.cpp:123
void validate_window_parameters() const
Validate window parameters.
static StatisticalMethod string_to_method(const std::string &str)
Convert string to statistical method enum.
virtual void set_analysis_parameter(const std::string &name, std::any value)
Analysis-specific parameter handling (override for custom parameters)
@ ComputeMatrix
Compute operations (Yantra - algorithms, matrices, DSP)
void error_rethrow(Component component, Context context, std::source_location location=std::source_location::current(), std::string_view additional_context="")
Catch and log an exception, then rethrow it.
@ Yantra
DSP algorithms, computational units, matrix operations, Grammar.
std::vector< double > percentile(std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size, double percentile_value)
Arbitrary percentile per window via linear interpolation.
Definition Analysis.cpp:350

References MayaFlux::Journal::ComputeMatrix, MayaFlux::Yantra::StatisticalAnalyzer< InputType, OutputType >::m_classification_enabled, MayaFlux::Yantra::StatisticalAnalyzer< InputType, OutputType >::m_hop_size, MayaFlux::Yantra::StatisticalAnalyzer< InputType, OutputType >::m_method, MayaFlux::Yantra::StatisticalAnalyzer< InputType, OutputType >::m_percentile_value, MayaFlux::Yantra::StatisticalAnalyzer< InputType, OutputType >::m_sample_variance, MayaFlux::Yantra::StatisticalAnalyzer< InputType, OutputType >::m_window_size, name, MayaFlux::Yantra::UniversalAnalyzer< InputType, OutputType >::set_analysis_parameter(), size, MayaFlux::Yantra::StatisticalAnalyzer< InputType, OutputType >::string_to_method(), MayaFlux::Yantra::StatisticalAnalyzer< InputType, OutputType >::validate_window_parameters(), value, and MayaFlux::Journal::Yantra.

+ Here is the call graph for this function: