Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Distribution.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
6
7namespace storm::generator {
8
9template<typename IndexType, typename ValueType>
11 public:
12 typedef std::vector<DistributionEntry<IndexType, ValueType>> ContainerType;
13
15
20
25
29 void add(IndexType const& index, ValueType const& value);
30
34 void add(Distribution&& distribution);
35
40 void compress();
41
45 void divide(ValueType const& value);
46
50 void clear();
51
57 typename ContainerType::iterator begin();
58 typename ContainerType::const_iterator begin() const;
59 typename ContainerType::iterator end();
60 typename ContainerType::const_iterator end() const;
61
62 private:
63 // The underlying storage of the distribution.
64 ContainerType storage;
65
66 bool compressed;
67};
68
69} // namespace storm::generator
std::vector< DistributionEntry< IndexType, ValueType > > ContainerType
void clear()
Clears this distribution.
Distribution & operator=(Distribution const &)
ContainerType::iterator begin()
Access to iterators over the entries of the distribution.
void divide(ValueType const &value)
Divides all values in the distribution by the provided value.
void compress()
Compresses the internal storage by summing the values of entries which agree on the index.
ContainerType::iterator end()
void add(DistributionEntry< IndexType, ValueType > const &entry)
Adds the given entry to the distribution.