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

Method colPresolve

highs/presolve/HPresolve.cpp:4409–4512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4407}
4408
4409HPresolve::Result HPresolve::colPresolve(HighsPostsolveStack& postsolve_stack,
4410 HighsInt col) {
4411 assert(!colDeleted[col]);
4412 const bool logging_on = analysis_.logging_on_;
4413
4414 // check bounds
4415 bool isFixed;
4416 HPRESOLVE_CHECKED_CALL(checkColBounds(col, &isFixed));
4417 if (isFixed) {
4418 // remove fixed column
4419 postsolve_stack.removedFixedCol(col, model->col_lower_[col],
4420 model->col_cost_[col],
4421 getColumnVector(col));
4422 removeFixedCol(col);
4423 return checkLimits(postsolve_stack);
4424 }
4425
4426 switch (colsize[col]) {
4427 case 0:
4428 return emptyCol(postsolve_stack, col);
4429 case 1:
4430 return singletonCol(postsolve_stack, col);
4431 default:
4432 break;
4433 }
4434
4435 // detect strong / weak domination
4436 HPRESOLVE_CHECKED_CALL(detectDominatedCol(postsolve_stack, col));
4437 if (colDeleted[col]) return Result::kOk;
4438
4439 // column is not (weakly) dominated
4440
4441 // integer columns cannot be used to tighten bounds on dual multipliers
4442 if (mipsolver != nullptr) {
4443 // lambda for changing implied row dual
4444 auto modifyImpliedRowDualBound = [&](HighsInt col, HighsInt row,
4445 HighsInt direction,
4446 bool isBoundImplied, HighsInt numInf) {
4447 if (isBoundImplied && row != -1 && numInf == 1 &&
4448 direction * model->col_cost_[col] >= 0 && !isRanged(row)) {
4449 HighsInt nzPos = findNonzero(row, col);
4450
4451 if (model->integrality_[col] != HighsVarType::kInteger ||
4452 (rowsizeInteger[row] == rowsize[row] &&
4453 rowCoefficientsIntegral(row, 1.0 / Avalue[nzPos]))) {
4454 if (direction * Avalue[nzPos] > 0)
4455 changeImplRowDualLower(row, 0.0, col);
4456 else
4457 changeImplRowDualUpper(row, 0.0, col);
4458 }
4459 }
4460 };
4461
4462 // if there is an infinite or redundant column lower bound, the reduced
4463 // cost of the column must not be positive (i.e. <= 0; the upper bound on
4464 // the reduced cost is zero).
4465 modifyImpliedRowDualBound(col, colLowerSource[col], HighsInt{1},
4466 isLowerImplied(col),

Callers

nothing calls this directly

Calls 3

removedFixedColMethod · 0.80
getNumInfSumUpperOrigMethod · 0.80
getNumInfSumLowerOrigMethod · 0.80

Tested by

no test coverage detected