#include <mpsinput.h>
Public Types | |
Types | |
| enum | Section { NAME, OBJSEN, OBJNAME, ROWS, COLUMNS, RHS, RANGES, BOUNDS, ENDATA } |
| enum | Sense { MAXIMIZE = 1, MINIMIZE = -1 } |
| optimization sense. More... | |
| enum | { MAX_LINE_LEN = 256 } |
Public Member Functions | |
Construction / destruction | |
| MPSInput (std::istream &p_input) | |
| virtual | ~MPSInput () |
Access | |
| Section | section () const |
| int | lineno () const |
| const char * | field0 () const |
| const char * | field1 () const |
| const char * | field2 () const |
| const char * | field3 () const |
| const char * | field4 () const |
| const char * | field5 () const |
| const char * | probName () const |
| const char * | objName () const |
| Sense | objSense () const |
| bool | hasError () const |
| bool | isInteger () const |
Modification | |
| void | setSection (Section p_section) |
| void | setProbName (const char *p_probname) |
| void | setObjName (const char *p_objname) |
| void | setObjSense (Sense sense) |
Warnings and Errors | |
| void | syntaxError () |
| void | entryIgnored (const char *what, const char *what_name, const char *entity, const char *entity_name) |
Helpers | |
| bool | readLine () |
| reads an MPS format data line and parse the fields. More... | |
| void | insertName (const char *name, bool second=false) |
Inserts name as field 1 and shifts all other fields up. More... | |
Private data | |
| Section | m_section |
| std::istream & | m_input |
| the input stream from which the file is read More... | |
| int | m_lineno |
| line number More... | |
| Sense | m_objsense |
| objctive sense (maximization or minimization) More... | |
| bool | m_has_error |
is set to true upon a syntax error More... | |
| char | m_buf [MAX_LINE_LEN] |
| the line buffer More... | |
| const char * | m_f0 |
| first field in a line More... | |
| const char * | m_f1 |
| second field in a line More... | |
| const char * | m_f2 |
| third field in a line More... | |
| const char * | m_f3 |
| fourth field in a line More... | |
| const char * | m_f4 |
| fifth field in a line More... | |
| const char * | m_f5 |
| sixth field in a line More... | |
| char | m_probname [MAX_LINE_LEN] |
| problem name More... | |
| char | m_objname [MAX_LINE_LEN] |
| objective name More... | |
| bool | m_is_integer |
| bool | m_is_new_format |
| new MPS format? More... | |
| int | m_ignored |
| Number of already ignored entries. More... | |
| static const int | m_max_ignore = 1000 |
| Maximal number of ignored entries for which a warning will be issued. More... | |
Reads MPS input files. A right-hand side for the objective function is allowed but ignored.
Definition at line 34 of file mpsinput.h.
| anonymous enum |
| Enumerator | |
|---|---|
| MAX_LINE_LEN | |
Definition at line 56 of file mpsinput.h.
| enum Section |
| Enumerator | |
|---|---|
| NAME | |
| OBJSEN | |
| OBJNAME | |
| ROWS | |
| COLUMNS | |
| RHS | |
| RANGES | |
| BOUNDS | |
| ENDATA | |
Definition at line 43 of file mpsinput.h.
| enum Sense |
|
explicit |
Definition at line 110 of file mpsinput.h.
|
virtual |
Definition at line 128 of file mpsinput.h.
| void entryIgnored | ( | const char * | what, |
| const char * | what_name, | ||
| const char * | entity, | ||
| const char * | entity_name | ||
| ) |
Definition at line 244 of file mpsinput.h.
References MPSInput::insertName(), MSG_ERROR, and MPSInput::readLine().
| const char* field0 | ( | ) | const |
Definition at line 150 of file mpsinput.h.
References MPSInput::m_f0.
| const char* field1 | ( | ) | const |
Definition at line 155 of file mpsinput.h.
References MPSInput::m_f1.
| const char* field2 | ( | ) | const |
Definition at line 160 of file mpsinput.h.
References MPSInput::m_f2.
| const char* field3 | ( | ) | const |
Definition at line 165 of file mpsinput.h.
References MPSInput::m_f3.
| const char* field4 | ( | ) | const |
Definition at line 170 of file mpsinput.h.
References MPSInput::m_f4.
| const char* field5 | ( | ) | const |
Definition at line 175 of file mpsinput.h.
References MPSInput::m_f5.
| bool hasError | ( | ) | const |
Definition at line 195 of file mpsinput.h.
References MPSInput::m_has_error.
| void insertName | ( | const char * | name, |
| bool | second = false |
||
| ) |
Inserts name as field 1 and shifts all other fields up.
Insert name as field 1 and shift all other fields up.
Definition at line 259 of file mpsinput.cpp.
References MPSInput::m_f1, MPSInput::m_f2, MPSInput::m_f3, MPSInput::m_f4, and MPSInput::m_f5.
Referenced by MPSInput::entryIgnored().
| bool isInteger | ( | ) | const |
Definition at line 200 of file mpsinput.h.
References MPSInput::m_is_integer.
| int lineno | ( | ) | const |
Definition at line 145 of file mpsinput.h.
References MPSInput::m_lineno.
| const char* objName | ( | ) | const |
Definition at line 185 of file mpsinput.h.
References MPSInput::m_objname.
| Sense objSense | ( | ) | const |
Definition at line 190 of file mpsinput.h.
References MPSInput::m_objsense.
| const char* probName | ( | ) | const |
Definition at line 180 of file mpsinput.h.
References MPSInput::m_probname.
| bool readLine | ( | ) |
reads an MPS format data line and parse the fields.
read a MPS format data line and parse the fields.
Definition at line 58 of file mpsinput.cpp.
References BLANK, MPSInput::BOUNDS, soplex::clear_from(), MPSInput::COLUMNS, MPSInput::m_buf, MPSInput::m_f0, MPSInput::m_f1, MPSInput::m_f2, MPSInput::m_f3, MPSInput::m_f4, MPSInput::m_f5, MPSInput::m_input, MPSInput::m_is_integer, MPSInput::m_is_new_format, MPSInput::m_lineno, MPSInput::m_section, MSG_DEBUG, soplex::patch_field(), MPSInput::RANGES, and MPSInput::RHS.
Referenced by MPSInput::entryIgnored().
| Section section | ( | ) | const |
Definition at line 140 of file mpsinput.h.
References MPSInput::m_section.
| void setObjName | ( | const char * | p_objname | ) |
Definition at line 221 of file mpsinput.h.
References MPSInput::MAX_LINE_LEN, and soplex::spxSnprintf().
| void setObjSense | ( | Sense | sense | ) |
Definition at line 227 of file mpsinput.h.
| void setProbName | ( | const char * | p_probname | ) |
Definition at line 215 of file mpsinput.h.
References MPSInput::MAX_LINE_LEN, and soplex::spxSnprintf().
| void setSection | ( | Section | p_section | ) |
Definition at line 210 of file mpsinput.h.
| void syntaxError | ( | ) |
Definition at line 237 of file mpsinput.h.
References MSG_ERROR.
|
private |
|
private |
first field in a line
Definition at line 78 of file mpsinput.h.
Referenced by MPSInput::field0(), and MPSInput::readLine().
|
private |
second field in a line
Definition at line 80 of file mpsinput.h.
Referenced by MPSInput::field1(), MPSInput::insertName(), and MPSInput::readLine().
|
private |
third field in a line
Definition at line 82 of file mpsinput.h.
Referenced by MPSInput::field2(), MPSInput::insertName(), and MPSInput::readLine().
|
private |
fourth field in a line
Definition at line 84 of file mpsinput.h.
Referenced by MPSInput::field3(), MPSInput::insertName(), and MPSInput::readLine().
|
private |
fifth field in a line
Definition at line 86 of file mpsinput.h.
Referenced by MPSInput::field4(), MPSInput::insertName(), and MPSInput::readLine().
|
private |
sixth field in a line
Definition at line 88 of file mpsinput.h.
Referenced by MPSInput::field5(), MPSInput::insertName(), and MPSInput::readLine().
|
private |
is set to true upon a syntax error
Definition at line 74 of file mpsinput.h.
Referenced by MPSInput::hasError().
|
private |
Number of already ignored entries.
Definition at line 98 of file mpsinput.h.
|
private |
the input stream from which the file is read
Definition at line 68 of file mpsinput.h.
Referenced by MPSInput::readLine().
|
private |
Definition at line 94 of file mpsinput.h.
Referenced by MPSInput::isInteger(), and MPSInput::readLine().
|
private |
|
private |
line number
Definition at line 70 of file mpsinput.h.
Referenced by MPSInput::lineno(), and MPSInput::readLine().
|
staticprivate |
Maximal number of ignored entries for which a warning will be issued.
Definition at line 100 of file mpsinput.h.
|
private |
|
private |
objctive sense (maximization or minimization)
Definition at line 72 of file mpsinput.h.
Referenced by MPSInput::objSense().
|
private |
|
private |
Definition at line 66 of file mpsinput.h.
Referenced by MPSInput::readLine(), and MPSInput::section().