Random generation of arrangements of any graph.
More...
#include <rand_arrangements.hpp>
|
const uint64_t | m_n |
| Number of vertices.
|
|
std::mt19937 | m_gen |
| Random number generator.
|
|
linear_arrangement | m_arr |
| The arrangement generated by this class.
|
|
Random generation of arrangements of any graph.
This class generates linear arrangements uniformly at random. Unlike other random generators (e.g., lal::generate::rand_projective_arrangements) the arrangements are not generated from a graph since the graph structure is not required at all.
This class is a simple wrapper over C++'s std::shuffle algorithm.
A possible usage of this class is the following:
for (int i = 0; i < 100; ++i) {
}
Random generation of arrangements of any graph.
Definition rand_arrangements.hpp:83
Linear arrangement of vertices.
Definition linear_arrangement.hpp:103
Equivalently,
for (int i = 0; i < 100; ++i) {
}
◆ rand_arrangements() [1/4]
lal::generate::rand_arrangements::rand_arrangements |
( |
const graphs::graph & | g, |
|
|
const uint64_t | seed = 0 ) |
|
inlinenoexcept |
Constructor with graph.
- Parameters
-
g | Input graph. Only its number of vertices is used. |
seed | Seed of the random number generator. When 0, a random seed is used. |
◆ rand_arrangements() [2/4]
Default copy constructor.
- Parameters
-
Gen | Random arrangement generator. |
◆ rand_arrangements() [3/4]
Default move constructor.
- Parameters
-
Gen | Random arrangement generator. |
◆ rand_arrangements() [4/4]
lal::generate::rand_arrangements::rand_arrangements |
( |
const uint64_t | n, |
|
|
const uint64_t | seed = 0 ) |
|
inlinenoexcept |
Constructor with number of vertices.
- Parameters
-
n | Number of vertices of the arrangements. |
seed | Seed of the random number generator. When 0, a random seed is used. |
◆ m_arr
The arrangement generated by this class.
Actually, generated by the std::next_permutation algorithm.
The documentation for this class was generated from the following file: