From 7c85f0c46a9730d0e3fe0baa9ce6640c1ae13e1b Mon Sep 17 00:00:00 2001 From: sjunges Date: Fri, 30 Sep 2016 00:00:22 +0200 Subject: [PATCH] IntegerInterval:: contains Former-commit-id: 76cbc553ecb8ecac0aadf0f5a2e98f439be96873 [formerly ca09cce781aca9f55f462d1a0ba1567c48ee4db8] Former-commit-id: 74efc00e6d6c70bc34150569f4f2cb33e8c23012 --- src/storage/IntegerInterval.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/storage/IntegerInterval.h b/src/storage/IntegerInterval.h index 4459b1569..6965f0626 100644 --- a/src/storage/IntegerInterval.h +++ b/src/storage/IntegerInterval.h @@ -37,6 +37,26 @@ namespace storm { return true; } + bool contains(IntegerInterval const& i) const { + if (hasLeftBound()) { + if (!i.hasLeftBound()) { + return false; + } + if (leftBound.get() > i.getLeftBound().get()) { + return false; + } + } + if (hasRightBound()) { + if (!i.hasRightBound()) { + return false; + } + if (rightBound.get() < i.getRightBound().get()) { + return false; + } + } + return true; + } + boost::optional getLeftBound() const { return leftBound; }