Defined in word-range.hpp.
This class implements a range object for the lower level functions cbegin_wislo and cbegin_wilo. The purpose of this class is to provide a more user-friendly interface with cbegin_wislo and cbegin_wilo.
The order and range of the words in a WordRange instance can be set using the member functions:
Public Types | |
| using | output_type = word_type const& |
| The type of the output of a WordRange object. | |
| using | size_type = typename std::vector<word_type>::size_type |
| Alias for the size type. | |
Public Member Functions | |
| WordRange () | |
| Default constructor. | |
| WordRange (WordRange &&) | |
| Default move constructor. | |
| WordRange (WordRange const &) | |
| Default copy constructor. | |
| size_type | alphabet_size () const noexcept |
| The current number of letters in the alphabet. | |
| WordRange & | alphabet_size (size_type n) noexcept |
| Set the number of letters in the alphabet. | |
| bool | at_end () const noexcept |
| Check if the range object is exhausted. | |
| auto | begin () const noexcept |
| Returns an input iterator pointing to the first word in the range. | |
| size_t | count () const noexcept |
| The actual size of the range. | |
| auto | end () const noexcept |
| Returns an input iterator pointing one beyond the last word in the range. | |
| word_type const & | first () const noexcept |
| The current first word in the range. | |
| WordRange & | first (word_type const &frst) |
| Set the first word in the range. | |
| output_type | get () const noexcept |
| Get the current value. | |
| WordRange & | init () |
| Initialize an existing WordRange object. | |
| word_type const & | last () const noexcept |
| The current one past the last word in the range. | |
| WordRange & | last (word_type const &lst) |
| Set one past the last word in the range. | |
| WordRange & | max (size_type val) |
| Set one past the last word in the range by length. | |
| WordRange & | min (size_type val) |
| Set the first word in the range by length. | |
| void | next () noexcept |
| Advance to the next value. | |
| WordRange & | operator= (WordRange &&) |
| Default move assignment operator. | |
| WordRange & | operator= (WordRange const &) |
| Default copy assignment operator. | |
| Order | order () const noexcept |
| The current order of the words in the range. | |
| WordRange & | order (Order val) |
| Set the order of the words in the range. | |
| size_t | size_hint () const noexcept |
| The possible size of the range. | |
| size_type | upper_bound () const noexcept |
| The current upper bound on the length of a word in the range. | |
| WordRange & | upper_bound (size_type n) |
| Set an upper bound for the length of a word in the range. | |
| bool | valid () const noexcept |
| Returns whether or not the settings have been changed since the last time either next or get has been called. | |
|
inline |
Constructs an empty range with:
0;0;0;0.
|
inlinenodiscardnoexcept |
Sets the number of letters in a WordRange object to n.
| n | the number of letters. |
*this.noexcept and is guaranteed never to throw.
|
inlinenodiscardnoexcept |
Returns true if a WordRange object is exhausted, and false if not.
bool.noexcept and is guaranteed never to throw.
|
inlinenoexcept |
|
nodiscardnoexcept |
Returns the number of words in a WordRange object. If order() is Order::shortlex, then size_hint() is used. If order() is not Order::shortlex, then a copy of the range may have to be looped over in order to find the return value of this function.
size_t.noexcept and is guaranteed never to throw.
|
inlinenoexcept |
|
inlinenodiscardnoexcept |
Sets the first word in a WordRange object to be frst. This function performs no checks on its arguments. If frst contains letters greater than alphabet_size(), then the WordRange object will be empty. Similarly, if first() is greater than last() with respect to order(), then the object will be empty.
| frst | the first word. |
*this.
|
inlinenodiscardnoexcept |
Returns the current word in a WordRange object.
noexcept and is guaranteed never to throw.true, then the return value of this function could be anything. | WordRange & init | ( | ) |
This function puts a WordRange object back into the same state as if it had been newly default constructed.
*this.
|
inlinenodiscardnoexcept |
Sets one past the last word in a WordRange object to be lst. This function performs no checks on its arguments. If lst contains letters greater than alphabet_size(), then the WordRange object will be empty.
| lst | one past the last word. |
*this.Sets one past the last word in a WordRange object to be pow(0_w, val) (the word consisting of val letters equal to 0).
| val | the exponent. |
*this.Sets the first word in a WordRange object to be pow(0_w, val) (the word consisting of val letters equal to 0).
| val | the exponent. |
*this.
|
inlinenoexcept |
|
inlinenodiscardnoexcept |
Sets the order of the words in a WordRange object to val.
| val | the order. |
*this.| LibsemigroupsException | if val is not Order::shortlex or Order::lex. |
|
inlinenodiscardnoexcept |
Returns the number of words in a WordRange object if order() is Order::shortlex. If order() is not Order::shortlex, then the return value of this function is meaningless.
size_t.noexcept and is guaranteed never to throw.
|
inlinenodiscardnoexcept |
Returns the current upper bound on the length of a word in a WordRange object. This setting is only used if order() is Order::lex.
noexcept and is guaranteed never to throw. Sets an upper bound for the length of a word in a WordRange object. This setting is only used if order() is Order::lex.
| n | the upper bound. |
*this.
|
inlinenoexcept |
Other than by calling next, the value returned by get may be altered by a call to one of the following:
This function returns true if none of the above settings have been changed since the last time next or get is called, and false otherwise.
bool.
|
staticconstexpr |
Value indicating that the range is finite.
|
staticconstexpr |