ILOG CPLEX 11.0 User's Manual > Discrete Optimization > Using Logical Constraints: Food Manufacture 2 > Representing the Data > What Is Unknown?

The variables of the problem can be represented in arrays:

like this:

      IloNumVarArray produce(env, nbMonths, 0, IloInfinity);
      NumVarMatrix   use(env, nbMonths);
      NumVarMatrix   buy(env, nbMonths);
      NumVarMatrix   store(env, nbMonths);
      IloInt i, p;
      for (i = 0; i < nbMonths; i++) {
         use[i]   = IloNumVarArray(env, nbProducts, 0, IloInfinity);
         buy[i]   = IloNumVarArray(env, nbProducts, 0, IloInfinity);
         store[i] = IloNumVarArray(env, nbProducts, 0, 1000);
      }

In those lines, the type NumVarMatrix is defined as:

typedef IloArray<IloNumVarArray> NumVarMatrix;

Notice that how much to use and buy is initially unknown, and thus has an infinite upper bound, whereas the amount of oil that can be stored is limited, as you know from the description of the problem. Consequently, one of the constraints is expressed here as the upper bound of 1000 on the amount of oil by type that can be stored per month.