ldbl_lpdefs.h

Go to the documentation of this file.
00001 #include "qs_config.h"
00002 #ifdef HAVE_LONG_DOUBLE
00003 #if HAVE_LONG_DOUBLE
00004 /****************************************************************************/
00005 /*                                                                          */
00006 /*  This file is part of QSopt_ex.                                          */
00007 /*                                                                          */
00008 /*  (c) Copyright 2006 by David Applegate, William Cook, Sanjeeb Dash,      */
00009 /*  and Daniel Espinoza                                                     */
00010 /*                                                                          */
00011 /*  Sanjeeb Dash ownership of copyright in QSopt_ex is derived from his     */
00012 /*  copyright in QSopt.                                                     */
00013 /*                                                                          */
00014 /*  This code may be used under the terms of the GNU General Public License */
00015 /*  (Version 2.1 or later) as published by the Free Software Foundation.    */
00016 /*                                                                          */
00017 /*  Alternatively, use is granted for research purposes only.               */
00018 /*                                                                          */
00019 /*  It is your choice of which of these two licenses you are operating      */
00020 /*  under.                                                                  */
00021 /*                                                                          */
00022 /*  We make no guarantees about the correctness or usefulness of this code. */
00023 /*                                                                          */
00024 /****************************************************************************/
00025 
00026 /* RCSINFO $Id: ldbl_lpdefs.h,v 1.3 2003/11/05 16:57:39 meven Exp $ */
00027 #ifndef ldbl___QS_LPDEFS_H
00028 #define ldbl___QS_LPDEFS_H
00029 
00030 #include "ldbl_qsopt.h"
00031 #include "ldbl_lpdata.h"
00032 #include "ldbl_factor.h"
00033 
00034 /* infinity and negative infinity */
00035 #define ldbl_INFTY  ldbl_ILL_MAXDOUBLE
00036 #define ldbl_NINFTY ldbl_ILL_MINDOUBLE
00037 
00038 #include "basicdefs.h"
00039 /* tolerances, these are initialized in ldbl_ILLstart, file ldbl_lpdata.c */
00040 //#if EGLPNUM_TYPE != DBL_TYPE && EGLPNUM_TYPE != LDBL_TYPE
00041 /* these three constants are defined in ldbl_lpdata.c */
00042 extern long double ldbl_PARAM_IBASIS_RPIVOT;  /*       0.98 */
00043 extern long double ldbl_PARAM_IBASIS_RTRIANG;/*       0.01 */
00044 extern long double ldbl_PARAM_MIN_DNORM;      /*      1e-24 */
00045 extern long double ldbl_PFEAS_TOLER;          /*       1e-6 */
00046 extern long double ldbl_BD_TOLER;           /*       1e-7 */
00047 extern long double ldbl_DFEAS_TOLER;          /*       1e-6 */
00048 extern long double ldbl_PIVOT_TOLER;          /*      1e-10 */
00049 extern long double ldbl_SZERO_TOLER;          /*      1e-15 */
00050 extern long double ldbl_PIVZ_TOLER;         /*      1e-12 */
00051 extern long double ldbl_OBJBND_TOLER;       /*       1e-2 */
00052 extern long double ldbl_DBNDPIV_TOLER;        /*       1e-3 */
00053 extern long double ldbl_DBNDPIV_RATIO;        /*       1e-2 */
00054 extern long double ldbl_ALTPIV_TOLER;       /*       1e-8 */
00055 //extern long double DJZERO_TOLER;/*             1e-8 */
00056 extern long double ldbl_PROGRESS_ZERO;        /*       1e-7 */
00057 extern long double ldbl_PROGRESS_THRESH;      /*       1e-5 */
00058 extern long double ldbl_CB_EPS;             /*      0.001 */
00059 extern long double ldbl_CB_INF_RATIO;       /*       10.0 */
00060 extern long double ldbl_CB_PRI_RLIMIT;        /*       0.25 */
00061 
00062 /* structure for statistics */
00063 typedef struct
00064 {
00065   int ynz_cnt;                  /* nz in entering columns */
00066   int num_y;
00067   long double y_ravg;             /* weighted avg. of current & prior y */
00068   int znz_cnt;                  /* nz in ith row of B^{-1}, ie z_i */
00069   int num_z;
00070   long double z_ravg;             /* weighted avg. of current & prior z */
00071   int zanz_cnt;                 /* nz in z^TA */
00072   int num_za;
00073   long double za_ravg;            /* weighted avg. of current & prior za */
00074   int pnorm_cnt;                /* nz in columns for primal norms */
00075   int dnorm_cnt;                /* nz in rows for dual norms */
00076   int pinz_cnt;                 /* nz in phase II pi (solve) */
00077   int num_pi;                   /* # of pi solves */
00078   int pi1nz_cnt;                /* nz in phase I pi (solve) */
00079   int num_pi1;                  /* # of phase I pi solves */
00080   int upnz_cnt;                 /* nz in ftran update vector */
00081   int num_up;                   /* # of ftran_updates */
00082   int pupv_cnt;                 /* nz in primal steep updates */
00083   int dupv_cnt;                 /* nz in dual steep updates */
00084 
00085   int start_slacks;             /* # slacks in beginning */
00086   int final_slacks;             /* # slacks in the end */
00087   int start_art;                /* # arts in beginning */
00088   int final_art;                /* # arts in the end */
00089 
00090   int pI_iter;                  /* primal phase I iterations */
00091   int pII_iter;
00092   int dI_iter;                  /* dual phase I iterations */
00093   int dII_iter;
00094   int tot_iter;
00095 
00096   int pivpI[10];                /* sizes of pivots */
00097   int pivpII[10];
00098   int pivdI[10];
00099   int pivdII[10];
00100 }
00101 ldbl_count_struct;
00102 
00103 /* structure for tolerances */
00104 typedef struct
00105 {
00106   long double pfeas_tol;
00107   long double dfeas_tol;
00108   long double pivot_tol;
00109   long double szero_tol;
00110   long double ip_tol;             /* inner primal & dual feas toler */
00111   long double id_tol;
00112 }
00113 ldbl_tol_struct;
00114 
00115 /* bound information */
00116 typedef struct ldbl_bndinfo
00117 {
00118   long double pbound;
00119   long double cbound;
00120   int btype;
00121   int varnum;
00122   struct ldbl_bndinfo *next;
00123 }
00124 ldbl_bndinfo;
00125 
00126 /* bound information */
00127 typedef struct ldbl_coefinfo
00128 {
00129   long double pcoef;
00130   long double ccoef;
00131   int varnum;
00132   struct ldbl_coefinfo *next;
00133 }
00134 ldbl_coefinfo;
00135 
00136 /* feasibility info */
00137 typedef struct ldbl_feas_info
00138 {
00139   int pstatus;
00140   int dstatus;
00141   long double totinfeas;
00142 }
00143 ldbl_feas_info;
00144 
00145 typedef struct ldbl_lp_status_info
00146 {
00147   char optimal;
00148   char primal_feasible;
00149   char primal_infeasible;
00150   char primal_unbounded;
00151   char dual_feasible;
00152   char dual_infeasible;
00153   char dual_unbounded;
00154   char padd;
00155 }
00156 ldbl_lp_status_info;
00157 
00158 typedef struct ldbl_pI_uinfo
00159 {
00160   int tctr;
00161   int i;
00162   int *perm;
00163   int *ix;
00164   int fs;
00165   long double piv;
00166   long double *t;
00167   long double dty;
00168   long double c_obj;
00169   long double tz;
00170 }
00171 ldbl_pI_uinfo;
00172 
00173 extern void ldbl_ILLlp_status_info_init (
00174   ldbl_lp_status_info * ls);
00175 
00176 /* structure for local lp information
00177  * contains lp obj values - status - dimensions - input data -
00178  * solution vecs - basis info - update vecs - work vecs - bound changes -
00179  * tolerances - time info - statistics 
00180  */
00181 typedef struct ldbl_lpinfo
00182 {
00183 
00184   long double objval;             /* obj info */
00185   long double pobjval;            /* intermediate status info */
00186   long double dobjval;
00187   long double pinfeas;
00188   long double dinfeas;
00189   long double objbound;
00190   ldbl_lp_status_info probstat;     /* final status */
00191   ldbl_lp_status_info basisstat;      /* final status */
00192   int nrows;                    /* input info follows; given in col format */
00193   int ncols;
00194   int *matcnt;
00195   int *matbeg;
00196   int *matind;
00197   long double *matval;
00198   int matfree;
00199   int matsize;
00200   long double *bz;
00201   long double *lz;
00202   long double *uz;
00203   long double *cz;
00204   int localrows;                /* set to 1 if these are created locally */
00205   int *rowcnt;                  /* row info follows, copy of col info */
00206   int *rowbeg;
00207   int *rowind;
00208   long double *rowval;
00209 
00210   long double *xbz;               /* output info x, pi, reduced cost */
00211   long double *piz;
00212   long double *dz;
00213   long double *pIxbz;             /* output info (phase I) x, pi, reduced cost */
00214   long double *pIpiz;
00215   long double *pIdz;
00216 
00217   int final_phase;              /* final phase, inf & unboundedness info */
00218   int infub_ix;
00219 
00220   int basisid;                  /* basis and variable info follows */
00221   int nnbasic;
00222   int *baz;
00223   int *nbaz;
00224   int *vstat;
00225   int *vindex;
00226   int fbasisid;
00227   ldbl_factor_work *f;
00228   int *vtype;                   /* internal var info */
00229   char *vclass;                 /* structural or logical */
00230 
00231   ldbl_svector zz;                    /* local ldbl_ILLfactor_update vectors z, yj, za */
00232   ldbl_svector yjz;
00233   ldbl_svector zA;
00234   ldbl_svector work;                  /* local work vector */
00235   ldbl_svector srhs;                  /* local vectors for lin. eq. solves */
00236   ldbl_svector ssoln;
00237   int *iwork;                   /* local work vector */
00238   ldbl_pI_uinfo upd;                  /* phase I update info */
00239   int *bfeas;                   /* primal and dual infeasibility info */
00240   int *dfeas;
00241 
00242   ldbl_tol_struct *tol;             /* tolerances */
00243   ldbl_count_struct *cnts;            /* counts */
00244   int nbchange;                 /* # bound shifts */
00245   int ncchange;                 /* # obj coef shifts */
00246   ldbl_bndinfo *bchanges;           /* list of bound shifts */
00247   ldbl_coefinfo *cchanges;            /* list of coef shifts */
00248   int pIratio;                  /* ratio tests */
00249   int pIIratio;
00250   int dIratio;
00251   int dIIratio;
00252 
00253   int maxiter;
00254   int iterskip;
00255   double maxtime;
00256   double starttime;
00257   struct ldbl_ILLlpdata *O;
00258   ILLrandstate rstate;
00259 
00260 }
00261 ldbl_lpinfo;
00262 
00263 /* pricing structures */
00264 typedef struct
00265 {
00266   int ninit;
00267   long double *norms;
00268   int *refframe;
00269 }
00270 ldbl_p_devex_info;
00271 
00272 typedef struct
00273 {
00274   long double *norms;
00275 }
00276 ldbl_p_steep_info;
00277 
00278 typedef struct
00279 {
00280   int k;
00281   int cgroup;
00282   int ngroups;
00283   int *gstart;
00284   int *gshift;
00285   int *gsize;
00286   int bsize;
00287   int *bucket;
00288   int *perm;
00289   long double *infeas;
00290 }
00291 ldbl_mpart_info;
00292 
00293 typedef struct
00294 {
00295   int ninit;
00296   long double *norms;
00297   int *refframe;
00298 }
00299 ldbl_d_devex_info;
00300 
00301 typedef struct
00302 {
00303   long double *norms;
00304 }
00305 ldbl_d_steep_info;
00306 
00307 /* pricing information */
00308 typedef struct ldbl_price_info
00309 {
00310   int p_strategy;
00311   int d_strategy;
00312   int pI_price;
00313   int pII_price;
00314   int dI_price;
00315   int dII_price;
00316   int cur_price;
00317   long double *p_scaleinf;
00318   long double *d_scaleinf;
00319   ldbl_p_devex_info pdinfo;
00320   ldbl_p_steep_info psinfo;
00321   ldbl_mpart_info pmpinfo;
00322   ldbl_d_devex_info ddinfo;
00323   ldbl_d_steep_info dsinfo;
00324   ldbl_mpart_info dmpinfo;
00325   ldbl_heap h;
00326   long double htrigger;
00327   int hineff;
00328   char init;
00329 }
00330 ldbl_price_info;
00331 
00332 #endif /* ldbl___QS_LPDEFS_H */
00333 #endif
00334 #endif

Generated on Thu Mar 29 09:32:31 2012 for QSopt_ex by  doxygen 1.4.7