From 362b3bf6c60a486804f538f2f01fcebfd8450ca1 Mon Sep 17 00:00:00 2001 From: TimQu Date: Mon, 9 Jan 2017 20:03:50 +0100 Subject: [PATCH] removed eigen usages --- resources/3rdparty/CMakeLists.txt | 5 ++-- src/storm/adapters/EigenAdapter.cpp | 8 +++-- src/storm/adapters/EigenAdapter.h | 2 +- src/storm/cli/cli.cpp | 4 +-- .../solver/EigenLinearEquationSolver.cpp | 29 +++++++++++-------- 5 files changed, 28 insertions(+), 20 deletions(-) diff --git a/resources/3rdparty/CMakeLists.txt b/resources/3rdparty/CMakeLists.txt index 6e85cf5b3..807317bcf 100644 --- a/resources/3rdparty/CMakeLists.txt +++ b/resources/3rdparty/CMakeLists.txt @@ -43,8 +43,8 @@ list(APPEND STORM_DEP_TARGETS gmm) ## ############################################################# -add_imported_library_interface(Eigen33 "${PROJECT_SOURCE_DIR}/resources/3rdparty/eigen-3.3-beta1") -list(APPEND STORM_DEP_TARGETS Eigen33) +# add_imported_library_interface(Eigen33 "${PROJECT_SOURCE_DIR}/resources/3rdparty/eigen-3.3-beta1") +# list(APPEND STORM_DEP_TARGETS Eigen33) ############################################################# @@ -585,3 +585,4 @@ if(ENABLE_CUDA) endif() add_custom_target(copy_resources_headers DEPENDS ${CMAKE_BINARY_DIR}/include/resources/3rdparty/sparsepp/sparsepp.h ${CMAKE_BINARY_DIR}/include/resources/3rdparty/sparsepp/sparsepp.h) + diff --git a/src/storm/adapters/EigenAdapter.cpp b/src/storm/adapters/EigenAdapter.cpp index b5a3ccbbf..74d8f87f2 100644 --- a/src/storm/adapters/EigenAdapter.cpp +++ b/src/storm/adapters/EigenAdapter.cpp @@ -5,6 +5,8 @@ namespace storm { template std::unique_ptr> EigenAdapter::toEigenSparseMatrix(storm::storage::SparseMatrix const& matrix) { +return nullptr; +/* // Build a list of triplets and let Eigen care about the insertion. std::vector> triplets; triplets.reserve(matrix.getNonzeroEntryCount()); @@ -18,13 +20,13 @@ namespace storm { 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); #ifdef STORM_HAVE_CARL - 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); + // template std::unique_ptr> EigenAdapter::toEigenSparseMatrix(storm::storage::SparseMatrix const& matrix); #endif } } diff --git a/src/storm/adapters/EigenAdapter.h b/src/storm/adapters/EigenAdapter.h index a205ebee4..642fc53f9 100644 --- a/src/storm/adapters/EigenAdapter.h +++ b/src/storm/adapters/EigenAdapter.h @@ -1,7 +1,7 @@ #pragma once #include - +#include #include "storm/utility/eigen.h" #include "storm/storage/SparseMatrix.h" diff --git a/src/storm/cli/cli.cpp b/src/storm/cli/cli.cpp index b5606153f..e9ca81fe6 100644 --- a/src/storm/cli/cli.cpp +++ b/src/storm/cli/cli.cpp @@ -135,14 +135,14 @@ namespace storm { getrusage(RUSAGE_SELF, &ru); std::cout << "Performance statistics:" << std::endl; - std::cout << " * peak memory usage: " << ru.ru_maxrss/1024/1024 << " mb" << std::endl; + std::cout << " * peak memory usage: " << ru.ru_maxrss/1024 << " mb" << std::endl; std::cout << " * CPU time: " << ru.ru_utime.tv_sec << "." << std::setw(3) << std::setfill('0') << ru.ru_utime.tv_usec/1000 << " seconds" << std::endl; if (wallclockMilliseconds != 0) { std::cout << " * wallclock time: " << (wallclockMilliseconds/1000) << "." << std::setw(3) << std::setfill('0') << (wallclockMilliseconds % 1000) << " seconds" << std::endl; } std::cout << "STATISTICS_OVERALL_HEADERS;" << "memory;CPU time;wallclock time;" << std::endl; std::cout << "STATISTICS_OVERALL_DATA;" - << ru.ru_maxrss/1024/1024 << ";" + << ru.ru_maxrss/1024 << ";" << ru.ru_utime.tv_sec << "." << std::setw(3) << std::setfill('0') << ru.ru_utime.tv_usec/1000 << ";" << (wallclockMilliseconds/1000) << "." << std::setw(3) << std::setfill('0') << (wallclockMilliseconds % 1000) << ";" << std::endl; #else diff --git a/src/storm/solver/EigenLinearEquationSolver.cpp b/src/storm/solver/EigenLinearEquationSolver.cpp index 31c2dda48..5c91aaf34 100644 --- a/src/storm/solver/EigenLinearEquationSolver.cpp +++ b/src/storm/solver/EigenLinearEquationSolver.cpp @@ -105,7 +105,8 @@ namespace storm { #endif template - EigenLinearEquationSolver::EigenLinearEquationSolver(storm::storage::SparseMatrix const& A, EigenLinearEquationSolverSettings const& settings) : eigenA(storm::adapters::EigenAdapter::toEigenSparseMatrix(A)), settings(settings) { + EigenLinearEquationSolver::EigenLinearEquationSolver(storm::storage::SparseMatrix const& A, EigenLinearEquationSolverSettings const& settings) : settings(settings) { +std::cout << "eigen eq solver disabled since it requires a custom version that we disabled in this build." << std::endl; // Intentionally left empty. } @@ -116,7 +117,7 @@ namespace storm { template void EigenLinearEquationSolver::setMatrix(storm::storage::SparseMatrix const& A) { - eigenA = storm::adapters::EigenAdapter::toEigenSparseMatrix(A); +// eigenA = storm::adapters::EigenAdapter::toEigenSparseMatrix(A); this->clearCache(); } @@ -131,7 +132,8 @@ namespace storm { template bool EigenLinearEquationSolver::solveEquations(std::vector& x, std::vector const& b) const { // Map the input vectors to Eigen's format. - auto eigenX = Eigen::Matrix::Map(x.data(), x.size()); +return false; +/* auto eigenX = Eigen::Matrix::Map(x.data(), x.size()); auto eigenB = Eigen::Matrix::Map(b.data(), b.size()); typename EigenLinearEquationSolverSettings::SolutionMethod solutionMethod = this->getSettings().getSolutionMethod(); @@ -218,12 +220,12 @@ namespace storm { } } } - return false; + return false; */ } template void EigenLinearEquationSolver::multiply(std::vector& x, std::vector const* b, std::vector& result) const { - // Typedef the map-type so we don't have to spell it out. + /* // Typedef the map-type so we don't have to spell it out. typedef decltype(Eigen::Matrix::Map(b->data(), b->size())) MapType; auto eigenX = Eigen::Matrix::Map(x.data(), x.size()); @@ -247,7 +249,8 @@ namespace storm { eigenResult = *eigenA * eigenX; } } - } +*/ + } template EigenLinearEquationSolverSettings& EigenLinearEquationSolver::getSettings() { @@ -261,19 +264,20 @@ namespace storm { template uint64_t EigenLinearEquationSolver::getMatrixRowCount() const { - return eigenA->rows(); + return 0; // eigenA->rows(); } template uint64_t EigenLinearEquationSolver::getMatrixColumnCount() const { - return eigenA->cols(); + return 0; //eigenA->cols(); } #ifdef STORM_HAVE_CARL // Specialization for storm::RationalNumber template<> bool EigenLinearEquationSolver::solveEquations(std::vector& x, std::vector const& b) const { - // Map the input vectors to Eigen's format. +return false; /* +// Map the input vectors to Eigen's format. auto eigenX = Eigen::Matrix::Map(x.data(), x.size()); auto eigenB = Eigen::Matrix::Map(b.data(), b.size()); @@ -281,12 +285,13 @@ namespace storm { solver.compute(*eigenA); solver._solve_impl(eigenB, eigenX); return solver.info() == Eigen::ComputationInfo::Success; - } + */ } // Specialization for storm::RationalFunction template<> bool EigenLinearEquationSolver::solveEquations(std::vector& x, std::vector const& b) const { - // Map the input vectors to Eigen's format. +return false; /* + // Map the input vectors to Eigen's format. auto eigenX = Eigen::Matrix::Map(x.data(), x.size()); auto eigenB = Eigen::Matrix::Map(b.data(), b.size()); @@ -294,7 +299,7 @@ namespace storm { solver.compute(*eigenA); solver._solve_impl(eigenB, eigenX); return solver.info() == Eigen::ComputationInfo::Success; - } + */} #endif template