Browse Source

Intermediate commit to test code under linux.

tempestpy_adaptions
dehnert 12 years ago
parent
commit
aba470960f
  1. 12
      src/adapters/IntermediateRepresentationAdapter.h
  2. 4
      src/storm.cpp

12
src/adapters/IntermediateRepresentationAdapter.h

@ -8,6 +8,8 @@
#ifndef STORM_IR_INTERMEDIATEREPRESENTATIONADAPTER_H_ #ifndef STORM_IR_INTERMEDIATEREPRESENTATIONADAPTER_H_
#define STORM_IR_INTERMEDIATEREPRESENTATIONADAPTER_H_ #define STORM_IR_INTERMEDIATEREPRESENTATIONADAPTER_H_
#include "src/storage/SparseMatrix.h"
#include <tuple> #include <tuple>
#include <unordered_map> #include <unordered_map>
#include <boost/functional/hash.hpp> #include <boost/functional/hash.hpp>
@ -45,7 +47,7 @@ public:
class IntermediateRepresentationAdapter { class IntermediateRepresentationAdapter {
public: public:
template<class T> template<class T>
static storm::storage::SquareSparseMatrix<T>* toSparseMatrix(storm::ir::Program const& program) {
static storm::storage::SparseMatrix<T>* toSparseMatrix(storm::ir::Program const& program) {
uint_fast64_t numberOfIntegerVariables = 0; uint_fast64_t numberOfIntegerVariables = 0;
uint_fast64_t numberOfBooleanVariables = 0; uint_fast64_t numberOfBooleanVariables = 0;
@ -162,7 +164,7 @@ public:
std::cout << "Found " << allStates.size() << " reachable states and " << totalNumberOfTransitions << " transitions."; std::cout << "Found " << allStates.size() << " reachable states and " << totalNumberOfTransitions << " transitions.";
storm::storage::SquareSparseMatrix<T>* resultMatrix = new storm::storage::SquareSparseMatrix<T>(allStates.size());
storm::storage::SparseMatrix<T>* resultMatrix = new storm::storage::SparseMatrix<T>(allStates.size());
resultMatrix->initialize(totalNumberOfTransitions); resultMatrix->initialize(totalNumberOfTransitions);
uint_fast64_t currentIndex = 0; uint_fast64_t currentIndex = 0;
@ -204,9 +206,9 @@ public:
} }
// Now insert the actual values into the matrix. // Now insert the actual values into the matrix.
//for (auto targetIndex : stateIndexToProbabilityMap) {
// resultMatrix->addNextValue(currentIndex, targetIndex.first, targetIndex.second);
//}
for (auto targetIndex : stateIndexToProbabilityMap) {
resultMatrix->addNextValue(currentIndex, targetIndex.first, targetIndex.second);
}
} }
} }
} }

4
src/storm.cpp

@ -25,7 +25,7 @@
#include "src/modelChecker/EigenDtmcPrctlModelChecker.h" #include "src/modelChecker/EigenDtmcPrctlModelChecker.h"
#include "src/modelChecker/GmmxxDtmcPrctlModelChecker.h" #include "src/modelChecker/GmmxxDtmcPrctlModelChecker.h"
#include "src/parser/AutoParser.h" #include "src/parser/AutoParser.h"
#include "src/parser/PrctlParser.h"
//#include "src/parser/PrctlParser.h"
#include "src/solver/GraphAnalyzer.h" #include "src/solver/GraphAnalyzer.h"
#include "src/utility/Settings.h" #include "src/utility/Settings.h"
#include "src/formula/Formulas.h" #include "src/formula/Formulas.h"
@ -246,7 +246,7 @@ int main(const int argc, const char* argv[]) {
storm::parser::PrismParser parser; storm::parser::PrismParser parser;
std::shared_ptr<storm::ir::Program> program = parser.parseFile("test.input"); std::shared_ptr<storm::ir::Program> program = parser.parseFile("test.input");
storm::storage::SquareSparseMatrix<double>* result = storm::adapters::IntermediateRepresentationAdapter::toSparseMatrix<double>(*program);
storm::storage::SparseMatrix<double>* result = storm::adapters::IntermediateRepresentationAdapter::toSparseMatrix<double>(*program);
result->print(); result->print();
delete result; delete result;

Loading…
Cancel
Save