Next: , Previous: The change Class, Up: Rows and changes



3.7 The permute function

The permute function is a utility function which makes it possible to use some of the standard algorithms contained in the C++ library. There are two forms of the function: the first takes an unsigned integer as its argument, and the second takes a reference to a row. In either case, a function object (of type permuter or row_permuter) is returned, which can be used with standard algorithms.

— Function: inline permuter permute (unsigned n);

This global function returns a function object of type permuter, which contains a row initialised to rounds on n bells. When the function object is called with an argument of either a row or change, its internal row is multiplied by that row or change and then returned.

— Function: inline row_permuter permute (row& r);

This global function creates a row_permuter function object, which contains a reference to the row r. When the function object is called with a row or change as an argument, the row r will be multiplied by that row or change.

— Operator: const row& permuter::operator() (const row& r);
— Operator: const row& permuter::operator() (const change& c);

These operators multiply the permutation contained in the permuter object by the given row or change, and return the new permutation.

— Operator: const row& row_permuter::operator() (const row& r);
— Operator: const row& row_permuter::operator() (const change& c);

These operators multiply the row which the row_permuter object refers to by the given row or change. A reference to that row is returned.