spxlpbase_real.cpp
Go to the documentation of this file.
33 // --------------------------------------------------------------------------------------------------------------------- 35 // --------------------------------------------------------------------------------------------------------------------- 98 /** If only a sign is encountered, the number is assumed to be \c sign * 1.0. This routine will not catch malformatted 157 MSG_WARNING( (*spxout), (*spxout) << "WLPFRD01 Warning: found empty exponent in LP file - check for forbidden variable names with initial 'e' or 'E'\n"; ) 189 static int LPFreadColName(char*& pos, NameSet* colnames, LPColSetBase<Real>& colset, const LPColBase<Real>* emptycol, SPxOut* spxout) 254 /** \p keyword should be lower case. It can contain optional sections which are enclosed in '[' ']' like "min[imize]". 286 // we have to be at the end of the keyword and the word found on the line also has to end here. Attention: The 287 // LPFisSense is a kludge to allow LPFhasKeyword also to process Inf[inity] keywords in the bounds section. 372 * This routine should read (most?) valid LP format files. What it will not do, is find all cases where a file is ill 375 * Problem: A line ending in '+' or '-' followed by a line starting with a number, will be regarded as an error. 377 * The reader will accept the keyword INT[egers] as a synonym for GEN[erals] which is an undocumented feature in CPLEX. 381 * The manual says the maximum allowed line length is 255 characters, but CPLEX does not complain if the lines are 622 /* Already having here a value could only result from being the first number in a constraint, or a sign 651 /* Already having here a value could only result from being the first number in a constraint, or a sign 746 // We have a row like c1: <= 5 with no variables. We can not handle 10 <= 5; issue a syntax error. 831 /* Do we have only a single column name in the input line? We could ignore this savely, but it is probably 841 MSG_WARNING( (*spxout), (*spxout) << "WLPFRD12 in Binary/General section line " << lineno << " ignored" << std::endl; ) 899 // --------------------------------------------------------------------------------------------------------------------- 901 // --------------------------------------------------------------------------------------------------------------------- 1005 static void MPSreadRows(MPSInput& mps, LPRowSetBase<Real>& rset, NameSet& rnames, SPxOut* spxout) 1013 MSG_INFO2( (*spxout), (*spxout) << "IMPSRD02 Objective name : " << mps.objName() << std::endl; ) 1069 static void MPSreadCols(MPSInput& mps, const LPRowSetBase<Real>& rset, const NameSet& rnames, LPColSetBase<Real>& cset, NameSet& cnames, DIdxSet* intvars) 1168 static void MPSreadRhs(MPSInput& mps, LPRowSetBase<Real>& rset, const NameSet& rnames, SPxOut* spxout) 1193 if( ((mps.field2() != 0) && (mps.field3() == 0)) || ((mps.field4() != 0) && (mps.field5() == 0)) ) 1252 static void MPSreadRanges(MPSInput& mps, LPRowSetBase<Real>& rset, const NameSet& rnames, SPxOut* spxout) 1274 if( ((mps.field2() != 0) && (mps.field3() == 0)) || ((mps.field4() != 0) && (mps.field5() == 0)) ) 1362 static void MPSreadBounds(MPSInput& mps, LPColSetBase<Real>& cset, const NameSet& cnames, DIdxSet* intvars, SPxOut* spxout) 1423 // if the variable has appeared in the MARKER section of the COLUMNS section then its default bounds were 1424 // set to 0,1; the first time it is declared integer we need to change to default bounds 0,infinity 1481 * The specification is taken from the IBM Optimization Library Guide and Reference, online available at 1482 * http://www.software.ibm.com/sos/features/libuser.htm and from the ILOG CPLEX 7.0 Reference Manual, Appendix E, Page 1485 * This routine should read all valid MPS format files. What it will not do, is find all cases where a file is ill 1577 changeSense(mps.objSense() == MPSInput::MINIMIZE ? SPxLPBase<Real>::MINIMIZE : SPxLPBase<Real>::MAXIMIZE); 1579 MSG_INFO2( (*spxout), (*spxout) << "IMPSRD06 Objective sense: " << ((mps.objSense() == MPSInput::MINIMIZE) ? "Minimize\n" : "Maximize\n") ); 1607 // --------------------------------------------------------------------------------------------------------------------- 1609 // --------------------------------------------------------------------------------------------------------------------- 1892 // --------------------------------------------------------------------------------------------------------------------- 1894 // --------------------------------------------------------------------------------------------------------------------- 2099 MPSwriteRecord(p_output, "", "RANGE", MPSgetRowName(*this, i, p_rnames, name1), rhs(i) - lhs(i)); 2154 MSG_WARNING( (*spxout), (*spxout) << "XMPSWR03 Warning: objective function inverted when writing maximization problem in MPS file format\n" ); 2160 // --------------------------------------------------------------------------------------------------------------------- 2162 // ---------------------------------------------------------------------------------------------------------------------
Definition: mpsinput.h:34 static int LPFreadColName(char *&pos, NameSet *colnames, LPColSetBase< Rational > &colset, const LPColBase< Rational > *emptycol, SPxOut *spxout) Read the next column name from the input. Definition: spxlpbase_rational.cpp:219 bool isNotZero(Real a, Real eps=Param::epsilon()) returns true iff |a| > eps Definition: spxdefines.h:413 Exception class for things that should NEVER happen.This class is derived from the SoPlex exception b... Definition: exceptions.h:109 static void MPSreadCols(MPSInput &mps, const LPRowSetBase< Real > &rset, const NameSet &rnames, LPColSetBase< Real > &cset, NameSet &cnames, DIdxSet *intvars) Process COLUMNS section. Definition: spxlpbase_real.cpp:1069 static bool LPFisValue(const char *s) Is there a number at the beginning of s ? Definition: spxlpbase_rational.cpp:51 static Rational LPFreadInfinity(char *&pos) Definition: spxlpbase_rational.cpp:386 const VectorBase< R > & maxObj() const Returns objective vector for maximization problem. Definition: spxlpbase.h:384 void entryIgnored(const char *what, const char *what_name, const char *entity, const char *entity_name) Definition: mpsinput.h:205 static void MPSreadRanges(MPSInput &mps, LPRowSetBase< Real > &rset, const NameSet &rnames, SPxOut *spxout) Process RANGES section. Definition: spxlpbase_real.cpp:1252 Read MPS format files. int num() const Returns the number of LPColBases currently in LPColSetBase. Definition: lpcolsetbase.h:80 static Real LPFreadValue(char *&pos, SPxOut *spxout) Read the next number and advance pos. Definition: spxlpbase_real.cpp:101 Exception classes for SoPlex. static void MPSreadObjsen(MPSInput &mps) Process OBJSEN section. This Section is an ILOG extension. Definition: spxlpbase_real.cpp:940 bool NE(Real a, Real b, Real eps=Param::epsilon()) returns true iff |a-b| > eps Definition: spxdefines.h:377 static Rational LPFreadValue(char *&pos, SPxOut *spxout, const int lineno=-1) Read the next number and advance pos. Definition: spxlpbase_rational.cpp:104 static void LPFwriteSVector(const SPxLPBase< Real > &p_lp, std::ostream &p_output, const NameSet *p_cnames, const SVectorBase< Real > &p_svec) Definition: spxlpbase_real.cpp:1668 VectorBase< R > & maxObj_w() Returns vector of objective values w.r.t. maximization. Definition: lpcolsetbase.h:98 static void LPFwriteGenerals(const SPxLPBase< Real > &p_lp, std::ostream &p_output, const NameSet *p_cnames, const DIdxSet *p_intvars) Definition: spxlpbase_real.cpp:1849 static void LPFwriteRow(const SPxLPBase< Real > &p_lp, std::ostream &p_output, const NameSet *p_cnames, const SVectorBase< Real > &p_svec, const Real &p_lhs, const Real &p_rhs) Definition: spxlpbase_real.cpp:1731 Saving LPs in a form suitable for SoPlex. Entry identifier class for items of a DataSet.Every item in a DataSet is assigned a DataKey by which ... Definition: datakey.h:46 static void LPFwriteObjective(const SPxLPBase< Real > &p_lp, std::ostream &p_output, const NameSet *p_cnames) Definition: spxlpbase_real.cpp:1708 static const char * getColName(const SPxLPBase< Real > &p_lp, int p_idx, const NameSet *p_cnames, char *p_buf) Definition: spxlpbase_real.cpp:1640 Wrapper for different output streams and verbosity levels. Exception class for out of memory exceptions.This class is derived from the SoPlex exception base cla... Definition: exceptions.h:70 static void MPSreadBounds(MPSInput &mps, LPColSetBase< Real > &cset, const NameSet &cnames, DIdxSet *intvars, SPxOut *spxout) Process BOUNDS section. Definition: spxlpbase_real.cpp:1362 static bool LPFhasRowName(char *&pos, NameSet *rownames) If buf start with "name:" store the name in rownames and advance pos. Definition: spxlpbase_rational.cpp:333 static void LPFwriteRows(const SPxLPBase< Real > &p_lp, std::ostream &p_output, const NameSet *p_rnames, const NameSet *p_cnames) Definition: spxlpbase_real.cpp:1759 #define MSG_INFO2(spxout, x) Prints out message x if the verbosity level is at least SPxOut::INFO2. Definition: spxdefines.h:115 static bool LPFisSense(const char *s) Is there a comparison operator at the beginning of s ? Definition: spxlpbase_rational.cpp:73 Wrapper for several output streams. A verbosity level is used to decide which stream to use and wheth... Definition: spxout.h:63 virtual bool readLPF(std::istream &in, NameSet *rowNames=0, NameSet *colNames=0, DIdxSet *intVars=0) Reads LP in LP format from input stream in. #define MSG_ERROR(x) Prints out message x if the verbosity level is at least SPxOut::ERROR. Definition: spxdefines.h:109 static int LPFreadColName(char *&pos, NameSet *colnames, LPColSetBase< Real > &colset, const LPColBase< Real > *emptycol, SPxOut *spxout) Read the next column name from the input. Definition: spxlpbase_real.cpp:189 static const char * LPFgetRowName(const SPxLPBase< Real > &p_lp, int p_idx, const NameSet *p_rnames, char *p_buf, int p_num_written_rows) Definition: spxlpbase_real.cpp:1612 Dynamic index set.Class DIdxSet provides dynamic IdxSet in the sense, that no restrictions are posed ... Definition: didxset.h:42 static void MPSreadRows(MPSInput &mps, LPRowSetBase< Real > &rset, NameSet &rnames, SPxOut *spxout) Process ROWS section. Definition: spxlpbase_real.cpp:1005 (In)equality for LPs.Class LPRowBase provides constraints for linear programs in the form where a is... Definition: lprowbase.h:45 Debugging, floating point type and parameter definitions. Set of strings.Class NameSet implements a symbol or name table. It allows to store or remove names (i... Definition: nameset.h:61 bool EQ(Real a, Real b, Real eps=Param::epsilon()) returns true iff |a-b| <= eps Definition: spxdefines.h:371 Everything should be within this namespace. static void LPFwriteBounds(const SPxLPBase< Real > &p_lp, std::ostream &p_output, const NameSet *p_cnames) Definition: spxlpbase_real.cpp:1798 static void MPSreadObjname(MPSInput &mps) Process OBJNAME section. This Section is an ILOG extension. Definition: spxlpbase_real.cpp:976 Saving LPs in a form suitable for SoPlex.Class SPxLPBase provides the data structures required for sa... Definition: spxlpbase.h:76 #define MSG_WARNING(spxout, x) Prints out message x if the verbosity level is at least SPxOut::WARNING. Definition: spxdefines.h:111 void setRowVector(const DSVectorBase< R > &p_vec) access constraint row vector. Definition: lprowbase.h:245 static void MPSreadRhs(MPSInput &mps, LPRowSetBase< Real > &rset, const NameSet &rnames, SPxOut *spxout) Process RHS section. Definition: spxlpbase_real.cpp:1168 int number(const DataKey &pkey) const returns number of name with DataKey pkey in NameSet. Definition: nameset.h:212 static int LPFreadSense(char *&pos) Read the next <,>,=,==,<=,=<,>=,=> and advance pos. Definition: spxlpbase_rational.cpp:262 static bool LPFisColName(const char *s) Is there a possible column name at the beginning of s ? Definition: spxlpbase_rational.cpp:59 static bool LPFhasKeyword(char *&pos, const char *keyword) Is the keyword present in buf ? If yes, advance pos. Definition: spxlpbase_rational.cpp:286 const VectorBase< R > & rhs() const Returns the vector of rhs values. Definition: lprowsetbase.h:129 void insertName(const char *name, bool second=false) Inserts name as field 1 and shifts all other fields up. Definition: mpsinput.cpp:250 static const char * MPSgetRowName(const SPxLPBase< Real > &lp, int idx, const NameSet *rnames, char *buf) Definition: spxlpbase_real.cpp:1944 const SVectorBase< R > & rowVector(int i) const Gets row vector of row i. Definition: spxlpbase.h:212 bool isZero(Real a, Real eps=Param::epsilon()) returns true iff |a| <= eps Definition: spxdefines.h:407 void setColVector(const SVectorBase< R > &p_vec) Sets constraint column vector. Definition: lpcolbase.h:154 #define MSG_INFO3(spxout, x) Prints out message x if the verbosity level is at least SPxOut::INFO3. Definition: spxdefines.h:117 VectorBase< R > & rhs_w() Returns the vector of rhs values (writeable). Definition: lprowsetbase.h:135 void reMax(int newmax=0) Reallocates memory to be able to store newmax LPColBases. Definition: lpcolsetbase.h:502 LP column.Class LPColBase provides a datatype for storing the column of an LP a the form similar to ... Definition: lpcolbase.h:45 static void MPSreadName(MPSInput &mps, SPxOut *spxout) Process NAME section. Definition: spxlpbase_real.cpp:904 static void MPSwriteRecord(std::ostream &os, const char *indicator, const char *name, const char *name1=0, const Real value1=0.0, const char *name2=0, const Real value2=0.0) Definition: spxlpbase_real.cpp:1896 |