@@ -572,23 +572,23 @@ void HighsMipSolver::run() {
572572 HighsInt worker_id = indices[i];
573573 if (search_results[worker_id] == HighsSearch::NodeResult::kSubOptimal ) {
574574 analysis_.mipTimerStart (kMipClockCurrentNodeToQueue );
575- mipdata_->workers [indices[ worker_id] ].search_ptr_ ->currentNodeToQueue (
575+ mipdata_->workers [worker_id].search_ptr_ ->currentNodeToQueue (
576576 mipdata_->nodequeue );
577577 analysis_.mipTimerStop (kMipClockCurrentNodeToQueue );
578578 }
579579 }
580580 };
581581
582582 auto handlePrunedNodes = [&](std::vector<HighsInt>& indices) -> bool {
583- std::deque< bool > infeasible (num_workers, false );
584- std::deque< bool > flush (num_workers, false );
585- std::vector<bool > prune (num_workers, false );
583+ std::vector< uint8_t > infeasible (num_workers, 0 );
584+ std::vector< uint8_t > flush (num_workers, 0 );
585+ std::vector<uint8_t > prune (num_workers, 0 );
586586 bool multiple_workers = num_workers > 1 ;
587587 auto doHandlePrunedNodes = [&](HighsInt i) {
588588 if (!mipdata_->workers [i].search_ptr_ ->currentNodePruned ()) return ;
589589 HighsDomain& globaldom = mipdata_->workers [i].getGlobalDomain ();
590590 mipdata_->workers [i].search_ptr_ ->backtrack ();
591- flush[i] = true ;
591+ flush[i] = 1 ;
592592
593593 globaldom.propagate ();
594594 if (!multiple_workers) {
@@ -597,7 +597,7 @@ void HighsMipSolver::run() {
597597 }
598598
599599 if (globaldom.infeasible ()) {
600- infeasible[i] = true ;
600+ infeasible[i] = 1 ;
601601 if (!multiple_workers) {
602602 mipdata_->nodequeue .clear ();
603603 mipdata_->pruned_treeweight = 1.0 ;
@@ -615,7 +615,7 @@ void HighsMipSolver::run() {
615615 return ;
616616 }
617617
618- prune[i] = true ;
618+ prune[i] = 1 ;
619619
620620 if (multiple_workers || mipdata_->checkLimits ()) {
621621 return ;
@@ -635,25 +635,25 @@ void HighsMipSolver::run() {
635635 analysis_.mipTimerStart (kMipClockNodePrunedLoop );
636636 runTask (doHandlePrunedNodes, tg, true , indices);
637637 // Flush pruned nodes statistics that haven't yet been flushed
638- for (HighsInt i = 0 ; i != num_workers; ++i ) {
639- if (flush[i]) {
638+ for (HighsInt i : indices ) {
639+ if (flush[i] == 1 ) {
640640 ++mipdata_->num_leaves ;
641641 ++mipdata_->num_nodes ;
642- mipdata_->workers [indices[i] ].search_ptr_ ->flushStatistics ();
642+ mipdata_->workers [i ].search_ptr_ ->flushStatistics ();
643643 }
644644 }
645645 // Remove search indices that need a new node
646646 HighsInt num_search_indices = static_cast <HighsInt>(indices.size ());
647647 for (HighsInt i = num_search_indices - 1 ; i >= 0 ; i--) {
648- if (prune[i] ) {
648+ if (prune[indices[i]] == 1 ) {
649649 num_search_indices--;
650650 std::swap (indices[i], indices[num_search_indices]);
651651 }
652652 }
653653 indices.resize (num_search_indices);
654654
655- for (bool status : infeasible) {
656- if (status) {
655+ for (uint8_t status : infeasible) {
656+ if (status == 1 ) {
657657 mipdata_->nodequeue .clear ();
658658 mipdata_->pruned_treeweight = 1.0 ;
659659
@@ -805,7 +805,7 @@ void HighsMipSolver::run() {
805805 };
806806
807807 auto runHeuristics = [&](std::vector<HighsInt>& indices) -> void {
808- std::vector<bool > suboptimal (num_workers, false );
808+ std::vector<uint8_t > suboptimal (num_workers, 0 );
809809 auto doRunHeuristics = [&](HighsInt i) -> void {
810810 HighsMipWorker& worker = mipdata_->workers [i];
811811 // analysis_.mipTimerStart(kMipClockDiveEvaluateNode);
@@ -814,7 +814,7 @@ void HighsMipSolver::run() {
814814 // analysis_.mipTimerStop(kMipClockDiveEvaluateNode);
815815
816816 if (evaluate_node_result == HighsSearch::NodeResult::kSubOptimal ) {
817- suboptimal[i] = true ;
817+ suboptimal[i] = 1 ;
818818 return ;
819819 }
820820
@@ -845,7 +845,7 @@ void HighsMipSolver::run() {
845845 };
846846 runTask (doRunHeuristics, tg, true , indices);
847847 for (const HighsInt i : indices) {
848- if (! suboptimal[i]) {
848+ if (suboptimal[i] == 0 ) {
849849 if (mipdata_->workers [i].search_ptr_ ->currentNodePruned ()) {
850850 ++mipdata_->num_leaves ;
851851 mipdata_->workers [i].search_ptr_ ->flushStatistics ();
@@ -856,7 +856,7 @@ void HighsMipSolver::run() {
856856 // Remove search indices that have suboptimal status
857857 HighsInt num_search_indices = static_cast <HighsInt>(indices.size ());
858858 for (HighsInt i = num_search_indices - 1 ; i >= 0 ; i--) {
859- if (suboptimal[indices[i]]) {
859+ if (suboptimal[indices[i]] == 1 ) {
860860 num_search_indices--;
861861 std::swap (indices[i], indices[num_search_indices]);
862862 }
0 commit comments