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

Method emplaceNode

highs/mip/HighsNodeQueue.cpp:362–386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360}
361
362double HighsNodeQueue::emplaceNode(std::vector<HighsDomainChange>&& domchgs,
363 std::vector<HighsInt>&& branchPositions,
364 double lower_bound, double estimate,
365 HighsInt depth) {
366 int64_t pos;
367
368 assert(estimate != kHighsInf);
369
370 if (freeslots.empty()) {
371 pos = nodes.size();
372 nodes.emplace_back(std::move(domchgs), std::move(branchPositions),
373 lower_bound, estimate, depth);
374 } else {
375 pos = freeslots.top();
376 freeslots.pop();
377 nodes[pos] = OpenNode(std::move(domchgs), std::move(branchPositions),
378 lower_bound, estimate, depth);
379 }
380
381 assert(nodes[pos].lower_bound == lower_bound);
382 assert(nodes[pos].estimate == estimate);
383 assert(nodes[pos].depth == depth);
384
385 return link(pos);
386}
387
388HighsNodeQueue::OpenNode&& HighsNodeQueue::popBestNode() {
389 int64_t bestNode = hybridEstimMin;

Callers 5

runMethod · 0.80
currentNodeToQueueMethod · 0.80
openNodesToQueueMethod · 0.80
HighsSearch.cppFile · 0.80
evaluateRootNodeMethod · 0.80

Calls 4

OpenNodeClass · 0.85
emptyMethod · 0.45
sizeMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected