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

◆ recreate_eigen_matrix() [1/2]

Eigen::MatrixXd MayaFlux::Yantra::OperationHelper::recreate_eigen_matrix ( const std::vector< std::span< const double > > &  spans,
const DataStructureInfo structure_info 
)
staticprivate

Infer data structure from ComputeData type.

Template Parameters
TComputeData type
Parameters
compute_dataInput data
containerOptional container for region-like types
Returns
Pair of (dimensions, modality)

Definition at line 103 of file OperationHelper.cpp.

106{
107 if (spans.empty()) {
108 return {};
109 }
110
111 if (structure_info.dimensions.size() >= 2) {
112 int expected_rows = static_cast<int>(structure_info.dimensions[0].size);
113 int expected_cols = static_cast<int>(structure_info.dimensions[1].size);
114
115 if (spans.size() != expected_cols) {
116 throw std::invalid_argument("Span count doesn't match dimension info");
117 }
118 if (!spans.empty() && spans[0].size() != expected_rows) {
119 throw std::invalid_argument("Span size doesn't match dimension info");
120 }
121 }
122
123 return create_eigen_matrix(spans);
124}
static Eigen::MatrixXd create_eigen_matrix(const std::vector< std::vector< T > > &columns)
Infer data structure from ComputeData type.

References create_eigen_matrix(), and MayaFlux::Yantra::DataStructureInfo::dimensions.

+ Here is the call graph for this function: