| 954 | } |
| 955 | |
| 956 | HighsStatus 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 | |
| 987 | HighsStatus Highs::presolve() { |
| 988 | const HighsLogOptions& log_options = options_.log_options; |