CoinMpsCardReader Class Reference

Very simple code for reading MPS data. More...

#include <CoinMpsIO.hpp>

Collaboration diagram for CoinMpsCardReader:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Constructor and destructor

 CoinMpsCardReader (CoinFileInput *input, CoinMpsIO *reader)
 Constructor expects file to be open This one takes gzFile if fp null.
 ~CoinMpsCardReader ()
 Destructor.
card stuff

COINSectionType readToNextSection ()
 Read to next section.
COINSectionType nextField ()
 Gets next field and returns section type e.g. COIN_COLUMN_SECTION.
int nextGmsField (int expectedType)
 Gets next field for .gms file and returns type.
COINSectionType whichSection () const
 Returns current section type.
void setWhichSection (COINSectionType section)
 Sets current section type.
bool freeFormat () const
 Sees if free format.
void setFreeFormat (bool yesNo)
 Sets whether free format. Mainly for blank RHS etc.
COINMpsType mpsType () const
 Only for first field on card otherwise BLANK_COLUMN e.g.
int cleanCard ()
 Reads and cleans card - taking out trailing blanks - return 1 if EOF.
const char * rowName () const
 Returns row name of current field.
const char * columnName () const
 Returns column name of current field.
double value () const
 Returns value in current field.
const char * valueString () const
 Returns value as string in current field.
const char * card () const
 Whole card (for printing).
char * mutableCard ()
 Whole card - so we look at it (not const so nextBlankOr will work for gms reader).
void setPosition (char *position)
 set position (again so gms reader will work)
char * getPosition () const
 get position (again so gms reader will work)
CoinBigIndex cardNumber () const
 Returns card number.
CoinFileInputfileInput () const
 Returns file input.
void setStringsAllowed ()
 Sets whether strings allowed.

Protected Attributes

data

double value_
 Current value.
char card_ [MAX_CARD_LENGTH]
 Current card image.
char * position_
 Current position within card image.
char * eol_
 End of card.
COINMpsType mpsType_
 Current COINMpsType.
char rowName_ [COIN_MAX_FIELD_LENGTH]
 Current row name.
char columnName_ [COIN_MAX_FIELD_LENGTH]
 Current column name.
CoinFileInputinput_
 File input.
COINSectionType section_
 Which section we think we are in.
CoinBigIndex cardNumber_
 Card number.
bool freeFormat_
 Whether free format. Just for blank RHS etc.
int ieeeFormat_
 Whether IEEE - 0 no, 1 INTEL, 2 not INTEL.
bool eightChar_
 If all names <= 8 characters then allow embedded blanks.
CoinMpsIOreader_
 MpsIO.
CoinMessageHandlerhandler_
 Message handler.
CoinMessages messages_
 Messages.
char valueString_ [COIN_MAX_FIELD_LENGTH]
 Current element as characters (only if strings allowed).
bool stringsAllowed_
 Whether strings allowed.

methods



double osi_strtod (char *ptr, char **output, int type)
 type - 0 normal, 1 INTEL IEEE, 2 other IEEE
double osi_strtod (char *ptr, char **output)
 For strings.
static void strcpyAndCompress (char *to, const char *from)
 remove blanks
static char * nextBlankOr (char *image)
 type - 0 normal, 1 INTEL IEEE, 2 other IEEE

Detailed Description

Very simple code for reading MPS data.

Definition at line 60 of file CoinMpsIO.hpp.


Constructor & Destructor Documentation

CoinMpsCardReader::CoinMpsCardReader ( CoinFileInput input,
CoinMpsIO reader 
)

Constructor expects file to be open This one takes gzFile if fp null.

CoinMpsCardReader::~CoinMpsCardReader (  ) 

Destructor.


Member Function Documentation

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 - ;

COINSectionType CoinMpsCardReader::whichSection (  )  const [inline]

Returns current section type.

Definition at line 96 of file CoinMpsIO.hpp.

void CoinMpsCardReader::setWhichSection ( COINSectionType  section  )  [inline]

Sets current section type.

Definition at line 100 of file CoinMpsIO.hpp.

bool CoinMpsCardReader::freeFormat (  )  const [inline]

Sees if free format.

Definition at line 104 of file CoinMpsIO.hpp.

void CoinMpsCardReader::setFreeFormat ( bool  yesNo  )  [inline]

Sets whether free format. Mainly for blank RHS etc.

Definition at line 107 of file CoinMpsIO.hpp.

COINMpsType CoinMpsCardReader::mpsType (  )  const [inline]

Only for first field on card otherwise BLANK_COLUMN e.g.

COIN_E_ROW

Definition at line 111 of file CoinMpsIO.hpp.

