From 802abccbcea8726353e8032b29a7a31e2577dfc2 Mon Sep 17 00:00:00 2001 From: Joachim Klein Date: Wed, 10 Feb 2016 13:41:17 +0000 Subject: [PATCH] explicit.StateValues: add complement() method (for boolean vectors) git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11170 bbc10eb1-c90d-0410-af57-cb519fbb1720 --- prism/src/explicit/StateValues.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/prism/src/explicit/StateValues.java b/prism/src/explicit/StateValues.java index 4cb60de5..f936d72d 100644 --- a/prism/src/explicit/StateValues.java +++ b/prism/src/explicit/StateValues.java @@ -468,6 +468,18 @@ public class StateValues implements StateVector valuesB.and(sv.valuesB); } + /** + * Complement the (boolean) vector. + */ + public void complement() throws PrismException + { + if (!(type instanceof TypeBool)) { + throw new PrismException("Can only complement Boolean vectors"); + } + + valuesB.flip(0, size); + } + /** * Modify the vector by applying 'equals' with operand {@code sv}. */