Browse Source

Merged bit vector and main file.

tempestpy_adaptions
dehnert 12 years ago
parent
commit
dc7c414246
  1. 5
      src/mrmc.cpp
  2. 4
      src/storage/BitVector.h

5
src/mrmc.cpp

@ -22,6 +22,7 @@
#include "src/models/AtomicPropositionsLabeling.h" #include "src/models/AtomicPropositionsLabeling.h"
#include "src/parser/readLabFile.h" #include "src/parser/readLabFile.h"
#include "src/parser/readTraFile.h" #include "src/parser/readTraFile.h"
#include "src/solver/GraphAnalyzer.h"
#include "src/utility/settings.h" #include "src/utility/settings.h"
#include "Eigen/Sparse" #include "Eigen/Sparse"
@ -96,6 +97,9 @@ int main(const int argc, const char* argv[]) {
dtmc.printModelInformationToStream(std::cout); dtmc.printModelInformationToStream(std::cout);
// mrmc::storage::BitVector AU(dtmc.getNumberOfStates());
// mrmc::solver::GraphAnalyzer::getUniversalReachabilityStates(dtmc, mrmc::storage::BitVector(dtmc.getNumberOfStates(), true), *dtmc.getLabeledStates("elected"), AU);
if (s != nullptr) { if (s != nullptr) {
delete s; delete s;
} }
@ -104,4 +108,3 @@ int main(const int argc, const char* argv[]) {
return 0; return 0;
} }

4
src/storage/BitVector.h

@ -266,7 +266,7 @@ public:
* of the two bit vectors. * of the two bit vectors.
*/ */
BitVector operator &=(const BitVector bv) { BitVector operator &=(const BitVector bv) {
uint_fast64_t minSize = ((bv.bitCount < this->bitCount) ? bv.bitCount : this->bitCount) >> 6;
uint_fast64_t minSize = (bv.bucketCount < this->bucketCount) ? bv.bucketCount : this->bucketCount;
for (uint_fast64_t i = 0; i < minSize; ++i) { for (uint_fast64_t i = 0; i < minSize; ++i) {
this->bucketArray[i] &= bv.bucketArray[i]; this->bucketArray[i] &= bv.bucketArray[i];
@ -305,7 +305,7 @@ public:
* of the two bit vectors. * of the two bit vectors.
*/ */
BitVector& operator |=(const BitVector bv) { BitVector& operator |=(const BitVector bv) {
uint_fast64_t minSize = ((bv.bitCount < this->bitCount) ? bv.bitCount : this->bitCount) >> 6;
uint_fast64_t minSize = (bv.bucketCount < this->bucketCount) ? bv.bucketCount : this->bucketCount;
for (uint_fast64_t i = 0; i < minSize; ++i) { for (uint_fast64_t i = 0; i < minSize; ++i) {
this->bucketArray[i] |= bv.bucketArray[i]; this->bucketArray[i] |= bv.bucketArray[i];

Loading…
Cancel
Save