libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
Random

Defined in ranges.hpp.

This struct can be used to select a single random item from an input range. This can be extremely inefficient if the input range is large, because every item in the range prior to the randomly chosen one must be iterated through when get is called.

Example
auto wg = make<WordGraph<uint8_t>>(4, [[0, 1], [1, 0], [2, 2]]);
Paths p(wg);
p.source(0).max(10);
p.count(); // returns 1023
(p | Random()).get(); // returns random path in p
Range for iterating through paths in a WordGraph.
Definition paths.hpp:601
enable_if_is_same< Return, Blocks > make(Container const &cont)
Check the arguments, construct a Blocks object, and check it.
Definition bipart.hpp:798
Random()=default
Default constructor.

Public Member Functions

 Random ()=default
 Default constructor.
 
 Random (Random &&)=default
 Default move constructor.
 
 Random (Random const &)=default
 Default copy constructor.
 
Randomoperator= (Random &&)=default
 Default move assignment operator.
 
Randomoperator= (Random const &)=default
 Default copy assignment operator.
 

Constructor & Destructor Documentation

◆ Random() [1/3]

Random ( )
default

Default constructor.

◆ Random() [2/3]

Random ( Random const & )
default

Default copy constructor.

◆ Random() [3/3]

Random ( Random && )
default

Default move constructor.

Member Function Documentation

◆ operator=() [1/2]

Random & operator= ( Random && )
default

Default move assignment operator.

◆ operator=() [2/2]

Random & operator= ( Random const & )
default

Default copy assignment operator.


The documentation for this struct was generated from the following file: