From 71ceb3f34bc31d8d9fc9577e0103ffbd1e9e2363 Mon Sep 17 00:00:00 2001 From: dehnert Date: Wed, 29 Oct 2014 20:57:25 +0100 Subject: [PATCH] Removed some time measurements and fixed simplify functionality. Former-commit-id: ece2b344f9b587f59c4e13f6c60c9ea01e575c15 --- .../reachability/SparseSccModelChecker.cpp | 4 ++-- src/utility/ConstantsComparator.cpp | 16 ++++++++++++++++ src/utility/ConstantsComparator.h | 3 +++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/modelchecker/reachability/SparseSccModelChecker.cpp b/src/modelchecker/reachability/SparseSccModelChecker.cpp index 949ab5d55..546c7d83c 100644 --- a/src/modelchecker/reachability/SparseSccModelChecker.cpp +++ b/src/modelchecker/reachability/SparseSccModelChecker.cpp @@ -419,7 +419,7 @@ namespace storm { break; } if (first2->getColumn() < first1->getColumn()) { - *result = storm::utility::simplify(*first2 * multiplyFactor); + *result = storm::utility::simplify(std::move(*first2 * multiplyFactor)); ++first2; } else if (first1->getColumn() < first2->getColumn()) { *result = *first1; @@ -432,7 +432,7 @@ namespace storm { } for (; first2 != last2; ++first2) { if (first2->getColumn() != state) { - *result = storm::utility::simplify(*first2 * multiplyFactor); + *result = storm::utility::simplify(std::move(*first2 * multiplyFactor)); } } diff --git a/src/utility/ConstantsComparator.cpp b/src/utility/ConstantsComparator.cpp index ae54f0b9b..9a0e4b31b 100644 --- a/src/utility/ConstantsComparator.cpp +++ b/src/utility/ConstantsComparator.cpp @@ -118,11 +118,23 @@ namespace storm { } #endif + template + storm::storage::MatrixEntry simplify(storm::storage::MatrixEntry matrixEntry) { + simplify(matrixEntry.getValue()); + return matrixEntry; + } + template storm::storage::MatrixEntry& simplify(storm::storage::MatrixEntry& matrixEntry) { simplify(matrixEntry.getValue()); return matrixEntry; } + + template + storm::storage::MatrixEntry&& simplify(storm::storage::MatrixEntry&& matrixEntry) { + simplify(matrixEntry.getValue()); + return std::move(matrixEntry); + } template class ConstantsComparator; @@ -132,7 +144,9 @@ namespace storm { template double simplify(double value); + template storm::storage::MatrixEntry simplify(storm::storage::MatrixEntry matrixEntry); template storm::storage::MatrixEntry& simplify(storm::storage::MatrixEntry& matrixEntry); + template storm::storage::MatrixEntry&& simplify(storm::storage::MatrixEntry&& matrixEntry); #ifdef PARAMETRIC_SYSTEMS template class ConstantsComparator; @@ -147,7 +161,9 @@ namespace storm { template RationalFunction& simplify(RationalFunction& value); template RationalFunction&& simplify(RationalFunction&& value); + template storm::storage::MatrixEntry simplify(storm::storage::MatrixEntry matrixEntry); template storm::storage::MatrixEntry& simplify(storm::storage::MatrixEntry& matrixEntry); + template storm::storage::MatrixEntry&& simplify(storm::storage::MatrixEntry&& matrixEntry); #endif } } \ No newline at end of file diff --git a/src/utility/ConstantsComparator.h b/src/utility/ConstantsComparator.h index 37e27ea46..8c9ee9de7 100644 --- a/src/utility/ConstantsComparator.h +++ b/src/utility/ConstantsComparator.h @@ -98,6 +98,9 @@ namespace storm { template storm::storage::MatrixEntry& simplify(storm::storage::MatrixEntry& matrixEntry); + + template + storm::storage::MatrixEntry&& simplify(storm::storage::MatrixEntry&& matrixEntry); } }