This function swaps this change with the change given by c in an efficient manner.
This returns the number of bells on which the change is defined.
This returns the sign of the change: -1 if an odd number of pairs are swapped, +1 if an even number of pairs are swapped.
Returns true if the change swaps bells i and i+1, and false otherwise.
Returns true if the change doesn't move the bell in the ith place (i.e. if iths place is made), and false otherwise.
This function returns the number of places made in the change.
If the change doesn't currently swap bells i and i+1, then this will add that swap. If those bells are swapped, this will remove the swap. If the bells i-1 and i, or i+1 and i+2, are currently swapped, those swaps are removed.
This returns true if after the function call, the pair of bells i and i+1 are swapped, and false otherwise. If exceptions are enabled and the bell i+1 is greater the number of bells in the change, an exception of class
change::out_of_range
will be thrown.This function makes it possible for the user to edit changes in such a way that they will always end up in a sensible state.
This returns the reverse of a change; that is, the change is flipped over so that on 8 bells for example, 2nds place becomes 7ths place and so on.
This returns true if the change contains internal places, and false otherwise.
This function prints the place notation for the change to a string.
This specialised the
swap
function which is defined in the standard library. The result is that certain standard algorithms may become much more efficient. Note that according to your namespace setup,swap
may need to be in namespacestd
; similarly,change
may or may not be in namespaceringing
. This is all taken care of.