#include "src/adapters/EigenAdapter.h" namespace storm { namespace adapters { template std::unique_ptr> EigenAdapter::toEigenSparseMatrix(storm::storage::SparseMatrix const& matrix) { // Build a list of triplets and let Eigen care about the insertion. std::vector> triplets; triplets.reserve(matrix.getNonzeroEntryCount()); for (uint64_t row = 0; row < matrix.getRowCount(); ++row) { for (auto const& element : matrix.getRow(row)) { triplets.emplace_back(row, element.getColumn(), element.getValue()); } } std::unique_ptr> result = std::make_unique>(matrix.getRowCount(), matrix.getColumnCount()); result->setFromTriplets(triplets.begin(), triplets.end()); return result; } template std::unique_ptr> EigenAdapter::toEigenSparseMatrix(storm::storage::SparseMatrix const& matrix); template std::unique_ptr> EigenAdapter::toEigenSparseMatrix(storm::storage::SparseMatrix const& matrix); template std::unique_ptr> EigenAdapter::toEigenSparseMatrix(storm::storage::SparseMatrix const& matrix); } }