CoinMpsCardReader
Very simple code for reading MPS data.
Very simple code for reading MPS data.
Public Methods
CoinMpsCardReader
Constructor expects file to be open This one takes gzFile if fp null.
CoinMpsCardReader(CoinFileInput * input, CoinMpsIO * reader)
Parameters:
input(CoinFileInput *)reader(CoinMpsIO *)
~CoinMpsCardReader
Destructor.
~CoinMpsCardReader()
readToNextSection
Read to next section.
COINSectionType readToNextSection()
nextField
Gets next field and returns section type e.g. COIN_COLUMN_SECTION.
COINSectionType nextField()
nextGmsField
Gets next field for .gms file and returns type.
int nextGmsField(int expectedType)
Parameters:
expectedType(int)
whichSection
Returns current section type.
COINSectionType whichSection()
setWhichSection
Sets current section type.
void setWhichSection(COINSectionType section)
Parameters:
section(COINSectionType)
freeFormat
Sees if free format.
bool freeFormat()
setFreeFormat
Sets whether free format. Mainly for blank RHS etc.
void setFreeFormat(bool yesNo)
Parameters:
yesNo(bool)
mpsType
Only for first field on card otherwise BLANK_COLUMN e.g.
COINMpsType mpsType()
cleanCard
Reads and cleans card - taking out trailing blanks - return 1 if EOF.
int cleanCard()
rowName
Returns row name of current field.
const char * rowName()
columnName
Returns column name of current field.
const char * columnName()
value
Returns value in current field.
double value()
valueString
Returns value as string in current field.
const char * valueString()
card
Whole card (for printing)
const char * card()
mutableCard
Whole card - so we look at it (not const so nextBlankOr will work for gms reader)
char * mutableCard()
setPosition
set position (again so gms reader will work)
void setPosition(char * position)
Parameters:
position(char *)
getPosition
get position (again so gms reader will work)
char * getPosition()
cardNumber
Returns card number.
CoinBigIndex cardNumber()
fileInput
Returns file input.
CoinFileInput * fileInput()
setStringsAllowed
Sets whether strings allowed.
void setStringsAllowed()
osi_strtod
type - 0 normal, 1 INTEL IEEE, 2 other IEEE
double osi_strtod(char * ptr, char ** output, int type)
Parameters:
ptr(char *)output(char **)type(int)
osi_strtod
For strings.
double osi_strtod(char * ptr, char ** output)
Parameters:
ptr(char *)output(char **)
strcpyAndCompress
remove blanks
void strcpyAndCompress(char * to, const char * from)
Parameters:
to(char *)from(const char *)
nextBlankOr
char * nextBlankOr(char * image)
Parameters:
image(char *)
Source
Header: layer-0/CoinUtils/src/CoinMpsIO.hpp