src/classify/protos.cpp
int AddConfigToClass(CLASS_TYPE Class) {
  int NewNumConfigs;
  int NewConfig;
  int MaxNumProtos;
  BIT_VECTOR Config;

  MaxNumProtos = Class->MaxNumProtos;
  ASSERT_HOST(MaxNumProtos <= MAX_NUM_PROTOS);

  if (Class->NumConfigs >= Class->MaxNumConfigs) {
    /* add configs in CONFIG_INCREMENT chunks at a time */
    NewNumConfigs =
        (((Class->MaxNumConfigs + CONFIG_INCREMENT) / CONFIG_INCREMENT) * CONFIG_INCREMENT);

    Class->Configurations.resize(NewNumConfigs);
    Class->MaxNumConfigs = NewNumConfigs;
  }
  NewConfig = Class->NumConfigs++;
  Config = NewBitVector(MAX_NUM_PROTOS);
  Class->Configurations[NewConfig] = Config;
  zero_all_bits(Config, WordsInVectorOfSize(MAX_NUM_PROTOS));

  return (NewConfig);
}
/**
 * @name AddConfigToClass
 *
 * Add a new config to this class.  Malloc new space and copy the
 * old configs if necessary.  Return the config id for the new config.
 *
 * @param Class The class to add to
 */
@name AddConfigToClass
Add a new config to this class.  Malloc new space and copy the
old configs if necessary.  Return the config id for the new config.

@param Class The class to add to
@name AddConfigToClass Add a new config to this class . Malloc new space and copy the old configs if necessary . Return the config id for the new config . @param Class The class to add to
int AddConfigToClass(CLASS_TYPE Class) {
  int NewNumConfigs;
  int NewConfig;
  int MaxNumProtos;
  BIT_VECTOR Config;
  MaxNumProtos = Class->MaxNumProtos;
  ASSERT_HOST(MaxNumProtos <= MAX_NUM_PROTOS);
  if (Class->NumConfigs >= Class->MaxNumConfigs) {
    NewNumConfigs =
        (((Class->MaxNumConfigs + CONFIG_INCREMENT) / CONFIG_INCREMENT) * CONFIG_INCREMENT);
    Class->Configurations.resize(NewNumConfigs);
    Class->MaxNumConfigs = NewNumConfigs;
  }
  NewConfig = Class->NumConfigs++;
  Config = NewBitVector(MAX_NUM_PROTOS);
  Class->Configurations[NewConfig] = Config;
  zero_all_bits(Config, WordsInVectorOfSize(MAX_NUM_PROTOS));
  return (NewConfig);
}
int AddConfigToClass ( CLASS_TYPE Class ) { int NewNumConfigs ; int NewConfig ; int MaxNumProtos ; BIT_VECTOR Config ; MaxNumProtos = Class -> MaxNumProtos ; ASSERT_HOST ( MaxNumProtos <= MAX_NUM_PROTOS ) ; if ( Class -> NumConfigs >= Class -> MaxNumConfigs ) { NewNumConfigs = ( ( ( Class -> MaxNumConfigs + CONFIG_INCREMENT ) / CONFIG_INCREMENT ) * CONFIG_INCREMENT ) ; Class -> Configurations . resize ( NewNumConfigs ) ; Class -> MaxNumConfigs = NewNumConfigs ; } NewConfig = Class -> NumConfigs ++ ; Config = NewBitVector ( MAX_NUM_PROTOS ) ; Class -> Configurations [ NewConfig ] = Config ; zero_all_bits ( Config , WordsInVectorOfSize ( MAX_NUM_PROTOS ) ) ; return ( NewConfig ) ; }
@name AddConfigToClass
 Add a new config to this class.
@name AddConfigToClass Add a new config to this class .
/* add configs in CONFIG_INCREMENT chunks at a time */