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

◆ extract_from_eigen_matrix()

template<typename EigenMatrix >
static std::vector< std::span< double > > MayaFlux::Yantra::OperationHelper::extract_from_eigen_matrix ( const EigenMatrix &  matrix)
inlinestaticprivate

Infer data structure from ComputeData type.

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

Definition at line 362 of file OperationHelper.hpp.

363 {
364 static thread_local std::vector<std::vector<double>> columns;
365 columns.clear();
366 columns.resize(matrix.cols());
367 std::vector<std::span<double>> spans;
368 spans.reserve(matrix.cols());
369
370 for (int col = 0; col < matrix.cols(); ++col) {
371 columns[col].resize(matrix.rows());
372 for (int row = 0; row < matrix.rows(); ++row) {
373 columns[col][row] = static_cast<double>(matrix(row, col));
374 }
375 spans.emplace_back(columns[col].data(), columns[col].size());
376 }
377 return spans;
378 }

Referenced by extract_numeric_data().

+ Here is the caller graph for this function: