Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Array Initialization in Cplex.

    Posted 03/14/09 06:49 PM

    Originally posted by: SystemAdmin


    [ArushGadkar said:]

    Hello,
    I have a two dimensional variable array P of size [5][6]declared as :

    typedef IloArray<IloNumVarArray> NumVarMatrix;
    IloInt Nodes = 5;
    IloInt Slots = 6;

    // Initialization
    NumVarMatrix P(env,Nodes);
    for(a = 0 ; a < Nodes ; a++)<br />{
    P[a] = IloNumVarArray(env,Slots,0,1,ILOINT);
    }
    This works fine .....

    Now if i have a three dimensional array P[3][3][10] defined as :
    typedef IloArray<IloArray<IloNumVarArray> > NumVarMatrix;

    IloInt N = 3;
    IloInt K = 10;
    // Initialization
    NumVarMatrix P(env,N);
    for(a = 0 ; a < N ; a++)<br />{
            for(b= 0 ; b < N ; b++)<br />        {
              P[a][b] = IloNumVarArray(env,K,0,1,ILOINT);
            }

    }
    This is giving me a ERROR.
    Can you tell me the correct way of initializing this [3][3][10]

    I have just three constraints which i think are correctly put in. I think It is the way i am declaring the P matrix.
    Your help is greatly appreciated.
    Arush.
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Array Initialization in Cplex.

    Posted 03/31/09 01:40 AM

    Originally posted by: SystemAdmin


    [EdKlotz said:]

    See my response on 3/30/09 to a similar question involving 3-D arrays.  Your problem seems to
    be similar. 
    #CPLEXOptimizers
    #DecisionOptimization