int CoinMpsCardReader::cleanCard (  ) 

Reads and cleans card - taking out trailing blanks - return 1 if EOF.

const char* CoinMpsCardReader::rowName (  )  const [inline]

Returns row name of current field.

Definition at line 117 of file CoinMpsIO.hpp.

const char* CoinMpsCardReader::columnName (  )  const [inline]

Returns column name of current field.

Definition at line 121 of file CoinMpsIO.hpp.

double CoinMpsCardReader::value (  )  const [inline]

Returns value in current field.

Definition at line 125 of file CoinMpsIO.hpp.

const char* CoinMpsCardReader::valueString (  )  const [inline]

Returns value as string in current field.

Definition at line 129 of file CoinMpsIO.hpp.

const char* CoinMpsCardReader::card (  )  const [inline]

Whole card (for printing).

Definition at line 133 of file CoinMpsIO.hpp.

char* CoinMpsCardReader::mutableCard (  )  [inline]

Whole card - so we look at it (not const so nextBlankOr will work for gms reader).

Definition at line 137 of file CoinMpsIO.hpp.

void CoinMpsCardReader::setPosition ( char *  position  )  [inline]

set position (again so gms reader will work)

Definition at line 141 of file CoinMpsIO.hpp.

char* CoinMpsCardReader::getPosition (  )  const [inline]

get position (again so gms reader will work)

Definition at line 144 of file CoinMpsIO.hpp.

CoinBigIndex CoinMpsCardReader::cardNumber (  )  const [inline]

Returns card number.

Definition at line 147 of file CoinMpsIO.hpp.

CoinFileInput* CoinMpsCardReader::fileInput (  )  const [inline]

Returns file input.

Definition at line 151 of file CoinMpsIO.hpp.

void CoinMpsCardReader::setStringsAllowed (  )  [inline]

Sets whether strings allowed.

Definition at line 155 of file CoinMpsIO.hpp.

double CoinMpsCardReader::osi_strtod ( char *  ptr,
char **  output,
int  type 
)

type - 0 normal, 1 INTEL IEEE, 2 other IEEE

static void CoinMpsCardReader::strcpyAndCompress ( char *  to,
const char *  from 
) [static]

remove blanks

static char* CoinMpsCardReader::nextBlankOr ( char *  image  )  [static]

type - 0 normal, 1 INTEL IEEE, 2 other IEEE

double CoinMpsCardReader::osi_strtod ( char *  ptr,
char **  output 
)

For strings.


Member Data Documentation

double CoinMpsCardReader::value_ [protected]

Current value.

Definition at line 165 of file CoinMpsIO.hpp.

char CoinMpsCardReader::card_[MAX_CARD_LENGTH] [protected]

Current card image.

Definition at line 167 of file CoinMpsIO.hpp.

char* CoinMpsCardReader::position_ [protected]

Current position within card image.

Definition at line 169 of file CoinMpsIO.hpp.

char* CoinMpsCardReader::eol_ [protected]

End of card.

Definition at line 171 of file CoinMpsIO.hpp.

Current COINMpsType.

Definition at line 173 of file CoinMpsIO.hpp.

char CoinMpsCardReader::rowName_[COIN_MAX_FIELD_LENGTH] [protected]

Current row name.

Definition at line 175 of file CoinMpsIO.hpp.

char CoinMpsCardReader::columnName_[COIN_MAX_FIELD_LENGTH] [protected]

Current column name.

Definition at line 177 of file CoinMpsIO.hpp.

File input.

Definition at line 179 of file CoinMpsIO.hpp.

Which section we think we are in.

Definition at line 181 of file CoinMpsIO.hpp.

Card number.

Definition at line 183 of file CoinMpsIO.hpp.

Whether free format. Just for blank RHS etc.

Definition at line 185 of file CoinMpsIO.hpp.

Whether IEEE - 0 no, 1 INTEL, 2 not INTEL.

Definition at line 187 of file CoinMpsIO.hpp.

If all names <= 8 characters then allow embedded blanks.

Definition at line 189 of file CoinMpsIO.hpp.

MpsIO.

Definition at line 191 of file CoinMpsIO.hpp.

Message handler.

Definition at line 193 of file CoinMpsIO.hpp.

Messages.

Definition at line 195 of file CoinMpsIO.hpp.

char CoinMpsCardReader::valueString_[COIN_MAX_FIELD_LENGTH] [protected]

Current element as characters (only if strings allowed).

Definition at line 197 of file CoinMpsIO.hpp.

Whether strings allowed.

Definition at line 199 of file CoinMpsIO.hpp.


The documentation for this class was generated from the following file:
Generated on Fri Jul 2 21:11:40 2010 by  doxygen 1.6.3