| 1831 | } |
| 1832 | |
| 1833 | HighsStatus Highs::getIisInterfaceReturn( |
| 1834 | const HighsStatus return_status, const HighsOptions& original_options, |
| 1835 | const std::vector<bool>& original_callback_active) { |
| 1836 | // Restore options and callbacks |
| 1837 | this->options_ = original_options; |
| 1838 | for (int i = kCallbackMin; i <= kCallbackMax; i++) { |
| 1839 | if (original_callback_active[i]) this->startCallback(i); |
| 1840 | } |
| 1841 | |
| 1842 | // Exit early if there was an error |
| 1843 | if (return_status == HighsStatus::kError) { |
| 1844 | // Report final results |
| 1845 | this->iis_.reportFinal(original_options); |
| 1846 | return return_status; |
| 1847 | } |
| 1848 | assert(this->iis_.valid_); |
| 1849 | |
| 1850 | // A valid HighsIis instance is one for which the information is |
| 1851 | // known to be correct |
| 1852 | // |
| 1853 | // In the case of a system that's feasible this will give empty |
| 1854 | // HighsIis::col_index_ and HighsIis::row_index_ |
| 1855 | // |
| 1856 | // If the system is infeasible, then it's possible that only an IS |
| 1857 | // (not an IIS) has been formed. This will be identified by the |
| 1858 | // HighsIis::col_bound_ and HighsIis::row_bound_ of the columns and |
| 1859 | // rows in HighsIis::col_index_ and HighsIis::row_index_ being |
| 1860 | // kIisStatusMaybeInConflict, rather than kIisStatusInConflict |
| 1861 | // |
| 1862 | // The columns and rows not in HighsIis::col_index_ and |
| 1863 | // HighsIis::row_index_ have HighsIis::col_bound_ and |
| 1864 | // HighsIis::row_bound_ values set to kIisStatusNotInConflict |
| 1865 | |
| 1866 | // If the IIS process has identified infeasibility, then set |
| 1867 | if (this->iis_.status_ >= kIisModelStatusTimeLimit) |
| 1868 | this->model_status_ = HighsModelStatus::kInfeasible; |
| 1869 | |
| 1870 | HighsLp& lp = this->model_.lp_; |
| 1871 | HighsLp& iis_lp = this->iis_.model_.lp_; |
| 1872 | const bool has_is = |
| 1873 | this->iis_.col_index_.size() || this->iis_.row_index_.size(); |
| 1874 | const bool has_iis = this->iis_.status_ == kIisModelStatusIrreducible; |
| 1875 | |
| 1876 | HighsOptions opts = this->options_; |
| 1877 | opts.time_limit = kHighsInf; |
| 1878 | opts.simplex_iteration_limit = kHighsIInf; |
| 1879 | opts.objective_bound = kHighsInf; |
| 1880 | |
| 1881 | if (has_iis) assert(has_is); |
| 1882 | if (has_is) { |
| 1883 | // Construct the HighsIis LP |
| 1884 | this->iis_.setLp(lp); |
| 1885 | // Check that the LP data are OK (correspond to original model |
| 1886 | // reduced to HighsIis col/row and bound data). |
| 1887 | bool lp_data_ok = this->iis_.lpDataOk(lp, opts); |
| 1888 | assert(lp_data_ok); |
| 1889 | if (!lp_data_ok) { |
| 1890 | // Report final results |
no test coverage detected