/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* This file is part of the HiGHS linear optimization suite */ /* */ /* Written and engineered 2008-2022 at the University of Edinburgh */ /* */ /* Available as open-source under the MIT License */ /* */ /* Authors: Julian Hall, Ivet Galabova, Leona Gottwald and Michael */ /* Feldmeier */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /**@file io/HMPSIO.h * @brief */ #ifndef IO_HMPSIO_H_ #define IO_HMPSIO_H_ #include #include #include #include #include #include #include "io/Filereader.h" #include "util/HighsInt.h" using std::string; using std::vector; const HighsInt MPS_ROW_TY_N = 0; const HighsInt MPS_ROW_TY_E = 1; const HighsInt MPS_ROW_TY_L = 2; const HighsInt MPS_ROW_TY_G = 3; const HighsInt field_1_start = 1; const HighsInt field_1_width = 2; const HighsInt field_2_start = 4; const HighsInt field_2_width = 8; const HighsInt field_3_start = 14; const HighsInt field_3_width = 8; const HighsInt field_4_start = 24; const HighsInt field_4_width = 12; const HighsInt field_5_start = 39; const HighsInt field_5_width = 8; const HighsInt field_6_start = 49; const HighsInt field_6_width = 12; FilereaderRetcode readMps( const HighsLogOptions& log_options, const std::string filename, HighsInt mxNumRow, HighsInt mxNumCol, HighsInt& numRow, HighsInt& numCol, ObjSense& objSense, double& objOffset, vector& Astart, vector& Aindex, vector& Avalue, vector& colCost, vector& colLower, vector& colUpper, vector& rowLower, vector& rowUpper, vector& integerColumn, std::string& objective_name, vector& col_names, vector& row_names, HighsInt& Qdim, vector& Qstart, vector& Qindex, vector& Qvalue, HighsInt& cost_row_location, const HighsInt keep_n_rows = 0); HighsStatus writeMps( const HighsLogOptions& log_options, const std::string filename, const std::string model_name, const HighsInt& num_row, const HighsInt& num_col, const HighsInt& q_dim, const ObjSense& sense, const double& offset, const vector& col_cost, const vector& col_lower, const vector& col_upper, const vector& row_lower, const vector& row_upper, const vector& a_start, const vector& a_index, const vector& a_value, const vector& q_start, const vector& q_index, const vector& q_value, const vector& integrality, std::string objective_name, const vector& col_names, const vector& row_names, const bool use_free_format = true); bool load_mpsLine(std::istream& file, HighsVarType& integerVar, HighsInt lmax, char* line, char* flag, double* data); HighsStatus writeModelAsMps(const HighsOptions& options, const std::string filename, const HighsModel& model, const bool free = true); #endif /* IO_HMPSIO_H_ */