|
Go to the documentation of this file.
28 #define MAX_RELAX_COUNT 2
29 #define LONGSTEP_FREQ 100
49 for( int i = 0; i < nflips; ++i )
76 range = lower - upper;
84 range = upper - lower;
96 << " lower: " << lower
97 << " upper: " << upper
101 MSG_DEBUG( std::cout << "PVEC flipped from: " << stat
105 << " lower: " << lower
106 << " upper: " << upper
111 assert( spxAbs(range) < 1e20);
113 if( objChange != 0.0 )
126 range = lower - upper;
134 range = upper - lower;
146 << " lower: " << lower
147 << " upper: " << upper
151 MSG_DEBUG( std::cout << "COPVEC flipped from: " << stat
155 << " lower: " << lower
156 << " upper: " << upper
161 assert( spxAbs(range) < 1e20);
163 if( objChange != 0.0 )
172 if( baseId.isSPxRowId() )
182 range = upper - lower;
189 range = lower - upper;
200 << " lower: " << lower
201 << " upper: " << upper
208 assert(baseId.isSPxColId());
218 range = upper - lower;
225 range = lower - upper;
236 << " lower: " << lower
237 << " upper: " << upper
242 MSG_DEBUG( std::cout << "basic row/col flipped from: " << stat
246 << " lower: " << lower
247 << " upper: " << upper
250 assert( spxAbs(range) < 1e20);
296 for( ; idx < last; ++idx )
304 Real y = upp[i] - vec[i];
312 if( curVal < minVal )
325 Real y = low[i] - vec[i];
333 if( curVal < minVal )
370 for( ; idx < last; ++idx )
378 Real y = low[i] - vec[i];
387 if( curVal < minVal )
400 Real y = upp[i] - vec[i];
408 if( curVal < minVal )
448 val = (max * x > 0) ? upp[idx] : low[idx];
449 val = (val - vec[idx]) / x;
450 if( upp[idx] == low[idx] )
453 if( vec[idx] > upp[idx] )
459 else if( (max > 0 && val < -degeneps) || (max < 0 && val > degeneps) )
476 val = (max * x > 0.0) ? upp[idx] : low[idx];
477 val = (val - vec[idx]) / x;
478 if( upp[idx] == low[idx] )
481 if( vec[idx] > upp[idx] )
487 else if( (max > 0 && val < -degeneps) || (max < 0 && val > degeneps) )
514 assert( src == FVEC );
523 val = (max * x > 0) ? upp[idx] : low[idx];
524 val = (val - vec[idx]) / x;
525 if( upp[idx] == low[idx] )
531 else if( (max > 0 && val < -degeneps) || (max < 0 && val > degeneps) )
557 MSG_DEBUG( std::cout << "DLBFRT06 resetting long step history" << std::endl; )
562 MSG_DEBUG( std::cout << "DLBFRT07 switching to fast ratio test" << std::endl; )
659 for( npassedBp = 0; npassedBp < nBp && slope > 0; ++npassedBp)
662 if( npassedBp > sorted )
681 if( absupd > moststable )
698 if( absupd > moststable )
704 assert(npassedBp >= 0);
707 if( slope > delta && npassedBp >= nBp - 1 )
710 << ": unboundedness in ratio test" << std::endl; )
718 << ": number of flip candidates: "
727 for( stableBp = npassedBp + 1; stableBp < nBp; ++stableBp )
729 Real stableDelta = 0;
731 if( stableBp > sorted )
746 if( spxAbs(x) > moststable )
749 stableDelta = (x > 0.0) ? upb[idx] : lpb[idx];
750 stableDelta = (stableDelta - pvec[idx]) / x;
752 if( stableDelta <= bestDelta)
769 if( spxAbs(x) > moststable )
771 stableDelta = (x > 0.0) ? ucb[idx] : lcb[idx];
772 stableDelta = (stableDelta - cvec[idx]) / x;
774 if( stableDelta <= bestDelta )
783 if( stableDelta > delta + bestDelta )
793 bool foundStable = false;
798 if( moststable > stab )
804 foundStable = getData(val, enterId, idx, stab, degeneps, pupd, pvec, lpb, upb, PVEC, max);
806 foundStable = getData(val, enterId, idx, stab, degeneps, cupd, cvec, lcb, ucb, COPVEC, max);
813 while( !foundStable && npassedBp >= 0 )
821 foundStable = getData(val, enterId, idx, stab, degeneps, pupd, pvec, lpb, upb, PVEC, max);
823 foundStable = getData(val, enterId, idx, stab, degeneps, cupd, cvec, lcb, ucb, COPVEC, max);
837 << ": no valid enterId found - relaxing..."
850 << " no valid enterId found - breaking..."
866 if( npassedBp >= 10 )
881 << " number of candidates: "
899 MSG_DEBUG( std::cout << "DEBFRT06 resetting long step history" << std::endl; )
905 MSG_DEBUG( std::cout << "DEBFRT07 switching to fast ratio test" << std::endl; )
978 slope = spxAbs(enterTest);
997 for( npassedBp = 0; npassedBp < nBp && slope > 0; ++npassedBp)
1000 if( npassedBp > sorted )
1024 slope -= (upper * absupd) - (lower * absupd);
1026 if( absupd > moststable )
1027 moststable = absupd;
1030 assert(npassedBp >= 0);
1033 if( slope > delta && npassedBp >= nBp - 1 )
1036 << ": unboundedness in ratio test" << std::endl; )
1044 << ": number of flip candidates: "
1053 for( stableBp = npassedBp + 1; stableBp < nBp; ++stableBp )
1055 Real stableDelta = 0;
1057 if( stableBp > sorted )
1063 Real x = upd[breakpointidx];
1064 if( spxAbs(x) > moststable )
1066 stableDelta = (x > 0.0) ? ub[breakpointidx] : lb[breakpointidx];
1067 stableDelta = (stableDelta - vec[breakpointidx]) / x;
1069 if( stableDelta <= bestDelta)
1076 else if( stableDelta > delta + bestDelta )
1086 bool foundStable = false;
1091 if( moststable > stab )
1095 assert(breakpointidx >= 0);
1096 foundStable = getData(val, leaveIdx, breakpointidx, moststable, degeneps, upd, vec, lb, ub, FVEC, max);
1103 while( !foundStable && npassedBp >= 0 )
1108 if( breakpointidx >= 0 )
1110 foundStable = getData(val, leaveIdx, breakpointidx, moststable, degeneps, upd, vec, lb, ub, FVEC, max);
1119 assert(leaveIdx < 0);
1124 << ": no valid leaveIdx found - relaxing..."
1137 << " no valid leaveIdx found - breaking..."
1153 if( npassedBp >= 10 )
1166 << ": selected Index: "
1168 << " number of candidates: "
|