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

Method readBasis

highs/lp_data/Highs.cpp:846–870  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

844}
845
846HighsStatus Highs::readBasis(const std::string& filename) {
847 this->logHeader();
848 HighsStatus return_status = HighsStatus::kOk;
849 // Try to read basis file into read_basis
850 HighsBasis read_basis = basis_;
851 return_status = interpretCallStatus(
852 options_.log_options,
853 readBasisFile(options_.log_options, model_.lp_, read_basis, filename),
854 return_status, "readBasis");
855 if (return_status != HighsStatus::kOk) return return_status;
856 // Basis read OK: check whether it's consistent with the LP
857 if (!isBasisConsistent(model_.lp_, read_basis)) {
858 highsLogUser(options_.log_options, HighsLogType::kError,
859 "readBasis: invalid basis\n");
860 return HighsStatus::kError;
861 }
862 // Update the HiGHS basis and invalidate any simplex basis for the model
863 basis_ = read_basis;
864 basis_.valid = true;
865 basis_.useful = true;
866 // Follow implications of a new HiGHS basis
867 newHighsBasis();
868 // Can't use returnFromHighs since...
869 return HighsStatus::kOk;
870}
871
872HighsStatus Highs::writeModel(const std::string& filename) {
873 return writeLocalModel(model_, filename);

Callers 7

runMethod · 0.95
test_read_basisMethod · 0.80
TestBasis.cppFile · 0.80
testBasisReloadModelFunction · 0.80
testBasisRestartFunction · 0.80

Calls 5

logHeaderMethod · 0.95
interpretCallStatusFunction · 0.85
readBasisFileFunction · 0.85
isBasisConsistentFunction · 0.85
highsLogUserFunction · 0.85

Tested by 3

test_read_basisMethod · 0.64
testBasisReloadModelFunction · 0.64
testBasisRestartFunction · 0.64