| 646 | } |
| 647 | |
| 648 | static void deleteBasisEntries(std::vector<HighsBasisStatus>& status, |
| 649 | bool& deleted_basic, bool& deleted_nonbasic, |
| 650 | const HighsIndexCollection& index_collection, |
| 651 | const HighsInt entry_dim) { |
| 652 | assert(ok(index_collection)); |
| 653 | assert(static_cast<size_t>(entry_dim) == status.size()); |
| 654 | HighsInt from_k; |
| 655 | HighsInt to_k; |
| 656 | limits(index_collection, from_k, to_k); |
| 657 | if (from_k > to_k) return; |
| 658 | |
| 659 | HighsInt delete_from_entry; |
| 660 | HighsInt delete_to_entry; |
| 661 | HighsInt keep_from_entry; |
| 662 | HighsInt keep_to_entry = -1; |
| 663 | HighsInt current_set_entry = 0; |
| 664 | HighsInt new_num_entry = 0; |
| 665 | deleted_basic = false; |
| 666 | deleted_nonbasic = false; |
| 667 | for (HighsInt k = from_k; k <= to_k; k++) { |
| 668 | updateOutInIndex(index_collection, delete_from_entry, delete_to_entry, |
| 669 | keep_from_entry, keep_to_entry, current_set_entry); |
| 670 | // Account for the initial entries being kept |
| 671 | if (k == from_k) new_num_entry = delete_from_entry; |
| 672 | // Identify whether a basic or a nonbasic entry has been deleted |
| 673 | for (HighsInt entry = delete_from_entry; entry <= delete_to_entry; |
| 674 | entry++) { |
| 675 | if (status[entry] == HighsBasisStatus::kBasic) { |
| 676 | deleted_basic = true; |
| 677 | } else { |
| 678 | deleted_nonbasic = true; |
| 679 | } |
| 680 | } |
| 681 | if (delete_to_entry >= entry_dim - 1) break; |
| 682 | for (HighsInt entry = keep_from_entry; entry <= keep_to_entry; entry++) { |
| 683 | status[new_num_entry] = status[entry]; |
| 684 | new_num_entry++; |
| 685 | } |
| 686 | if (keep_to_entry >= entry_dim - 1) break; |
| 687 | } |
| 688 | status.resize(new_num_entry); |
| 689 | } |
| 690 | |
| 691 | static void deleteBasisCols(HighsBasis& basis, |
| 692 | const HighsIndexCollection& index_collection, |
no test coverage detected