Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SparseAccumulator.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <type_traits>
5#include <vector>
6
7namespace storm::bisimulation {
8
16template<typename ValueType>
18 public:
19 explicit SparseAccumulator(uint64_t const numStates);
20
24 std::vector<ValueType> const& getValues() const;
25
29 std::vector<uint64_t> const& getNonDefaultStates() const;
30
34 void addValue(uint64_t const state, ValueType value);
35
39 void clear();
40
41 private:
42 static ValueType defaultValue();
43
44 std::vector<ValueType> values; // stores the value for each state
45 std::vector<uint64_t> nonDefaultStates; // stores those states with a non-default value
46};
47
54
55} // namespace storm::bisimulation
Accumulates a value for each state (numbers are added up, elements are inserted into sets,...
void clear()
Clears the set, i.e., writes the default value for all states.
std::vector< ValueType > const & getValues() const
SparseAccumulator(uint64_t const numStates)
std::vector< uint64_t > const & getNonDefaultStates() const
void addValue(uint64_t const state, ValueType value)
Adds value to the currently mapped value of the given state, i.e., inserts it into the set of that st...
SparseAccumulator< uint64_t > WrappingSetAccumulator
Accumulates a set of indices for each state, where only the index modulo 64 is stored,...