#include <boolean.h>
Public Types | |
typedef BooleanSwitchFactory | Factory |
Public Methods | |
BooleanSwitch (const bool s) | |
~BooleanSwitch () | |
template<class Field> bool | apply (const Field &F, typename Field::Element &x, typename Field::Element &y) const |
template<class Field> bool | applyTranspose (const Field &F, typename Field::Element &x, typename Field::Element &y) const |
|
|
|
Constructor from an STL vector of booleans. The switch is applied using the vector of booleans. A true value means to swap the two elements, and a false value means not to. The apply function starts at the beginning of the vector moving forward through it, and applyTranspose function starts at the end moving backwards. Both repeat the vector after they pass through it.
|
|
Destructor. |
|
Apply switch function. Switches the elements in references according to current boolean value. Swaps the elements if boolean is true, otherwise does nothing. It is templatized by the element type to be swapped.
|
|
Apply switch transpose function. Switches the elements in references according to current boolean value. Swaps the elements if boolean is true, otherwise does nothing. It is templatized by the element type to be swapped.
|