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

Method syncCutPool

highs/mip/HighsCutPool.cpp:640–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

638}
639
640void HighsCutPool::syncCutPool(const HighsMipSolver& mipsolver,
641 HighsCutPool& syncpool) {
642 HighsInt cutIndexEnd = matrix_.getNumRows();
643 std::vector<HighsInt> idxs;
644 std::vector<double> vals;
645
646 for (HighsInt i = 0; i != cutIndexEnd; ++i) {
647 // Only sync cuts in the LP that are not already synced
648 if ((numLps_[i] > 0 ||
649 ageResetWhileLocked_[i].load(std::memory_order_relaxed) == 1) &&
650 !hasSynced_[i]) {
651 HighsInt Rlen;
652 const HighsInt* Rindex;
653 const double* Rvalue;
654 getCut(i, Rlen, Rindex, Rvalue);
655 // copy cut into something mutable (addCut reorders so can't take const)
656 idxs.assign(Rindex, Rindex + Rlen);
657 vals.assign(Rvalue, Rvalue + Rlen);
658 syncpool.addCut(mipsolver, idxs.data(), vals.data(), Rlen, rhs_[i],
659 rowintegral[i]);
660 hasSynced_[i] = true;
661 }
662 }
663
664 assert((HighsInt)propRows.size() == numPropRows);
665}

Callers 1

runMethod · 0.80

Calls 5

addCutMethod · 0.80
dataMethod · 0.80
getNumRowsMethod · 0.45
loadMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected