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
6
7namespace storm {
8namespace parser {
9
17template<typename ValueType = double>
19 public:
30 // Intentionally left empty.
31 }
32
35
37 uint_fast64_t highestStateIndex;
38 };
39
51
60 template<typename MatrixValueType>
62 storm::storage::SparseMatrix<MatrixValueType> const& transitionMatrix);
63
64 private:
65 /*
66 * Performs the first pass on the input pointed to by the given buffer to obtain the number of
67 * transitions and the maximum node id.
68 *
69 * @param buffer The buffer that contains the input.
70 * @param reserveDiagonalElements A flag indicating whether the diagonal elements should be counted as if they
71 * were present to enable fixes later.
72 * @return A structure representing the result of the first pass.
73 */
74 static FirstPassResult firstPass(char const* buffer, bool reserveDiagonalElements);
75
76 /*
77 * The main parsing routine.
78 * Opens the given file, calls the first pass and performs the second pass, parsing the content of the file into a SparseMatrix.
79 *
80 * @param filename The path and name of the file to be parsed.
81 * @param rewardFile A flag set iff the file to be parsed contains transition rewards.
82 * @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
83 * file.
84 * @param transitionMatrix The transition matrix of the system (this is only meaningful if isRewardFile is set to true).
85 * @return A SparseMatrix containing the parsed file contents.
86 */
87 template<typename MatrixValueType>
88 static storm::storage::SparseMatrix<ValueType> parse(std::string const& filename, bool isRewardFile,
91};
92
93} // namespace parser
94} // 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.
#define STORM_PARSERS_API
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.