Infer data structure from ComputeData type.
562 {
563 static thread_local std::vector<std::vector<double>> columns;
564 columns.clear();
565 columns.resize(matrix.cols());
566 std::vector<std::span<double>> spans;
567 spans.reserve(matrix.cols());
568
569 for (int col = 0; col < matrix.cols(); ++col) {
570 columns[col].resize(matrix.rows());
571 for (int row = 0; row < matrix.rows(); ++row) {
572 columns[col][row] = static_cast<double>(matrix(row, col));
573 }
574 spans.emplace_back(columns[col].data(), columns[col].size());
575 }
576 return spans;
577 }