Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

initialization of multi dimensional array

  • 1.  initialization of multi dimensional array

    Posted 07/15/08 06:27 PM

    Originally posted by: SystemAdmin


    [typhoon said:]

    hallo!
    i try to initialize a 2 dimensional array by a 3 dimensional array. therefore i want to sum up the array values of the 3rd dimension...but of course: it isn´t as simple as i thought :)
    ...
    range range1=1..50;
    range range2=1..60;

    execute INITIALIZE{
      for ( var i in range1){
    for (var t in range2){

                D[i][t]= sum(var k in 1..t)d[i][k][t];
        }
        }
        writeln (D);
    }

    thanx for reading!

    ps.: Didier? do u know bar ourcq near the bassin de la villette? tell me if u want!
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: initialization of multi dimensional array

    Posted 07/15/08 07:04 PM

    Originally posted by: SystemAdmin


    [typhoon said:]

    ohh!!! i found a solution on my own:
    u just have to add
    ... 
      for (k in range2) {

                                D[i][t] += d[i][k][t];  //of course this term replaces the old one
      }
    ... and the world goes round! :)

    see ya!
    #DecisionOptimization
    #OPLusingCPLEXOptimizer