|
tgen
|
Sequence instance. More...

Public Member Functions | |
| instance (const std::vector< T > &vec) | |
| Creates a sequence instance from a std::vector. | |
| int | size () const |
| Returns the size of the sequence instance. | |
| T & | operator[] (int idx) |
| Accesses the value at some position of the instance. | |
| instance & | sort () |
| Sorts the instance in non-decreasing order. | |
| instance & | reverse () |
| Reverses the instance. | |
| instance & | separator (char sep) |
| Sets separator for printing. | |
| instance | operator+ (const instance &rhs) |
| Concatenates two instances. | |
| std::vector< T > | to_std () const |
| Converts the instance to a std::vector. | |
| Public Member Functions inherited from tgen::gen_instance_base< instance > | |
| bool | operator< (const instance &rhs) const |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const instance &inst) |
| Prints the instance to a std::ostream. | |
Sequence instance.
Instance of a sequence.
It can be deterministically operated upon (see Generator Instance Operations for random operations) and printed through std::cout.
|
inline |
Creates a sequence instance from a std::vector.
| vec | The std::vector representing the instance. |
|
inline |
Concatenates two instances.
| rhs | The right-hand side. |
Linear.
|
inline |
Accesses the value at some position of the instance.
| idx | Index to be accessed. |
|
inline |
Reverses the instance.
O(n).
|
inline |
Sets separator for printing.
O(1).
|
inline |
Returns the size of the sequence instance.
|
inline |
Sorts the instance in non-decreasing order.
O(n log n).
|
inline |
Converts the instance to a std::vector.
|
friend |