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

◆ recreate_eigen_matrix() [2/2]

Eigen::MatrixXd MayaFlux::Yantra::OperationHelper::recreate_eigen_matrix ( const std::vector< std::vector< double > > &  columns,
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 5 of file OperationHelper.cpp.

8{
9 if (columns.empty()) {
10 return {};
11 }
12
13 if (structure_info.dimensions.size() >= 2) {
14 int expected_rows = structure_info.dimensions[0].size;
15 int expected_cols = structure_info.dimensions[1].size;
16
17 if (columns.size() != expected_cols) {
18 throw std::invalid_argument("Column count doesn't match dimension info");
19 }
20 if (!columns.empty() && columns[0].size() != expected_rows) {
21 throw std::invalid_argument("Row count doesn't match dimension info");
22 }
23
24 return create_eigen_matrix(columns);
25 }
26
27 return create_eigen_matrix(columns);
28}
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.

Referenced by reconstruct_from_double().

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