mpq_read_lp.h

Go to the documentation of this file.
00001 #include "qs_config.h"
00002 #ifdef HAVE_LIBGMP
00003 #if HAVE_LIBGMP
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 /*  RCS_INFO = "$RCSfile: read_lp_state.h,v $ $Revision: 1.2 $ $Date: 2003/11/05 16:57:39 $"; */
00027 #ifndef mpq_READ_LP_STATE_H
00028 #define mpq_READ_LP_STATE_H
00029 
00030 /****************************************************************************/
00031 /*                                                                          */
00032 /*               Routines to support Reading LP Files                       */
00033 /*                                                                          */
00034 /****************************************************************************/
00035 
00036 /* 
00037  * -) anything after '\' is comment 
00038  * -) variables consist of a-z A-Z 0-9!"#$%(),;.?@_`'{}|~ 
00039  *    don't start with a digit or '.'
00040  */
00041 
00042 #include "mpq_iqsutil.h"
00043 #include "mpq_readline.h"
00044 
00045 typedef struct mpq_ILLread_lp_state
00046 {
00047   mpq_qsline_reader *file;
00048   const char *file_name;
00049   char *p;
00050   mpq_t bound_val;
00051   int mpq_interactive;
00052   int line_num;
00053   int column_index;
00054   char realline[ILL_namebufsize];
00055   char line[ILL_namebufsize];
00056   char field[ILL_namebufsize + 1];
00057   char fieldOnFirstCol;
00058   char eof;
00059   char sense_val;
00060 }
00061 mpq_ILLread_lp_state;
00062 
00063 extern int mpq_ILLread_lp_state_init (
00064   mpq_ILLread_lp_state * state,
00065   mpq_qsline_reader * file,
00066   const char *mpq_fname,
00067   int interactve);
00068 extern int mpq_ILLread_lp_state_next_line (
00069   mpq_ILLread_lp_state * state);
00070 extern int mpq_ILLread_lp_state_next_var (
00071   mpq_ILLread_lp_state * state);
00072 extern int mpq_ILLread_lp_state_keyword (
00073   mpq_ILLread_lp_state * state,
00074   const char **kwd);
00075 extern int mpq_ILLread_lp_state_bad_keyword (
00076   mpq_ILLread_lp_state * state);
00077 extern int mpq_ILLtest_lp_state_keyword (
00078   mpq_ILLread_lp_state * state,
00079   const char *kwd[]);
00080 extern int mpq_ILLread_lp_state_next_field (
00081   mpq_ILLread_lp_state * state);
00082 extern int mpq_ILLread_lp_state_next_field_on_line (
00083   mpq_ILLread_lp_state * state);
00084 extern void mpq_ILLread_lp_state_prev_field (
00085   mpq_ILLread_lp_state * state);
00086 extern int mpq_ILLread_lp_state_sign (
00087   mpq_ILLread_lp_state * state,
00088   mpq_t * sign);
00089 extern int mpq_ILLread_lp_state_possible_coef (
00090   mpq_ILLread_lp_state * state,
00091   mpq_t * coef,
00092   const mpq_t defValue);
00093 
00094                                         /* returns 1 iff found a number 
00095                                          * otherwise 0 */
00096 extern int mpq_ILLread_lp_state_possible_bound_value (
00097   mpq_ILLread_lp_state * state);
00098 
00099                                                /* returns 1 iff found a number 
00100                                                 * otherwise 0 */
00101 extern int mpq_ILLread_lp_state_colon (
00102   mpq_ILLread_lp_state * state);
00103 extern int mpq_ILLread_lp_state_has_colon (
00104   mpq_ILLread_lp_state * state);
00105 extern int mpq_ILLread_lp_statxe_has_colon (
00106   mpq_ILLread_lp_state * state);
00107 extern int mpq_ILLread_lp_state_next_constraint (
00108   mpq_ILLread_lp_state * state);
00109 extern int mpq_ILLread_lp_state_sense (
00110   mpq_ILLread_lp_state * state);
00111 extern int mpq_ILLtest_lp_state_sense (
00112   mpq_ILLread_lp_state * state,
00113   int all);
00114 extern void mpq_ILLtest_lp_state_bound_sense (
00115   mpq_ILLread_lp_state * state);
00116 extern int mpq_ILLread_lp_state_value (
00117   mpq_ILLread_lp_state * state,
00118   mpq_t * d);
00119 extern int mpq_ILLtest_lp_state_next_is (
00120   mpq_ILLread_lp_state * state,
00121   const char *str);
00122 extern int mpq_ILLread_lp_state_skip_blanks (
00123   mpq_ILLread_lp_state * state,
00124   int wrapLines);
00125 
00126 extern int mpq_ILLcheck_subject_to (
00127   mpq_ILLread_lp_state * state);
00128 
00129 /*---------------------------------------------------------------------------*/
00130 /* errors and warnings 
00131  */
00132 extern int mpq_ILLlp_error (
00133   mpq_ILLread_lp_state * state,
00134   const char *format,
00135   ...);
00136 extern void mpq_ILLlp_warn (
00137   mpq_ILLread_lp_state * state,
00138   const char *format,
00139   ...);
00140 
00141 /*---------------------------------------------------------------------------*/
00142 /* shared with read_mps_state.c 
00143  */
00144 extern int mpq_ILLget_value (
00145   char *line,
00146   mpq_t * coef);
00147 
00148 #endif
00149 #endif
00150 #endif

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