FeatureNumList::FeatureNumList (const BitString&  bitString):
  featureNums              (NULL),
  featureNumsAllocatedSize (0),
  maxFeatureNum            (0),
  numOfFeatures            (0)

{
  auto bitStringLen = bitString.BitLen ();
  if (bitStringLen > maxIntType)
  {
    KKStr errMsg (256);
    errMsg << "FeatureNumList (const BitString&  bitString)  bitString.BitLen()[" << bitStringLen << "] >  maxIntType[" << maxIntType << "].";
    cerr << errMsg << endl;
    throw KKException (errMsg);
  }

  maxFeatureNum = (IntType)(bitStringLen - 1);

  VectorIntType  listOfSelectedFeatures;
  bitString.ListOfSetBits16 (listOfSelectedFeatures);
  AllocateArraySize ((IntType)listOfSelectedFeatures.size ());
  for  (kkuint32 x = 0;  x < listOfSelectedFeatures.size ();  x++)
    AddFeature (listOfSelectedFeatures[x]);
}