Decision Optimization

Decision Optimization

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


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

why error for creating a 2-dimensional float array?

  • 1.  why error for creating a 2-dimensional float array?

    Posted 08/02/12 05:22 PM

    Originally posted by: SystemAdmin


    Hi all,
    I need to create a 2-d array for storing only float calculated constants. I tried to create it in two ways as follows:
    1) IloArray<IloNumArray> uSum0(env, h); // uSum[i][s] = sum_{over}j,t{|dist_h[i][j] - dist_l[s][t]|}
    for (int i = 0; i < h; i++) {
    if ( s >= heurM[i] - x_DQ && s <= heurM[i] + x_DQ ) {
    uSum0[i] = IloNumArray(env, l); }

    // Define 2-dim array to store intermediate summation in transformed constraint
    IloArray<IloArray<IloNum>> uSum(env, h); // uSum[i][s] = sum_{over}j,t{|dist_h[i][j] - dist_l[s][t]|}
    for (int i = 0; i < h; i++) {
    uSum[i] = IloArray<IloNum> (env, l);
    for (int s = 0; s < l; s++) {
    if ( s >= heurM[i] - x_DQ && s <= heurM[i] + x_DQ ) {
    uSum[i][s] = IloNum(env); }
    }
    }
    /*/define 2-d array for Yis upperbound const
    IloArray<IloNumArray> uSum0(env, h); // uSum[i][s] = sum_{over}j,t{|dist_h[i][j] - dist_l[s][t]|}
    for (int i = 0; i < h; i++) {
    if ( s >= heurM[i] - x_DQ && s <= heurM[i] + x_DQ ) {
    uSum0[i] = IloNumArray(env, l); }
    }*/
    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: why error for creating a 2-dimensional float array?

    Posted 08/03/12 06:19 PM

    Originally posted by: SystemAdmin


    Duplicate of this thread.
    #DecisionOptimization
    #MathematicalProgramming-General