MayaFlux 0.3.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 420 of file OperationHelper.hpp.

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

Referenced by recreate_eigen_matrix(), and recreate_eigen_matrix().

+ Here is the caller graph for this function: