| 1713 | } |
| 1714 | |
| 1715 | void testDeleteKeep(const HighsIndexCollection& index_collection) { |
| 1716 | HighsInt delete_from_index; |
| 1717 | HighsInt delete_to_index; |
| 1718 | HighsInt keep_from_index; |
| 1719 | HighsInt keep_to_index; |
| 1720 | HighsInt current_set_entry; |
| 1721 | const std::vector<HighsInt>& set = index_collection.set_; |
| 1722 | const std::vector<HighsInt>& mask = index_collection.mask_; |
| 1723 | const HighsInt dimension = index_collection.dimension_; |
| 1724 | if (dev_run) { |
| 1725 | if (index_collection.is_interval_) { |
| 1726 | printf("With index interval [%" HIGHSINT_FORMAT ", %" HIGHSINT_FORMAT |
| 1727 | "] in [%d, %" HIGHSINT_FORMAT "]\n", |
| 1728 | index_collection.from_, index_collection.to_, 0, dimension - 1); |
| 1729 | } else if (index_collection.is_set_) { |
| 1730 | printf("With index set\n"); |
| 1731 | for (HighsInt entry = 0; entry < index_collection.set_num_entries_; |
| 1732 | entry++) |
| 1733 | printf(" %2" HIGHSINT_FORMAT "", entry); |
| 1734 | printf("\n"); |
| 1735 | for (HighsInt entry = 0; entry < index_collection.set_num_entries_; |
| 1736 | entry++) |
| 1737 | printf(" %2" HIGHSINT_FORMAT "", set[entry]); |
| 1738 | printf("\n"); |
| 1739 | } else { |
| 1740 | printf("With index mask\n"); |
| 1741 | for (HighsInt index = 0; index < dimension; index++) |
| 1742 | printf(" %2" HIGHSINT_FORMAT "", index); |
| 1743 | printf("\n"); |
| 1744 | for (HighsInt index = 0; index < dimension; index++) |
| 1745 | printf(" %2" HIGHSINT_FORMAT "", mask[index]); |
| 1746 | printf("\n"); |
| 1747 | } |
| 1748 | } |
| 1749 | |
| 1750 | keep_from_index = 0; |
| 1751 | if (index_collection.is_interval_) { |
| 1752 | keep_to_index = index_collection.from_ - 1; |
| 1753 | } else if (index_collection.is_set_) { |
| 1754 | current_set_entry = 0; |
| 1755 | keep_to_index = set[0] - 1; |
| 1756 | } else { |
| 1757 | keep_to_index = dimension; |
| 1758 | for (HighsInt index = 0; index < dimension; index++) { |
| 1759 | if (mask[index]) { |
| 1760 | keep_to_index = index - 1; |
| 1761 | break; |
| 1762 | } |
| 1763 | } |
| 1764 | } |
| 1765 | if (dev_run) |
| 1766 | printf("Keep [%2d, %2" HIGHSINT_FORMAT "]\n", 0, keep_to_index); |
| 1767 | if (keep_to_index >= dimension - 1) return; |
| 1768 | for (HighsInt k = 0; k < dimension; k++) { |
| 1769 | updateOutInIndex(index_collection, delete_from_index, delete_to_index, |
| 1770 | keep_from_index, keep_to_index, current_set_entry); |
| 1771 | if (dev_run) |
| 1772 | printf("Delete [%2" HIGHSINT_FORMAT ", %2" HIGHSINT_FORMAT |
no test coverage detected