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

Method writeBasis

highs/lp_data/Highs.cpp:956–985  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

954}
955
956HighsStatus Highs::writeBasis(const std::string& filename) {
957 HighsStatus return_status = HighsStatus::kOk;
958 HighsStatus call_status;
959 FILE* file;
960 HighsFileType file_type;
961 call_status = openWriteFile(filename, "writeBasis", file, file_type);
962 return_status = interpretCallStatus(options_.log_options, call_status,
963 return_status, "openWriteFile");
964 if (return_status == HighsStatus::kError) return return_status;
965 call_status = normaliseNames(this->options_.log_options, this->model_.lp_);
966 return_status = interpretCallStatus(options_.log_options, call_status,
967 return_status, "normaliseNames");
968 assert(call_status != HighsStatus::kError);
969
970 // Report to user that basis is being written
971 if (filename != "") {
972 if (!basis_.valid) {
973 highsLogUser(options_.log_options, HighsLogType::kWarning,
974 "No basis to write: generated null basis file %s\n",
975 filename.c_str());
976 return_status = HighsStatus::kWarning;
977 } else {
978 highsLogUser(options_.log_options, HighsLogType::kInfo,
979 "Writing the basis to %s\n", filename.c_str());
980 }
981 }
982 writeBasisFile(file, options_, model_.lp_, basis_);
983 if (file != stdout) fclose(file);
984 return return_status;
985}
986
987HighsStatus Highs::presolve() {
988 const HighsLogOptions& log_options = options_.log_options;

Callers 9

runMethod · 0.95
test_read_basisMethod · 0.80
TestFilereader.cppFile · 0.80
TestBasis.cppFile · 0.80
TestCallbacks.cppFile · 0.80

Calls 5

interpretCallStatusFunction · 0.85
normaliseNamesFunction · 0.85
highsLogUserFunction · 0.85
writeBasisFileFunction · 0.85
c_strMethod · 0.80

Tested by 3

test_read_basisMethod · 0.64