52 for(UINT i=firstlayer; i<=lastlayer; i++)
64 m_bUsed[0][j] = bFirstNormalForm;
91 for(UINT i=firstlayer; i<=lastlayer; i++){
Interface for the sorting network CSortingNetwork.
Binary reflected Gray code generator.
virtual UINT Next()
Get next code word.
virtual void Initialize(const UINT)
Get first code word.
UINT * m_nGrayCodeWord
Current code word.
UINT m_nZeros
Number of zeros in the code word.
UINT ** m_nMatch
Matchings at each level.
virtual bool Read(LPWSTR)
Read from file.
const bool FirstNormalForm() const
Test for first normal form.
bool m_bSorts
True if it sorts, false if it doesn't or unknown.
UINT m_nInputs
Number of inputs.
bool ** m_bUsed
Whether comparators are used when sorting.
void initUsage()
Initialize usage array.
UINT flipinput(UINT j, const UINT firstlayer, const UINT lastlayer)
Recompute network values when a bit is changed.
const UINT GetUnused() const
Get number of unused comparators.
bool stillsorts(const int delta)
Does it still sort when a bit is changed?
UINT ** m_nValue
Values at each level when sorting.
bool Read(LPWSTR)
Read from file.
void initSortingTest()
Initialize the sorting test.
void initValues(const UINT firstlayer, const UINT lastlayer)
Initialize the network values to the all zero input.
bool sorts()
Does it sort?
void CreateUsageArray()
Make usage array.
void CreateValueArray()
Make value array.
~CSortingNetwork()
Destructor.
CBinaryGrayCode * m_pGrayCode
Gray code generator.
Ternary reflected Gray code generator.