Browse Source

Remove superfluous methods

tempestpy_adaptions
Jip Spel 6 years ago
parent
commit
baf5cbb074
  1. 4
      src/storm-pars/analysis/Lattice.cpp
  2. 41
      src/storm-pars/analysis/Transformer.cpp
  3. 4
      src/storm-pars/analysis/Transformer.h

4
src/storm-pars/analysis/Lattice.cpp

@ -14,8 +14,6 @@ namespace storm {
top->below.push_back(bottom); top->below.push_back(bottom);
bottom->above.push_back(top); bottom->above.push_back(top);
nodes = std::vector<Node *>({top, bottom}); nodes = std::vector<Node *>({top, bottom});
// addedStates.insert(addedStates.end(), top->states.begin(), top->states.end());
// addedStates.insert(addedStates.end(), bottom->states.begin(), bottom->states.end());
this->numberOfStates = numberOfStates; this->numberOfStates = numberOfStates;
} }
@ -30,12 +28,10 @@ namespace storm {
(below->above).push_back(newNode); (below->above).push_back(newNode);
above->below.push_back(newNode); above->below.push_back(newNode);
nodes.push_back(newNode); nodes.push_back(newNode);
// addedStates.push_back(state);
} }
void Lattice::addToNode(uint_fast64_t state, Node *node) { void Lattice::addToNode(uint_fast64_t state, Node *node) {
node->states.set(state); node->states.set(state);
// addedStates.push_back(state);
} }
int Lattice::compare(uint_fast64_t state1, uint_fast64_t state2) { int Lattice::compare(uint_fast64_t state1, uint_fast64_t state2) {

41
src/storm-pars/analysis/Transformer.cpp

@ -175,47 +175,22 @@ namespace storm {
return states; return states;
} }
void Transformer::print(storm::storage::BitVector vector, std::string message) {
// TODO: Remove this, unnecessary
uint_fast64_t index = vector.getNextSetIndex(0);
std::cout << message <<": {";
while (index < vector.size()) {
std::cout << index;
index = vector.getNextSetIndex(index+1);
if (index < vector.size()) {
std::cout << ", ";
}
}
std::cout << "}" << std::endl;
}
std::vector<uint_fast64_t> Transformer::getNumbers(storm::storage::BitVector vector) {
// TODO: Remove this, unnecessary
std::vector<uint_fast64_t> result = std::vector<uint_fast64_t>({});
uint_fast64_t index = vector.getNextSetIndex(0);
while (index < vector.size()) {
result.push_back(index);
index = vector.getNextSetIndex(index+1);
}
return result;
}
storm::RationalFunction Transformer::getProbability(storm::storage::BitVector state, storm::storage::BitVector successor, storm::storage::SparseMatrix<storm::RationalFunction> matrix) { storm::RationalFunction Transformer::getProbability(storm::storage::BitVector state, storm::storage::BitVector successor, storm::storage::SparseMatrix<storm::RationalFunction> matrix) {
std::vector<uint_fast64_t> successorNumbers = getNumbers(successor);
storm::RationalFunction result = storm::RationalFunction(1); storm::RationalFunction result = storm::RationalFunction(1);
for (auto itr = successorNumbers.begin(); itr < successorNumbers.end() && result == storm::RationalFunction(1); ++itr) {
result = getProbability(state, (*itr), matrix);
uint_fast64_t index = successor.getNextSetIndex(0);
while (index < successor.size() && result == storm::RationalFunction(1)) {
result = getProbability(state, index, matrix);
index = successor.getNextSetIndex(index+1);
} }
return result; return result;
} }
storm::RationalFunction Transformer::getProbability(storm::storage::BitVector state, uint_fast64_t successor, storm::storage::SparseMatrix<storm::RationalFunction> matrix) { storm::RationalFunction Transformer::getProbability(storm::storage::BitVector state, uint_fast64_t successor, storm::storage::SparseMatrix<storm::RationalFunction> matrix) {
std::vector<uint_fast64_t> stateNumbers = getNumbers(state);
storm::RationalFunction result = storm::RationalFunction(1); storm::RationalFunction result = storm::RationalFunction(1);
for (auto itr = stateNumbers.begin(); itr < stateNumbers.end() && result == storm::RationalFunction(1); ++itr) {
result = getProbability((*itr), successor, matrix);
uint_fast64_t index = state.getNextSetIndex(0);
while (index < state.size() && result == storm::RationalFunction(1)) {
result = getProbability(index, successor, matrix);
index = state.getNextSetIndex(index+1);
} }
return result; return result;
} }

4
src/storm-pars/analysis/Transformer.h

@ -40,10 +40,6 @@ namespace storm {
toStateVector(storm::storage::SparseMatrix<storm::RationalFunction> transitionMatrix, toStateVector(storm::storage::SparseMatrix<storm::RationalFunction> transitionMatrix,
storm::storage::BitVector const &initialStates); storm::storage::BitVector const &initialStates);
static void print(storm::storage::BitVector vector, std::string message);
static std::vector<uint_fast64_t> getNumbers(storm::storage::BitVector vector);
static storm::RationalFunction getProbability(storm::storage::BitVector state, storm::storage::BitVector successor, storm::storage::SparseMatrix<storm::RationalFunction> matrix); static storm::RationalFunction getProbability(storm::storage::BitVector state, storm::storage::BitVector successor, storm::storage::SparseMatrix<storm::RationalFunction> matrix);
static storm::RationalFunction getProbability(storm::storage::BitVector state, uint_fast64_t successor, storm::storage::SparseMatrix<storm::RationalFunction> matrix); static storm::RationalFunction getProbability(storm::storage::BitVector state, uint_fast64_t successor, storm::storage::SparseMatrix<storm::RationalFunction> matrix);

Loading…
Cancel
Save