From 3836fd42c00c95c5b37641f90e952f34852b52c6 Mon Sep 17 00:00:00 2001 From: Tim Quatmann Date: Mon, 29 Apr 2019 11:44:51 +0200 Subject: [PATCH] utility/vector: Added hasZeroEntry and hasInfinityEntry --- src/storm/utility/vector.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/storm/utility/vector.h b/src/storm/utility/vector.h index 53e89cacc..153f74a36 100644 --- a/src/storm/utility/vector.h +++ b/src/storm/utility/vector.h @@ -1155,6 +1155,16 @@ namespace storm { bool hasNonZeroEntry(std::vector const& v){ return std::any_of(v.begin(), v.end(), [](T value){return !storm::utility::isZero(value);}); } + + template + bool hasZeroEntry(std::vector const& v){ + return std::any_of(v.begin(), v.end(), [](T value){return storm::utility::isZero(value);}); + } + + template + bool hasInfinityEntry(std::vector const& v){ + return std::any_of(v.begin(), v.end(), [](T value){return storm::utility::isInfinity(value);}); + } inline std::set getVariables(std::vector const& vector) { std::set result;