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

Function testAllDeleteKeep

check/TestLpModification.cpp:1781–1832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1779}
1780
1781bool testAllDeleteKeep(HighsInt num_row) {
1782 // Test the extraction of intervals from index collections
1783 std::vector<HighsInt> set = {1, 4, 5, 8};
1784 std::vector<HighsInt> mask = {0, 1, 0, 0, 1, 1, 0, 0, 1, 0};
1785
1786 HighsIndexCollection index_collection;
1787 index_collection.dimension_ = num_row;
1788 index_collection.is_interval_ = false;
1789 index_collection.from_ = 3;
1790 index_collection.to_ = 6;
1791 index_collection.is_set_ = false;
1792 index_collection.set_num_entries_ = 4;
1793 index_collection.set_ = set;
1794 index_collection.is_mask_ = false;
1795 index_collection.mask_ = mask;
1796
1797 HighsInt save_from = index_collection.from_;
1798 HighsInt save_set_0 = set[0];
1799 HighsInt save_mask_0 = mask[0];
1800
1801 HighsInt to_pass = 2; // 2
1802 for (HighsInt pass = 0; pass <= to_pass; pass++) {
1803 if (dev_run)
1804 printf("\nTesting delete-keep: pass %" HIGHSINT_FORMAT "\n", pass);
1805 if (pass == 1) {
1806 // Mods to test LH limit behaviour
1807 index_collection.from_ = 0;
1808 set[0] = 0;
1809 mask[0] = 1;
1810 } else if (pass == 2) {
1811 // Mods to test RH limit behaviour
1812 index_collection.from_ = save_from;
1813 index_collection.to_ = 9;
1814 set[0] = save_set_0;
1815 set[3] = 9;
1816 mask[0] = save_mask_0;
1817 mask[9] = 1;
1818 }
1819
1820 index_collection.is_interval_ = true;
1821 testDeleteKeep(index_collection);
1822 index_collection.is_interval_ = false;
1823
1824 index_collection.is_set_ = true;
1825 testDeleteKeep(index_collection);
1826 index_collection.is_set_ = false;
1827
1828 index_collection.is_mask_ = true;
1829 testDeleteKeep(index_collection);
1830 }
1831 return true;
1832}
1833
1834void messageReportLp(const char* message, const HighsLp& lp) {
1835 HighsLogOptions log_options;

Callers 1

Calls 1

testDeleteKeepFunction · 0.85

Tested by

no test coverage detected