00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef ILL_LPDATA_H
00025 #define ILL_LPDATA_H
00026
00027 #include "config.h"
00028 #include "qstruct.h"
00029 #include "iqsutil.h"
00030 #include "readline.h"
00031 #include "reporter.h"
00032 #include "format.h"
00033 #include "dstruct.h"
00034
00035 extern EGlpNum_t ILL_MAXDOUBLE;
00036 extern EGlpNum_t ILL_MINDOUBLE;
00037
00038 #define ILL_MAXINT (2147483647)
00039 #define ILL_MIN (1)
00040 #define ILL_MAX (-1)
00041
00042
00043
00044 #define ILL_PRE_SCALE 1
00045 #define ILL_PRE_FIXED 2
00046 #define ILL_PRE_SINGLE_ROW 4
00047 #define ILL_PRE_FORCING 8
00048 #define ILL_PRE_SINGLE_COL 16
00049 #define ILL_PRE_DUPLICATE_ROW 32
00050 #define ILL_PRE_DUPLICATE_COL 64
00051 #define ILL_PRE_EMPTY_COL 128
00052 #define ILL_PRE_ALL (ILL_PRE_SCALE | ILL_PRE_FIXED | ILL_PRE_SINGLE_ROW \
00053 ILL_PRE_FORCING | ILL_PRE_SINGLE_COL | ILL_PRE_DUPLICATE_ROW \
00054 ILL_PRE_DUPLICATE_COL | ILL_PRE_EMPTY_COL)
00055 #define ILL_PRE_SIMPLE (ILL_PRE_FIXED | ILL_PRE_EMPTY_COL)
00056
00057 typedef struct ILLlpdata
00058 {
00059 int nrows;
00060 int ncols;
00061 int nstruct;
00062 int nzcount;
00063 int rowsize;
00064 int colsize;
00065 int structsize;
00066
00067 int objsense;
00068 char *sense;
00069 EGlpNum_t *obj;
00070 EGlpNum_t *rhs;
00071 EGlpNum_t *rangeval;
00072 EGlpNum_t *lower;
00073 EGlpNum_t *upper;
00074 ILLmatrix A;
00075 struct ILLlp_rows *rA;
00076
00077 char **rownames;
00078 ILLsymboltab rowtab;
00079 char *objname;
00080
00081
00082 char **colnames;
00083 ILLsymboltab coltab;
00084
00085 char *probname;
00086 char *intmarker;
00087 int *structmap;
00088 int *rowmap;
00089 struct ILLlp_basis *basis;
00090 struct ILLlp_predata *presolve;
00091 struct ILLlp_sinfo *sinfo;
00092
00093
00094
00095
00096 ILLmatrix sos;
00097
00098
00099
00100 char *sos_type;
00101 int *is_sos_mem;
00102
00103
00104
00105 char *refrowname;
00106 int refind;
00107
00108
00109
00110
00111
00112
00113
00114
00115 qsstring_reporter reporter;
00116
00117 }
00118 ILLlpdata;
00119
00120 typedef struct ILLlp_basis
00121 {
00122 int nstruct;
00123 int nrows;
00124 int rownorms_size;
00125 int colnorms_size;
00126 char *cstat;
00127 char *rstat;
00128 EGlpNum_t *rownorms;
00129 EGlpNum_t *colnorms;
00130 }
00131 ILLlp_basis;
00132
00133 typedef struct ILLlp_cache
00134 {
00135 int nstruct;
00136 int nrows;
00137 int status;
00138 EGlpNum_t val;
00139 EGlpNum_t *x;
00140 EGlpNum_t *pi;
00141 EGlpNum_t *rc;
00142 EGlpNum_t *slack;
00143 }
00144 ILLlp_cache;
00145
00146 typedef struct ILLlp_sinfo
00147 {
00148 int ncols;
00149 int nrows;
00150 int nzcount;
00151 int rowsize;
00152 int colsize;
00153 int objsense;
00154
00155 EGlpNum_t *obj;
00156 EGlpNum_t *rhs;
00157 EGlpNum_t *lower;
00158 EGlpNum_t *upper;
00159
00160 ILLmatrix A;
00161
00162 char **colnames;
00163 }
00164 ILLlp_sinfo;
00165
00166 typedef struct ILLlp_preline
00167 {
00168 EGlpNum_t rhs;
00169 EGlpNum_t obj;
00170 EGlpNum_t lower;
00171 EGlpNum_t upper;
00172 int count;
00173 int *ind;
00174 int row_or_col;
00175 EGlpNum_t *val;
00176 }
00177 ILLlp_preline;
00178
00179 typedef struct ILLlp_preop
00180 {
00181 int ptype;
00182 int rowindex;
00183 int colindex;
00184 ILLlp_preline line;
00185 }
00186 ILLlp_preop;
00187
00188 typedef struct ILLlp_predata
00189 {
00190 int opcount;
00191 int opsize;
00192 ILLlp_preop *oplist;
00193 int r_nrows;
00194 int r_ncols;
00195 int *colmap;
00196 int *rowmap;
00197 EGlpNum_t *rowscale;
00198 EGlpNum_t *colscale;
00199 EGlpNum_t *colfixval;
00200 EGlpNum_t *rowfixval;
00201 }
00202 ILLlp_predata;
00203
00204 typedef struct ILLlp_rows
00205 {
00206 int *rowbeg;
00207 int *rowcnt;
00208 int *rowind;
00209 EGlpNum_t *rowval;
00210 }
00211 ILLlp_rows;
00212
00213
00214
00215
00216
00217
00218
00219
00220 struct qsdata *ILLread (
00221 qsline_reader * file,
00222 const char *fname,
00223 int isMps);
00224 void ILLstart (
00225 void);
00226
00227
00228
00229 void ILLend (
00230 void);
00231
00232
00233 void ILLchange_precision (
00234 void);
00235
00236
00237
00238
00239 void ILLlpdata_init (
00240 ILLlpdata * lp);
00241 void ILLlpdata_free (
00242 ILLlpdata * lp);
00243 void ILLlp_basis_init (
00244 ILLlp_basis * B);
00245 void ILLlp_basis_free (
00246 ILLlp_basis * B);
00247 void ILLlp_cache_init (
00248 ILLlp_cache * C);
00249 void ILLlp_cache_free (
00250 ILLlp_cache * C);
00251 int ILLlp_basis_alloc (
00252 ILLlp_basis * B,
00253 int ncols,
00254 int nrows);
00255 int ILLlp_cache_alloc (
00256 ILLlp_cache * C,
00257 int ncols,
00258 int nrows);
00259
00260 int ILLlp_rows_init (
00261 ILLlp_rows * lp_rows,
00262 ILLlpdata * lp,
00263 int include_logicals);
00264 void ILLlp_rows_clear (
00265 ILLlp_rows * lp_rows);
00266 int ILLprint_report (
00267 ILLlpdata * lp,
00268 const char *format,
00269 ...);
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279 void ILLlp_sinfo_init (
00280 ILLlp_sinfo * sinfo),
00281 ILLlp_sinfo_free (
00282 ILLlp_sinfo * sinfo),
00283 ILLlp_predata_init (
00284 ILLlp_predata * pre),
00285 ILLlp_predata_free (
00286 ILLlp_predata * pre);
00287
00288 int ILLlp_add_logicals (
00289 ILLlpdata * lp),
00290 ILLlp_scale (
00291 ILLlpdata * lp),
00292 ILLlp_presolve (
00293 ILLlpdata * lp,
00294 int pre_types);
00295
00296
00297
00298
00299
00300 extern int __QSEX_SETUP;
00301
00302 #endif