Scippy

SoPlex

Sequential object-oriented simPlex

spxlpbase_real.cpp File Reference

Saving LPs with Real values in a form suitable for SoPlex. More...

#include <assert.h>
#include <stdio.h>
#include <ctype.h>
#include <iostream>
#include "soplex/spxdefines.h"
#include "soplex/spxlpbase.h"
#include "soplex/spxout.h"
#include "soplex/mpsinput.h"
#include "soplex/exceptions.h"
#include "soplex/spxscaler.h"

Go to the source code of this file.

Namespaces

 soplex
 Everything should be within this namespace.
 

Macros

#define LPF_MAX_LINE_LEN   8192
 maximum length of a line (8190 + \n + \0) More...
 
#define INIT_COLS   10000
 Read LP in MPS File Format. More...
 
#define INIT_NZOS   100000
 initialy allocated non zeros. More...
 
#define NUM_ENTRIES_PER_LINE   5
 

Functions

static bool LPFisSpace (int c)
 Is c a space, tab, nl or cr ? More...
 
static bool LPFisValue (const char *s)
 Is there a number at the beginning of s ? More...
 
static bool LPFisColName (const char *s)
 Is there a possible column name at the beginning of s ? More...
 
static bool LPFisSense (const char *s)
 Is there a comparison operator at the beginning of s ? More...
 
static bool LPFisInfinity (const char *s)
 
static bool LPFisFree (const char *s)
 
static Real LPFreadValue (char *&pos, SPxOut *spxout)
 Read the next number and advance pos. More...
 
static int LPFreadColName (char *&pos, NameSet *colnames, LPColSetBase< Real > &colset, const LPColBase< Real > *emptycol, SPxOut *spxout)
 Read the next column name from the input. More...
 
static int LPFreadSense (char *&pos)
 Read the next <,>,=,==,<=,=<,>=,=> and advance pos. More...
 
static bool LPFhasKeyword (char *&pos, const char *keyword)
 Is the keyword present in buf ? If yes, advance pos. More...
 
static bool LPFhasRowName (char *&pos, NameSet *rownames)
 If buf start with "name:" store the name in rownames and advance pos. More...
 
static Real LPFreadInfinity (char *&pos)
 
static void MPSreadName (MPSInput &mps, SPxOut *spxout)
 Process NAME section. More...
 
static void MPSreadObjsen (MPSInput &mps)
 Process OBJSEN section. This Section is an ILOG extension. More...
 
static void MPSreadObjname (MPSInput &mps)
 Process OBJNAME section. This Section is an ILOG extension. More...
 
static void MPSreadRows (MPSInput &mps, LPRowSetBase< Real > &rset, NameSet &rnames, SPxOut *spxout)
 Process ROWS section. More...
 
static void MPSreadCols (MPSInput &mps, const LPRowSetBase< Real > &rset, const NameSet &rnames, LPColSetBase< Real > &cset, NameSet &cnames, DIdxSet *intvars)
 Process COLUMNS section. More...
 
static void MPSreadRhs (MPSInput &mps, LPRowSetBase< Real > &rset, const NameSet &rnames, SPxOut *spxout)
 Process RHS section. More...
 
static void MPSreadRanges (MPSInput &mps, LPRowSetBase< Real > &rset, const NameSet &rnames, SPxOut *spxout)
 Process RANGES section. More...
 
static void MPSreadBounds (MPSInput &mps, LPColSetBase< Real > &cset, const NameSet &cnames, DIdxSet *intvars, SPxOut *spxout)
 Process BOUNDS section. More...
 
static const char * LPFgetRowName (const SPxLPBase< Real > &p_lp, int p_idx, const NameSet *p_rnames, char *p_buf, int p_num_written_rows)
 
static const char * getColName (const SPxLPBase< Real > &p_lp, int p_idx, const NameSet *p_cnames, char *p_buf)
 
static void LPFwriteSVector (const SPxLPBase< Real > &p_lp, std::ostream &p_output, const NameSet *p_cnames, const SVectorBase< Real > &p_svec)
 
static void LPFwriteObjective (const SPxLPBase< Real > &p_lp, std::ostream &p_output, const NameSet *p_cnames)
 
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)
 
static void LPFwriteRows (const SPxLPBase< Real > &p_lp, std::ostream &p_output, const NameSet *p_rnames, const NameSet *p_cnames)
 
static void LPFwriteBounds (const SPxLPBase< Real > &p_lp, std::ostream &p_output, const NameSet *p_cnames)
 
static void LPFwriteGenerals (const SPxLPBase< Real > &p_lp, std::ostream &p_output, const NameSet *p_cnames, const DIdxSet *p_intvars)
 
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)
 
static Real MPSgetRHS (Real left, Real right)
 
static const char * MPSgetRowName (const SPxLPBase< Real > &lp, int idx, const NameSet *rnames, char *buf)
 

Detailed Description

Saving LPs with Real values in a form suitable for SoPlex.

Definition in file spxlpbase_real.cpp.

Macro Definition Documentation

◆ INIT_COLS

#define INIT_COLS   10000

Read LP in MPS File Format.

The specification is taken from the IBM Optimization Library Guide and Reference, online available at http://www.software.ibm.com/sos/features/libuser.htm and from the ILOG CPLEX 7.0 Reference Manual, Appendix E, Page 531.

This routine should read all valid MPS format files. What it will not do, is find all cases where a file is ill formed. If this happens it may complain and read nothing or read "something".

Returns
true if the file was read correctly.initialy allocated columns.

Definition at line 2115 of file spxlpbase_real.cpp.

Referenced by SPxLPBase< Real >::readMPS().

◆ INIT_NZOS

#define INIT_NZOS   100000

initialy allocated non zeros.

Definition at line 2116 of file spxlpbase_real.cpp.

Referenced by SPxLPBase< Real >::readMPS().

◆ LPF_MAX_LINE_LEN

#define LPF_MAX_LINE_LEN   8192

maximum length of a line (8190 + \n + \0)

Definition at line 580 of file spxlpbase_real.cpp.

Referenced by soplex::LPFhasRowName(), soplex::LPFreadColName(), soplex::LPFreadValue(), and SPxLPBase< Real >::readLPF().

◆ NUM_ENTRIES_PER_LINE

#define NUM_ENTRIES_PER_LINE   5

Definition at line 2295 of file spxlpbase_real.cpp.

Referenced by soplex::LPFwriteSVector().