Changeset 1047


Ignore:
Timestamp:
Jan 19, 2014 7:22:31 PM (6 years ago)
Author:
pbelotti
Message:

fix inequality-based auxiliaries for exprTrilinear

Location:
trunk/Couenne/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/bound_tightening/operators/impliedBounds-exprPow.cpp

    r1042 r1047  
    113113      CouNumber lb = wl, ub = wu;
    114114
    115       //printf ("should be here: wl=%g wu=%g k=%g, signpow=%d safepow = %g\n", wl, wu, k, issignpower_, safe_pow (wl, 1./k, issignpower_));
    116 
    117115      if (k < 0) { // swap bounds as they swap on the curve x^k when
    118116        lb = wu;
  • trunk/Couenne/src/bound_tightening/operators/impliedBounds-exprTrilinear.cpp

    r560 r1047  
    3131  return false;
    3232}
    33 
  • trunk/Couenne/src/convex/operators/conv-exprTrilinear-gencuts.cpp

    r597 r1047  
    5959    ind[i] = new int[6];
    6060  }
    61      
     61
    6262  int *ibnd;
    6363  ibnd = new int[3];
     
    652652    // compute the permutations of the 3 variables
    653653    ibnd[0] = v1; ibnd[1] = v2; ibnd[2] = v3;
    654    ind[0][0] = ibnd[0]; ind[0][1] = ibnd[1]; ind[0][2] = ibnd[2];
    655    ind[1][0] = ibnd[1]; ind[1][1] = ibnd[0]; ind[1][2] = ibnd[2];
     654    ind[0][0] = ibnd[0]; ind[0][1] = ibnd[1]; ind[0][2] = ibnd[2];
     655    ind[1][0] = ibnd[1]; ind[1][1] = ibnd[0]; ind[1][2] = ibnd[2];
    656656    int i, flagg=0, idx=0;
    657657    i = 0;
     
    11501150  expression **args = w -> Image () -> ArgList ();
    11511151
    1152   int *varInd = new int [4];
     1152  int varInd [4];
    11531153
    11541154  for (int i=0; i<3; i++)
     
    11811181
    11821182    double *coe = new double [size];
     1183
     1184    // Fix right hand sides: all cuts have coefficients of w equal to
     1185    // one, but they might be inequality-type auxiliaries.
     1186
     1187    exprAux *waux = dynamic_cast <exprAux *> (w);
     1188
     1189    if (waux) {
     1190      if      (waux -> sign () == expression::AUX_LEQ) cutLb [i] = - COUENNE_INFINITY;
     1191      else if (waux -> sign () == expression::AUX_GEQ) cutUb [i] =   COUENNE_INFINITY;
     1192    }
    11831193
    11841194    std::copy (cutIndices [i].begin (), cutIndices [i].end (), ind);
     
    12401250    cs.insert (cut);
    12411251  }
    1242 
    1243   delete [] varInd;
     1252  //delete [] varInd;
    12441253}
  • trunk/Couenne/src/convex/operators/conv-exprTrilinear.cpp

    r490 r1047  
    5555
    5656  CouNumber
    57     *lbA = new CouNumber [3],
    58     *ubA = new CouNumber [3];
     57    lbA [3],
     58    ubA [3];
    5959
    6060  for (int i=0; i<3; i++)
     
    6868      for (int i2 = 0; i2 < 2; i2++) {
    6969
    70         double curbound =
     70        register double curbound =
    7171          (i0 ? ubA [0] : lbA [0]) *
    7272          (i1 ? ubA [1] : lbA [1]) *
     
    7676        if (curbound > ub) ub = curbound;
    7777      }
    78 
    79   delete [] lbA;
    80   delete [] ubA;
    8178}
Note: See TracChangeset for help on using the changeset viewer.