Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DeterministicSparseTransitionParser.h
Go to the documentation of this file.
1#ifndef STORM_PARSER_DETERMINISTICSPARSETRANSITIONPARSER_H_
2#define STORM_PARSER_DETERMINISTICSPARSETRANSITIONPARSER_H_
3
5
6namespace storm {
7namespace parser {
8
16template<typename ValueType = double>
18 public:
29 // Intentionally left empty.
30 }
31
34
36 uint_fast64_t highestStateIndex;
37 };
38
49
58 template<typename MatrixValueType>
60 storm::storage::SparseMatrix<MatrixValueType> const& transitionMatrix);
61
62 private:
63 /*
64 * Performs the first pass on the input pointed to by the given buffer to obtain the number of
65 * transitions and the maximum node id.
66 *
67 * @param buffer The buffer that contains the input.
68 * @param reserveDiagonalElements A flag indicating whether the diagonal elements should be counted as if they
69 * were present to enable fixes later.
70 * @return A structure representing the result of the first pass.
71 */
72 static FirstPassResult firstPass(char const* buffer, bool reserveDiagonalElements);
73
74 /*
75 * The main parsing routine.
76 * Opens the given file, calls the first pass and performs the second pass, parsing the content of the file into a SparseMatrix.
77 *
78 * @param filename The path and name of the file to be parsed.
79 * @param rewardFile A flag set iff the file to be parsed contains transition rewards.
80 * @param insertDiagonalEntriesIfMissing A flag set iff entries on the primary diagonal of the matrix should be added in case they are missing in the parsed
81 * file.
82 * @param transitionMatrix The transition matrix of the system (this is only meaningful if isRewardFile is set to true).
83 * @return A SparseMatrix containing the parsed file contents.
84 */
85 template<typename MatrixValueType>
86 static storm::storage::SparseMatrix<ValueType> parse(std::string const& filename, bool isRewardFile,
87 storm::storage::SparseMatrix<MatrixValueType> const& transitionMatrix);
88};
89
90} // namespace parser
91} // namespace storm
92
93#endif /* STORM_PARSER_DETERMINISTICSPARSETRANSITIONPARSER_H_ */
This class can be used to parse a file containing either transitions or transition rewards of a deter...
static storm::storage::SparseMatrix< ValueType > parseDeterministicTransitions(std::string const &filename)
Load a deterministic transition system from file and create a sparse adjacency matrix whose entries r...
static storm::storage::SparseMatrix< ValueType > parseDeterministicTransitionRewards(std::string const &filename, storm::storage::SparseMatrix< MatrixValueType > const &transitionMatrix)
Load the transition rewards for a deterministic transition system from file and create a sparse adjac...
A class that holds a possibly non-square matrix in the compressed row storage format.
LabParser.cpp.
Definition cli.cpp:18
A structure representing the result of the first pass of this parser.
uint_fast64_t highestStateIndex
The highest state index that appears in the model.
uint_fast64_t numberOfNonzeroEntries
The total number of non-zero entries of the model.