From 24cd1ec597be2d81bd7566cf3c2beeddf9e9234d Mon Sep 17 00:00:00 2001 From: Mavo Date: Tue, 9 Feb 2016 14:01:04 +0100 Subject: [PATCH] Vector output without template seems to work Former-commit-id: 3627729e256d2d14ebd20781fa89a86d2b350776 --- src/builder/ExplicitDFTModelBuilder.cpp | 9 ++------- src/utility/vector.cpp | 9 +++++---- src/utility/vector.h | 6 ++++-- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/builder/ExplicitDFTModelBuilder.cpp b/src/builder/ExplicitDFTModelBuilder.cpp index 30ed5fcbe..0bd92b069 100644 --- a/src/builder/ExplicitDFTModelBuilder.cpp +++ b/src/builder/ExplicitDFTModelBuilder.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include @@ -37,13 +38,7 @@ namespace storm { // Build transition matrix modelComponents.transitionMatrix = transitionMatrixBuilder.build(); STORM_LOG_DEBUG("Transition matrix: " << std::endl << modelComponents.transitionMatrix); - // TODO: easier output for vectors - std::stringstream stream; - for (uint_fast64_t i = 0; i < modelComponents.exitRates.size() - 1; ++i) { - stream << modelComponents.exitRates[i] << ", "; - } - stream << modelComponents.exitRates.back(); - STORM_LOG_DEBUG("Exit rates: " << stream.str()); + STORM_LOG_DEBUG("Exit rates: " << modelComponents.exitRates); STORM_LOG_DEBUG("Markovian states: " << modelComponents.markovianStates); assert(modelComponents.transitionMatrix.getRowCount() == modelComponents.transitionMatrix.getColumnCount()); diff --git a/src/utility/vector.cpp b/src/utility/vector.cpp index e4a1dd05c..20af3c628 100644 --- a/src/utility/vector.cpp +++ b/src/utility/vector.cpp @@ -1,7 +1,8 @@ #include "src/utility/vector.h" -template -std::ostream& operator<<(std::ostream& out, std::vector const& vector) { +//template +//std::ostream& operator<<(std::ostream& out, std::vector const& vector) { +std::ostream& operator<<(std::ostream& out, std::vector const& vector) { out << "vector (" << vector.size() << ") [ "; for (uint_fast64_t i = 0; i < vector.size() - 1; ++i) { out << vector[i] << ", "; @@ -12,5 +13,5 @@ std::ostream& operator<<(std::ostream& out, std::vector const& vector } // Explicitly instantiate functions. -template std::ostream& operator<<(std::ostream& out, std::vector const& vector); -template std::ostream& operator<<(std::ostream& out, std::vector const& vector); +//template std::ostream& operator<<(std::ostream& out, std::vector const& vector); +//template std::ostream& operator<<(std::ostream& out, std::vector const& vector); \ No newline at end of file diff --git a/src/utility/vector.h b/src/utility/vector.h index 665569645..6b09f0467 100644 --- a/src/utility/vector.h +++ b/src/utility/vector.h @@ -15,8 +15,10 @@ #include "src/utility/macros.h" #include "src/solver/OptimizationDirection.h" -template -std::ostream& operator<<(std::ostream& out, std::vector const& vector); +// Template was causing problems as Carl has the same function +//template +//std::ostream& operator<<(std::ostream& out, std::vector const& vector); +std::ostream& operator<<(std::ostream& out, std::vector const& vector); namespace storm { namespace utility {