45 for(
size_t i=first; i<=last; i++)
76 const size_t nBit =
m_nValue[first][j] ^ 1;
79 for(
size_t i=first; i<=last; i++){
#define xor(i, j)
Exclusive-or.
Interface for the sorting network CSortingNetwork.
Binary reflected Gray code generator.
virtual size_t Next()
Get next code word.
virtual void Initialize()
Get first code word.
size_t m_nComparator[MAXDEPTH][MAXINPUTS]
Comparator array.
static size_t m_nWidth
Comparator network width.
static size_t m_nDepth
Comparator network depth.
virtual void Initialize()
Initialize the sorting test.
size_t FlipInput(size_t, const size_t, const size_t)
Recompute network values when a bit is changed.
virtual bool Sorts()
Does it sort?
virtual bool StillSorts(const size_t)
Does it still sort when a bit is changed?
size_t m_nZeros
Number of zeros in the input.
CSortingNetwork()
Constructor.
void InitValues(const size_t, const size_t)
Initialize the network values to the all zero input.
size_t m_nValue[MAXDEPTH][MAXINPUTS]
Values at each level when sorting.
~CSortingNetwork()
Destructor.
CBinaryGrayCode * m_pGrayCode
Gray code generator.