From e12ac3624902fe969fd3b18bfc06bee02f665e7a Mon Sep 17 00:00:00 2001 From: Mavo Date: Fri, 19 Feb 2016 11:41:34 +0100 Subject: [PATCH] Fixed problem with usageInfoBits for only one element Former-commit-id: ac52fff2d7808a2e952252aee3c5f0da88086643 --- src/storage/dft/DFT.cpp | 2 +- src/storage/dft/DFT.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/storage/dft/DFT.cpp b/src/storage/dft/DFT.cpp index c53f711e4..654fb269e 100644 --- a/src/storage/dft/DFT.cpp +++ b/src/storage/dft/DFT.cpp @@ -63,7 +63,7 @@ namespace storm { } mTopModule = std::vector(topModuleSet.begin(), topModuleSet.end()); - size_t usageInfoBits = storm::utility::math::uint64_log2(mElements.size()-1)+1; + size_t usageInfoBits = mElements.size() > 1 ? storm::utility::math::uint64_log2(mElements.size()-1) + 1 : 1; mStateVectorSize = nrElements() * 2 + mNrOfSpares * usageInfoBits + nrRepresentatives; } diff --git a/src/storage/dft/DFT.h b/src/storage/dft/DFT.h index 07403fd33..0cedfbfa7 100644 --- a/src/storage/dft/DFT.h +++ b/src/storage/dft/DFT.h @@ -43,7 +43,7 @@ namespace storm { public: - DFTStateGenerationInfo(size_t nrElements) : mUsageInfoBits(storm::utility::math::uint64_log2(nrElements-1)+1), mIdToStateIndex(nrElements) { + DFTStateGenerationInfo(size_t nrElements) : mUsageInfoBits(nrElements > 1 ? storm::utility::math::uint64_log2(nrElements-1) + 1 : 1), mIdToStateIndex(nrElements) { } size_t usageInfoBits() const {