|
DyLP
1.10.4
|
Very simple code for reading MPS data. More...
#include <CoinMpsIO.hpp>
Collaboration diagram for CoinMpsCardReader:Public Member Functions | |
Constructor and destructor | |
| CoinMpsCardReader (CoinFileInput *input, CoinMpsIO *reader) | |
| Constructor expects file to be open This one takes gzFile if fp null. More... | |
| ~CoinMpsCardReader () | |
| Destructor. More... | |
card stuff | |
| COINSectionType | readToNextSection () |
| Read to next section. More... | |
| COINSectionType | nextField () |
| Gets next field and returns section type e.g. COIN_COLUMN_SECTION. More... | |
| int | nextGmsField (int expectedType) |
| Gets next field for .gms file and returns type. More... | |
| COINSectionType | whichSection () const |
| Returns current section type. More... | |
| void | setWhichSection (COINSectionType section) |
| Sets current section type. More... | |
| bool | freeFormat () const |
| Sees if free format. More... | |
| void | setFreeFormat (bool yesNo) |
| Sets whether free format. Mainly for blank RHS etc. More... | |
| COINMpsType | mpsType () const |
| Only for first field on card otherwise BLANK_COLUMN e.g. More... | |
| int | cleanCard () |
| Reads and cleans card - taking out trailing blanks - return 1 if EOF. More... | |
| const char * | rowName () const |
| Returns row name of current field. More... | |
| const char * | columnName () const |
| Returns column name of current field. More... | |
| double | value () const |
| Returns value in current field. More... | |
| const char * | valueString () const |
| Returns value as string in current field. More... | |
| const char * | card () const |
| Whole card (for printing) More... | |
| char * | mutableCard () |
| Whole card - so we look at it (not const so nextBlankOr will work for gms reader) More... | |
| void | setPosition (char *position) |
| set position (again so gms reader will work) More... | |
| char * | getPosition () const |
| get position (again so gms reader will work) More... | |
| CoinBigIndex | cardNumber () const |
| Returns card number. More... | |
| CoinFileInput * | fileInput () const |
| Returns file input. More... | |
| void | setStringsAllowed () |
| Sets whether strings allowed. More... | |
Protected Attributes | |
data | |
| double | value_ |
| Current value. More... | |
| char | card_ [MAX_CARD_LENGTH] |
| Current card image. More... | |
| char * | position_ |
| Current position within card image. More... | |
| char * | eol_ |
| End of card. More... | |
| COINMpsType | mpsType_ |
| Current COINMpsType. More... | |
| char | rowName_ [COIN_MAX_FIELD_LENGTH] |
| Current row name. More... | |
| char | columnName_ [COIN_MAX_FIELD_LENGTH] |
| Current column name. More... | |
| CoinFileInput * | input_ |
| File input. More... | |
| COINSectionType | section_ |
| Which section we think we are in. More... | |
| CoinBigIndex | cardNumber_ |
| Card number. More... | |
| bool | freeFormat_ |
| Whether free format. Just for blank RHS etc. More... | |
| int | ieeeFormat_ |
| Whether IEEE - 0 no, 1 INTEL, 2 not INTEL. More... | |
| bool | eightChar_ |
| If all names <= 8 characters then allow embedded blanks. More... | |
| CoinMpsIO * | reader_ |
| MpsIO. More... | |
| CoinMessageHandler * | handler_ |
| Message handler. More... | |
| CoinMessages | messages_ |
| Messages. More... | |
| char | valueString_ [COIN_MAX_FIELD_LENGTH] |
| Current element as characters (only if strings allowed) More... | |
| bool | stringsAllowed_ |
| Whether strings allowed. More... | |
methods | |
| double | osi_strtod (char *ptr, char **output, int type) |
| type - 0 normal, 1 INTEL IEEE, 2 other IEEE More... | |
| double | osi_strtod (char *ptr, char **output) |
| For strings. More... | |
| static void | strcpyAndCompress (char *to, const char *from) |
| remove blanks More... | |
| static char * | nextBlankOr (char *image) |
Very simple code for reading MPS data.
Definition at line 90 of file CoinMpsIO.hpp.
| CoinMpsCardReader::CoinMpsCardReader | ( | CoinFileInput * | input, |
| CoinMpsIO * | reader | ||
| ) |
Constructor expects file to be open This one takes gzFile if fp null.
| CoinMpsCardReader::~CoinMpsCardReader | ( | ) |
Destructor.
| COINSectionType CoinMpsCardReader::readToNextSection | ( | ) |
Read to next section.
| COINSectionType CoinMpsCardReader::nextField | ( | ) |
Gets next field and returns section type e.g. COIN_COLUMN_SECTION.
| int CoinMpsCardReader::nextGmsField | ( | int | expectedType | ) |
Gets next field for .gms file and returns type.
-1 - EOF 0 - what we expected (and processed so pointer moves past) 1 - not what we expected leading blanks always ignored input types 0 - anything - stops on non blank card 1 - name (in columnname) 2 - value 3 - value name pair 4 - equation type 5 - ;
|
inline |
Returns current section type.
Definition at line 124 of file CoinMpsIO.hpp.
|
inline |
Sets current section type.
Definition at line 129 of file CoinMpsIO.hpp.
|
inline |
Sees if free format.
Definition at line 134 of file CoinMpsIO.hpp.
|
inline |
Sets whether free format. Mainly for blank RHS etc.
Definition at line 139 of file CoinMpsIO.hpp.
|
inline |
Only for first field on card otherwise BLANK_COLUMN e.g.
COIN_E_ROW
Definition at line 145 of file CoinMpsIO.hpp.
| int CoinMpsCardReader::cleanCard | ( | ) |
Reads and cleans card - taking out trailing blanks - return 1 if EOF.
|
inline |
Returns row name of current field.
Definition at line 152 of file CoinMpsIO.hpp.
|
inline |
Returns column name of current field.
Definition at line 157 of file CoinMpsIO.hpp.
|
inline |
Returns value in current field.
Definition at line 162 of file CoinMpsIO.hpp.
|
inline |
Returns value as string in current field.
Definition at line 167 of file CoinMpsIO.hpp.
|
inline |
Whole card (for printing)
Definition at line 172 of file CoinMpsIO.hpp.
|
inline |
Whole card - so we look at it (not const so nextBlankOr will work for gms reader)
Definition at line 177 of file CoinMpsIO.hpp.
|
inline |
set position (again so gms reader will work)
Definition at line 182 of file CoinMpsIO.hpp.
|
inline |
get position (again so gms reader will work)
Definition at line 187 of file CoinMpsIO.hpp.
|
inline |
Returns card number.
Definition at line 192 of file CoinMpsIO.hpp.
|
inline |
Returns file input.
Definition at line 197 of file CoinMpsIO.hpp.
|
inline |
Sets whether strings allowed.
Definition at line 202 of file CoinMpsIO.hpp.
| double CoinMpsCardReader::osi_strtod | ( | char * | ptr, |
| char ** | output, | ||
| int | type | ||
| ) |
type - 0 normal, 1 INTEL IEEE, 2 other IEEE
|
static |
remove blanks
|
static |
| double CoinMpsCardReader::osi_strtod | ( | char * | ptr, |
| char ** | output | ||
| ) |
For strings.
|
protected |
Current value.
Definition at line 213 of file CoinMpsIO.hpp.
|
protected |
Current card image.
Definition at line 215 of file CoinMpsIO.hpp.
|
protected |
Current position within card image.
Definition at line 217 of file CoinMpsIO.hpp.
|
protected |
End of card.
Definition at line 219 of file CoinMpsIO.hpp.
|
protected |
Current COINMpsType.
Definition at line 221 of file CoinMpsIO.hpp.
|
protected |
Current row name.
Definition at line 223 of file CoinMpsIO.hpp.
|
protected |
Current column name.
Definition at line 225 of file CoinMpsIO.hpp.
|
protected |
File input.
Definition at line 227 of file CoinMpsIO.hpp.
|
protected |
Which section we think we are in.
Definition at line 229 of file CoinMpsIO.hpp.
|
protected |
Card number.
Definition at line 231 of file CoinMpsIO.hpp.
|
protected |
Whether free format. Just for blank RHS etc.
Definition at line 233 of file CoinMpsIO.hpp.
|
protected |
Whether IEEE - 0 no, 1 INTEL, 2 not INTEL.
Definition at line 235 of file CoinMpsIO.hpp.
|
protected |
If all names <= 8 characters then allow embedded blanks.
Definition at line 237 of file CoinMpsIO.hpp.
|
protected |
MpsIO.
Definition at line 239 of file CoinMpsIO.hpp.
|
protected |
Message handler.
Definition at line 241 of file CoinMpsIO.hpp.
|
protected |
Messages.
Definition at line 243 of file CoinMpsIO.hpp.
|
protected |
Current element as characters (only if strings allowed)
Definition at line 245 of file CoinMpsIO.hpp.
|
protected |
Whether strings allowed.
Definition at line 247 of file CoinMpsIO.hpp.
1.8.5