MCPcopy Create free account
hub / github.com/ERGO-Code/HiGHS / quadChooseFinalWorkGroupQuad

Method quadChooseFinalWorkGroupQuad

highs/simplex/HEkkDualRow.cpp:375–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

373}
374
375bool HEkkDualRow::quadChooseFinalWorkGroupQuad() {
376 const HighsCDouble Td = ekk_instance_.options_->dual_feasibility_tolerance;
377 HighsInt fullCount = workCount;
378 workCount = 0;
379 HighsCDouble totalChange = kInitialTotalChange;
380 HighsCDouble selectTheta = workTheta;
381 const HighsCDouble totalDelta = fabs(workDelta);
382 workGroup.clear();
383 workGroup.push_back(0);
384 HighsInt prev_workCount = workCount;
385 HighsCDouble prev_remainTheta = kInitialRemainTheta;
386 HighsCDouble prev_selectTheta = selectTheta;
387
388 while (selectTheta < kMaxSelectTheta) {
389 HighsCDouble remainTheta = kInitialRemainTheta;
390 for (HighsInt i = workCount; i < fullCount; i++) {
391 HighsInt iCol = workData[i].first;
392 HighsCDouble value = workData[i].second;
393 HighsCDouble dual = workMove[iCol] * workDual[iCol];
394 // Tight satisfy
395 if (dual <= selectTheta * value) {
396 swap(workData[workCount++], workData[i]);
397 totalChange += value * (workRange[iCol]);
398 } else if (dual + Td < remainTheta * value) {
399 remainTheta = (dual + Td) / value;
400 }
401 }
402 workGroup.push_back(workCount);
403
404 // Update selectTheta with the value of remainTheta;
405 selectTheta = remainTheta;
406 // Check for no change in this loop - to prevent infinite loop
407 if ((workCount == prev_workCount) && (prev_selectTheta == selectTheta) &&
408 (prev_remainTheta == remainTheta)) {
409 HighsInt num_var =
410 ekk_instance_.lp_.num_col_ + ekk_instance_.lp_.num_row_;
411 debugDualChuzcFailQuad0(*ekk_instance_.options_, workCount, workData,
412 num_var, workDual, (double)selectTheta,
413 (double)remainTheta, true);
414 return false;
415 }
416 // Record the initial values of workCount, remainTheta and selectTheta for
417 // the next pass through the loop - to check for infinite loop condition
418 prev_workCount = workCount;
419 prev_remainTheta = remainTheta;
420 prev_selectTheta = selectTheta;
421 if (totalChange >= totalDelta || workCount == fullCount) break;
422 }
423 // Check that at least one group has been identified
424 if ((HighsInt)workGroup.size() <= 1) {
425 HighsInt num_var = ekk_instance_.lp_.num_col_ + ekk_instance_.lp_.num_row_;
426 debugDualChuzcFailQuad1(*ekk_instance_.options_, workCount, workData,
427 num_var, workDual, (double)selectTheta, true);
428 return false;
429 }
430 return true;
431}
432

Callers

nothing calls this directly

Calls 5

debugDualChuzcFailQuad0Function · 0.85
debugDualChuzcFailQuad1Function · 0.85
push_backMethod · 0.80
clearMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected