Changeset 318
 Timestamp:
 Mar 15, 2010 11:22:58 PM (10 years ago)
 Location:
 trunk/Couenne/src/bound_tightening
 Files:

 4 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Couenne/src/bound_tightening/aggressiveBT.cpp
r307 r318 210 210 improved = 0; 211 211 212 if (variables_ [index] > sign () != exprVar::GEQ) { 212 if ((variables_ [index] > sign () != expression::GEQ) && 213 (X [index] >= Lb (index) + COUENNE_EPS)) { 213 214 214 215 Jnlst()>Printf(J_DETAILED, J_BOUNDTIGHTENING, … … 216 217 217 218 // tighten on left 218 if ((X [index] >= Lb (index) + COUENNE_EPS) 219 && ((improved = fake_tighten (0, index, X, olb, oub, chg_bds, f_chg)) < 0)) { 219 if ((improved = fake_tighten (0, index, X, olb, oub, chg_bds, f_chg)) < 0) { 220 220 retval = false; 221 221 break; … … 225 225 second = 0; 226 226 227 if (variables_ [index] > sign () != exprVar::LEQ) { 227 if (retval && (variables_ [index] > sign () != expression::LEQ) && 228 (X [index] <= Ub (index)  COUENNE_EPS)) { 228 229 Jnlst()>Printf(J_DETAILED, J_BOUNDTIGHTENING, 229 230 " tighten right x%d\n", index); 230 231 231 232 // tighten on right 232 if ((X [index] <= Ub (index)  COUENNE_EPS) 233 && ((second = fake_tighten (1, index, X, olb, oub, chg_bds, f_chg) < 0))) { 233 if ((second = fake_tighten (1, index, X, olb, oub, chg_bds, f_chg) < 0)) { 234 234 retval = false; 235 235 break; … … 247 247 248 248 if (Jnlst()>ProduceOutput(J_ITERSUMMARY, J_BOUNDTIGHTENING)) { 249 249 250 Jnlst()>Printf(J_ITERSUMMARY, J_BOUNDTIGHTENING,"\n"); 250 251 
trunk/Couenne/src/bound_tightening/fake_tightening.cpp
r308 r318 118 118 } 119 119 120 if ( (direction 120 if ( (direction && ((fb < inner)  (fb > outer)))  121 121 (!direction && ((fb > inner)  (fb < outer)))) 122 122 fb = 0.5 * (inner + outer); 
trunk/Couenne/src/bound_tightening/obbt.cpp
r312 r318 54 54 (Var (i) > Multiplicity () > 0) && 55 55 ((type == VAR)  56 (aSign == expression::EQ))) { 57 // 58 //((aSign == expression::LEQ) && (sense > 0))  59 //((aSign == expression::GEQ) && (sense < 0)))) { 56 (aSign == expression::EQ)  57 ((aSign == expression::LEQ) && (sense > 0))  58 ((aSign == expression::GEQ) && (sense < 0)))) { 60 59 61 60 int ni = obbt_iter (csi, chg_bds, warmstart, babInfo, objcoe, sense, i); 61 62 // { 63 // // ToDo: Pipe all output through journalist 64 // Jnlst()>Printf(J_DETAILED, J_BOUNDTIGHTENING, 65 // " bounds after obbt step =====================\n "); 66 // int j=0; 67 // for (int i=0; i < nVars (); i++) 68 // if (variables_ [i] > Multiplicity () > 0) { 69 // Jnlst()>Printf(J_VECTOR, J_BOUNDTIGHTENING, 70 // "x_%03d [%+10g %+10g] ", i, 71 // domain_. lb (i), 72 // domain_. ub (i)); 73 // if (!(++j % 6)) Jnlst()>Printf(J_VECTOR, J_BOUNDTIGHTENING,"\n "); 74 // } 75 // if (j % 6) Jnlst()>Printf(J_VECTOR, J_BOUNDTIGHTENING,"\n"); 76 // } 62 77 63 78 if (ni < 0) return ni; 
trunk/Couenne/src/bound_tightening/obbt_iter.cpp
r309 r318 111 111 112 112 if // independent variable is exactly bounded in both ways 113 (((chg_bds [indInd].lower() & t_chg_bounds::EXACT) && 114 (chg_bds [indInd].upper() & t_chg_bounds::EXACT))  115 // or if this expression is of the form w=cx+d, that is, it 116 // depends on one variable only and it is linear 117 (var > Image () > Linearity () <= LINEAR)) { 113 ((((chg_bds [indInd].lower() & t_chg_bounds::EXACT) && 114 (chg_bds [indInd].upper() & t_chg_bounds::EXACT))  115 // or if this expression is of the form w=cx+d, that is, it 116 // depends on one variable only and it is linear 117 (var > Image () > Linearity () <= LINEAR)) && 118 (var > sign () == expression::EQ)) { 118 119 119 120 issimple = true; … … 122 123 var > Image () > getBounds (lb, ub); 123 124 125 if (var > isInteger ()) { 126 lb = ceil (lb  COUENNE_EPS); 127 ub = floor (ub + COUENNE_EPS); 128 } 129 124 130 if (csi > getColLower () [index] < lb  COUENNE_EPS) { 125 131 csi > setColLower (index, lb); 132 Lb (index) = lb; 126 133 chg_bds [index].setLowerBits(t_chg_bounds::CHANGED  t_chg_bounds::EXACT); 127 134 } else chg_bds [index].setLowerBits(t_chg_bounds::EXACT); … … 129 136 if (csi > getColUpper () [index] > ub + COUENNE_EPS) { 130 137 csi > setColUpper (index, ub); 138 Ub (index) = ub; 131 139 chg_bds [index].setUpperBits(t_chg_bounds::CHANGED  t_chg_bounds::EXACT); 132 140 } else chg_bds [index].setUpperBits(t_chg_bounds::EXACT); … … 320 328 if (nImprov && jnlst_ > ProduceOutput (J_ITERSUMMARY, J_BOUNDTIGHTENING)) { 321 329 Jnlst () > Printf (J_ITERSUMMARY, J_BOUNDTIGHTENING, "OBBT: tightened ", nImprov); 322 if (jnlst_ > ProduceOutput (J_ITERSUMMARY, J_BOUNDTIGHTENING))Var (index) > print ();330 Var (index) > print (); 323 331 Jnlst () > Printf (J_ITERSUMMARY, J_BOUNDTIGHTENING, "\n"); 324 332 }
Note: See TracChangeset
for help on using the changeset viewer.