Changeset 126


Ignore:
Timestamp:
May 8, 2005 9:06:12 AM (14 years ago)
Author:
forrest
Message:

bit faster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Samples/gear.cpp

    r125 r126  
    114114  int row[2];
    115115  /* z - obviously we can't choose bounds too tight but we need bounds
    116      so choose 20% off as obviously feasible */
    117   double loZ = 0.5
    118 *(1.0/6.931), hiZ = 1.2*(1.0/6.931);
     116     so choose 20% off as obviously feasible.
     117     fastest way to solve would be too run for a few seconds to get
     118     tighter bounds then re-formulate and solve.  */
     119  double loose=0.2;
     120  double loZ = (1-loose)*(1.0/6.931), hiZ = (1+loose)*(1.0/6.931);
    119121  row[0]=0; // for reporting
    120122  row[1]=zbase+1; // for real use
     
    211213    build.setElement(zbase+2,base+2*i+1,-(i+loInt*loInt)*hiZ);
    212214  }
     215  // And finally two more rows to break symmetry
     216  build.setRowBounds(zbase+3,-COIN_DBL_MAX,0.0);
     217  build.setElement(zbase+3,1,1.0);
     218  build.setElement(zbase+3,4,-1.0);
     219  build.setRowBounds(zbase+4,-COIN_DBL_MAX,0.0);
     220  build.setElement(zbase+4,2,1.0);
     221  build.setElement(zbase+4,3,-1.0);
    213222  solver1.loadFromCoinModel(build);
    214223  // To make CbcBranchLink simpler assume that all variables with same i are consecutive
Note: See TracChangeset for help on using the changeset viewer.