43 for(
size_t i=0; i<n; i++)
Interface for the first normal form sorting network C1NF.
#define evenfloor(n)
If odd, round down to make even.
#define odd(n)
Oddness test.
Interface for the ternary reflected Gray code generator CTernaryGrayCode.
void Initialize()
Initialize the sorting test.
bool Sorts()
Does it sort all inputs?
bool EvenSorts()
Does it sort if there are an odd number of inputs and we fix the value on the last channel?
bool StillSorts(const size_t)
Does it still sort when a bit is changed?
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.
size_t FlipInput(size_t, const size_t, const size_t)
Recompute network values when a bit is changed.
size_t m_nZeros
Number of zeros in the input.
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.
CBinaryGrayCode * m_pGrayCode
Gray code generator.
Ternary reflected Gray code generator.