Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
permutation.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <string>
5#include <vector>
6
7namespace storm {
8
9namespace storage {
10class BitVector;
11template<typename ValueType>
12class SparseMatrix;
13} // namespace storage
14
15namespace utility::permutation {
16using index_type = uint64_t;
17
22
26std::string orderKindtoString(OrderKind order);
27
31std::vector<std::string> orderKinds();
32
36OrderKind orderKindFromString(std::string const& order);
37
41std::vector<index_type> createRandomPermutation(index_type size);
42
47std::vector<index_type> createRandomPermutation(index_type size, index_type seed);
48
62template<typename ValueType>
63std::vector<index_type> createPermutation(OrderKind order, storm::storage::SparseMatrix<ValueType> const& transitionMatrix,
64 storm::storage::BitVector const& initialStates);
65
70std::vector<index_type> invertPermutation(std::vector<index_type> const& permutation);
71
77void reversePermutationInPlace(std::vector<index_type>& permutation);
78
83bool isValidPermutation(std::vector<index_type> const& permutation);
84
85} // namespace utility::permutation
86} // namespace storm
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:18
A class that holds a possibly non-square matrix in the compressed row storage format.
storage::BitVector BitVector
OrderKind
The order in which the states of a matrix are visited in a depth-first search or breadth-first search...
Definition permutation.h:21
std::vector< index_type > createRandomPermutation(index_type size)
Creates a random (uniformly distributed) permutation of the given size.
std::string orderKindtoString(OrderKind order)
Converts the given order to a string.
std::vector< index_type > createPermutation(OrderKind order, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::BitVector const &initialStates)
Creates a permutation that orders the states of the given matrix in the given exploration order.
void reversePermutationInPlace(std::vector< index_type > &permutation)
Reverses the given permutation.
std::vector< index_type > invertPermutation(std::vector< index_type > const &permutation)
Inverts the given permutation.
std::vector< std::string > orderKinds()
Returns a list of possible order kinds.
OrderKind orderKindFromString(std::string const &order)
Gets the order from the given string.
bool isValidPermutation(std::vector< index_type > const &permutation)
Returns true if the given vector is a permutation of the numbers 0, 1, ..., n-1 for n = permutation....
LabParser.cpp.
Definition cli.cpp:18