26#ifndef __SortingNetwork_h__ 
   27#define __SortingNetwork_h__ 
   57    size_t FlipInput(
size_t, 
const size_t, 
const size_t); 
 
Interface for the binary reflected Gray code generator CBinaryGrayCode.
 
Interface for the comparator network CComparatorNetwork.
 
#define MAXDEPTH
Maximum depth.
 
#define MAXINPUTS
Maximum width, that is, number of inputs.
 
Binary reflected Gray code generator.
 
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.