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

◆ create_eigen_matrix() [2/2]

template<typename T >
static Eigen::MatrixXd MayaFlux::Yantra::OperationHelper::create_eigen_matrix ( const std::vector< std::vector< T > > &  columns)
inlinestaticprivate

Infer data structure from ComputeData type.

Template Parameters
TComputeData type
Parameters
compute_dataInput data
Returns
Pair of (dimensions, modality)

Definition at line 421 of file OperationHelper.hpp.

422 {
423 if (columns.empty()) {
424 return {};
425 }
426
427 int rows = columns[0].size();
428 int cols = columns.size();
429
430 for (const auto& col : columns) {
431 if (col.size() != rows) {
432 throw std::invalid_argument("All columns must have same size");
433 }
434 }
435
436 Eigen::MatrixXd matrix(rows, cols);
437 for (int col = 0; col < cols; ++col) {
438 for (int row = 0; row < rows; ++row) {
439 matrix(row, col) = static_cast<double>(columns[col][row]);
440 }
441 }
442 return matrix;
443 }

Referenced by recreate_eigen_matrix(), and recreate_eigen_matrix().

+ Here is the caller graph for this function: