Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DeterministicSparseTransitionParser.h
Go to the documentation of this file.
1#pragma once
2
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
50
59 template<typename MatrixValueType>
61 storm::storage::SparseMatrix<MatrixValueType> const& transitionMatrix);
62
63 private:
64 /*
65 * Performs the first pass on the input pointed to by the given buffer to obtain the number of
66 * transitions and the maximum node id.
67 *
68 * @param buffer The buffer that contains the input.
69 * @param reserveDiagonalElements A flag indicating whether the diagonal elements should be counted as if they
70 * were present to enable fixes later.
71 * @return A structure representing the result of the first pass.
72 */
73 static FirstPassResult firstPass(char const* buffer, bool reserveDiagonalElements);
74
75 /*
76 * The main parsing routine.
77 * Opens the given file, calls the first pass and performs the second pass, parsing the content of the file into a SparseMatrix.
78 *
79 * @param filename The path and name of the file to be parsed.
80 * @param rewardFile A flag set iff the file to be parsed contains transition rewards.
81 * @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
82 * file.
83 * @param transitionMatrix The transition matrix of the system (this is only meaningful if isRewardFile is set to true).
84 * @return A SparseMatrix containing the parsed file contents.
85 */
86 template<typename MatrixValueType>
87 static storm::storage::SparseMatrix<ValueType> parse(std::string const& filename, bool isRewardFile,
90};
91
92} // namespace parser
93} // namespace storm
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, ExplicitModelParserOptions const &options=ExplicitModelParserOptions())
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.
Contains all file parsers and helper classes.
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.