Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages

BooleanSwitch Class Reference

#include <boolean.h>


Detailed Description

Boolean switch object. This is a switch predicate object that is applied to two references to elements to switch them as needed by the {Butterfly Switching Network BlackBox Matrix Object}.


Public Types

typedef BooleanSwitchFactory Factory

Public Member Functions

 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


Member Typedef Documentation

typedef BooleanSwitchFactory Factory
 


Constructor & Destructor Documentation

BooleanSwitch const bool  s  )  [inline]
 

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.

Parameters:
switches vector of switches

~BooleanSwitch  )  [inline]
 

Destructor.


Member Function Documentation

bool apply const Field F,
typename Field::Element x,
typename Field::Element y
const [inline]
 

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.

Returns:
bool true if swapped, false otherwise
Parameters:
x reference to first element to be switched
y reference to second element to be switched

bool applyTranspose const Field F,
typename Field::Element x,
typename Field::Element y
const [inline]
 

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.

Returns:
bool true if swapped, false otherwise
Parameters:
x reference to first element to be switched
y reference to second element to be switched


Generated on Fri Jul 8 10:29:57 2005 for linbox by doxygen 1.3.7