[Cgl] Parameter class for all generators

fmargot at andrew.cmu.edu fmargot at andrew.cmu.edu
Sat Nov 25 12:42:20 EST 2006


As a first step in defining a more uniform interface for all cut generators
in Cgl, I have added a new class, CglParam containing parameters that
are common to most generators. Right now, its data members are:

   // Value for infinity. Default: DBL_MAX.
   double INFINIT;

   // EPSILON for double comparisons. Default: 0.
   double EPS;

   // Returned cuts do not have coefficients with absolute value smaller
   // than EPS_COEFF. Default: 0.
   double EPS_COEFF;

   /** Value added to the right hand side of each generated cut to relax it.
       Default: 0 */
   double EPS_RELAX_ABS;

   /** For a generated cut with right hand side rhs_val,
       EPS_RELAX_EPS * fabs(rhs_val) is used to relax the constraint.
       Default: 0 */
   double EPS_RELAX_REL;

   /** Maximum number of non zero coefficients in a generated cut;
       Default: INT_MAX */
   int MAX_SUPPORT;

Each generator may derive a class for additional parameters. To illustrate
what I have in mind, I modified the CglRedSplit generator. It now uses
a class CglRedSplitParam holding parameter specific to that generator.

The goal is to have most (if not all) constants used in a generator 
in its parameter class, with possibility for the user to change these
values. Each cut generator is free to choose the default values for all
of its parameters.

The difference from the user point of view is that it is possible to
create a CglParam object and use it to initialize the parameters 
for a collection of generators, without having the set/get each parameter
individually. For example:

CglParam cpar;
cpar.setMAX_SUPPORT(100);

Then for each generator:

Create the parameters for the generator:  CglRedSplitParam rspar(cpar);

Create the generator itself:              CglRedSplit cutGen(rspar);

Feel free to comment, in particular if do not like it. The code is available 
through subversion in Cgl/trunk.

Francois


More information about the Cgl mailing list