ILOG CPLEX 11.0 User's Manual > Discrete Optimization > Using Column Generation: a Cutting Stock Example > Developing the Model: Building and Modifying > Pattern Generator Model

The submodel of the cutting stock problem is represented by the model patGen in this example. This pattern generator patGen (in contrast to cutOpt) is defined by the integer variables in the array Use. That array appears in the only constraint added to patGen: a scalar product making sure that the patterns used do not exceed the width of rolls. The application also adds a rudimentary objective function to patGen. This objective initially consists of only the constant 1 (one). The rest of the objective function depends on the solution found with the initial model cutOpt. The application will build that objective function as that information is computed. Here, in short, is patGen:

    IloModel patGen (env);

    IloObjective ReducedCost = IloAdd(patGen, IloMinimize(env, 1));
    IloNumVarArray Use(env, nWdth, 0, IloInfinity, ILOINT);
    patGen.add(IloScalProd(size, Use) <= rollWidth);