mpq_lp.c File Reference

#include <stdio.h>
#include "qs_config.h"
#include "mpq_iqsutil.h"
#include "mpq_lp.h"
#include "mpq_rawlp.h"
#include "mpq_read_lp.h"
#include "mpq_write_lp.h"

Include dependency graph for mpq_lp.c:

Go to the source code of this file.

Functions

static int mpq_add_var (mpq_rawlpdata *lp, mpq_ILLread_lp_state *state, mpq_t coef, int row, int allowNew)
static int mpq_fix_names (mpq_qserror_collector *collector, char **names, int nnames, const char *extra, int prefix, char ***newnames)
int mpq_ILLis_lp_name_char (int c, int pos)
int mpq_ILLread_constraint_expr (mpq_ILLread_lp_state *state, mpq_rawlpdata *lp, int rowind, int allowNew)
int mpq_ILLread_constraint_name (mpq_ILLread_lp_state *state, char **rowname)
int mpq_ILLread_lp (mpq_qsline_reader *file, const char *mpq_fname, mpq_rawlpdata *lp)
int mpq_ILLread_one_constraint (mpq_ILLread_lp_state *state, const char *rowname, mpq_rawlpdata *lp, int allowNewCols)
int mpq_ILLwrite_lp (mpq_ILLlpdata *lp, mpq_qserror_collector *collector)
static int mpq_read_bounds (mpq_ILLread_lp_state *state, mpq_rawlpdata *lp)
static int mpq_read_colname (mpq_ILLread_lp_state *state, ILLsymboltab *coltab, int mustHave)
static int mpq_read_constraints (mpq_ILLread_lp_state *state, mpq_rawlpdata *lp, int allowNewCols)
static int mpq_read_integer (mpq_ILLread_lp_state *state, mpq_rawlpdata *lp)
static int mpq_read_minmax (mpq_ILLread_lp_state *state, mpq_rawlpdata *lp)
static int mpq_read_objective (mpq_ILLread_lp_state *state, mpq_rawlpdata *lp)
static int mpq_read_problem_name (mpq_ILLread_lp_state *state, mpq_rawlpdata *lp)
static int mpq_write_bounds (mpq_ILLlpdata *lp, char **colnames)
static void mpq_write_intvars (mpq_ILLlpdata *lp, char **colnames)
static void mpq_write_objective (mpq_ILLlpdata *lp, const char *objname, char **colnames)
static int mpq_write_row (mpq_ILLlpdata *lp, mpq_ILLlp_rows *lprows, int i, char **rownames, char **colnames, int *colInRow, mpq_t *colCoef)
static void mpq_write_the_expr (mpq_ILLlpdata *lp, mpq_ILLwrite_lp_state *line, char *rowname, mpq_ILLlp_rows *lprows, int row, char **colnames, int *colInRow, mpq_t *colCoef, int ncols)

Variables

static const int mpq_LINE_LEN = 256
static int TRACE = 0


Function Documentation

static int mpq_add_var ( mpq_rawlpdata lp,
mpq_ILLread_lp_state state,
mpq_t  coef,
int  row,
int  allowNew 
) [static]

Definition at line 1241 of file mpq_lp.c.

References mpq_rawlpdata::coltab, mpq_ILLread_lp_state::field, ILL_IFTRACE, ILLsymboltab_lookup(), mpq_ILLlp_error(), mpq_ILLraw_add_col(), mpq_ILLraw_add_col_coef(), mpq_ILLraw_rowname(), and mpq_rawlpdata::ncols.

Referenced by mpq_ILLread_constraint_expr().

Here is the call graph for this function:

static int mpq_fix_names ( mpq_qserror_collector collector,
char **  names,
int  nnames,
const char *  extra,
int  prefix,
char ***  newnames 
) [static]

Definition at line 584 of file mpq_lp.c.

References ILL_FAILfalse, ILL_namebufsize, ILL_SAFE_MALLOC, ILLsymboltab_create(), ILLsymboltab_free(), ILLsymboltab_init(), ILLsymboltab_register(), ILLsymboltab_rename(), ILLsymboltab_uname(), mpq_ILLdata_warn(), mpq_ILLis_lp_name_char(), and NULL.

Referenced by mpq_ILLwrite_lp().

Here is the call graph for this function:

int mpq_ILLis_lp_name_char ( int  c,
int  pos 
)

Definition at line 74 of file mpq_lp.c.

References NULL.

Referenced by mpq_fix_names(), and mpq_ILLread_lp_state_next_var().

int mpq_ILLread_constraint_expr ( mpq_ILLread_lp_state state,
mpq_rawlpdata lp,
int  rowind,
int  allowNew 
)

Definition at line 851 of file mpq_lp.c.

References mpq_add_var(), mpq_ILLlp_error(), mpq_ILLlp_warn(), mpq_ILLraw_rowname(), mpq_ILLread_lp_state_next_var(), mpq_ILLread_lp_state_possible_coef(), mpq_ILLread_lp_state_sign(), and NULL.

Referenced by mpq_ILLread_one_constraint(), and mpq_read_objective().

Here is the call graph for this function:

int mpq_ILLread_constraint_name ( mpq_ILLread_lp_state state,
char **  rowname 
)

Definition at line 971 of file mpq_lp.c.

References mpq_ILLlp_error(), mpq_ILLread_lp_state_colon(), mpq_ILLread_lp_state_has_colon(), mpq_ILLread_lp_state_next_var(), and NULL.

Referenced by mpq_get_row_col_name(), and mpq_read_constraints().

Here is the call graph for this function:

int mpq_ILLread_lp ( mpq_qsline_reader file,
const char *  mpq_fname,
mpq_rawlpdata lp 
)

Definition at line 685 of file mpq_lp.c.

References mpq_ILLread_lp_state::bound_val, mpq_rawlpdata::coltab, mpq_qsline_reader::error_collector, ILLsymboltab_create(), mpq_ILLinit_rawlpdata(), mpq_ILLlp_error(), mpq_ILLraw_fill_in_bounds(), mpq_ILLraw_fill_in_rownames(), mpq_ILLread_lp_state_init(), mpq_ILLread_lp_state_keyword(), mpq_ILLread_lp_state_next_field(), mpq_read_bounds(), mpq_read_constraints(), mpq_read_integer(), mpq_read_minmax(), mpq_read_objective(), mpq_read_problem_name(), mpq_rawlpdata::ncols, mpq_rawlpdata::nrows, NULL, and mpq_rawlpdata::rowtab.

Referenced by mpq_ILLread().

Here is the call graph for this function:

int mpq_ILLread_one_constraint ( mpq_ILLread_lp_state state,
const char *  rowname,
mpq_rawlpdata lp,
int  allowNewCols 
)

Definition at line 998 of file mpq_lp.c.

References ILL_IFTRACE, ILLsymboltab_lookup(), mpq_ILLlp_error(), mpq_ILLraw_add_row(), mpq_ILLraw_rowname(), mpq_ILLread_constraint_expr(), mpq_ILLread_lp_state_sense(), mpq_ILLread_lp_state_value(), mpq_rawlpdata::nrows, NULL, mpq_rawlpdata::rhs, mpq_rawlpdata::rowsense, mpq_rawlpdata::rowtab, and mpq_ILLread_lp_state::sense_val.

Referenced by mpq_add_col(), mpq_add_row(), and mpq_read_constraints().

Here is the call graph for this function:

int mpq_ILLwrite_lp ( mpq_ILLlpdata lp,
mpq_qserror_collector collector 
)

Definition at line 173 of file mpq_lp.c.

References mpq_ILLlpdata::colnames, mpq_ILLlpdata::coltab, ILL_FAILfalse, ILL_FAILtrue, ILL_SAFE_MALLOC, ILLsymboltab_contains(), mpq_ILLmatrix::matcols, mpq_fix_names(), mpq_ILLdata_error(), mpq_ILLlp_rows_init(), mpq_ILLprint_report(), mpq_write_objective(), mpq_write_row(), mpq_ILLlpdata::nrows, mpq_ILLlpdata::nstruct, NULL, mpq_ILLlpdata::objname, mpq_ILLlpdata::rownames, mpq_ILLlpdata::rowtab, mpq_ILLlpdata::sos, and ILLsymboltab::tablesize.

Referenced by mpq_ILLlib_optimize(), mpq_ILLwrite_lp_file(), and mpq_QSreport_prob().

Here is the call graph for this function:

static int mpq_read_bounds ( mpq_ILLread_lp_state state,
mpq_rawlpdata lp 
) [static]

Definition at line 1133 of file mpq_lp.c.

References mpq_rawlpdata::coltab, ILL_FAILtrue, ILL_IFTRACE, mpq_rawlpdata::lower, mpq_ILLlp_error(), mpq_ILLlp_warn(), mpq_ILLraw_colname(), mpq_ILLraw_init_bounds(), mpq_ILLraw_set_fixedBound(), mpq_ILLraw_set_lowerBound(), mpq_ILLraw_set_unbound(), mpq_ILLraw_set_upperBound(), mpq_ILLread_lp_state_next_field(), mpq_ILLread_lp_state_possible_bound_value(), mpq_ILLtest_lp_state_bound_sense(), mpq_ILLtest_lp_state_next_is(), mpq_read_colname(), and mpq_rawlpdata::upper.

Referenced by mpq_ILLread_lp().

Here is the call graph for this function:

static int mpq_read_colname ( mpq_ILLread_lp_state state,
ILLsymboltab coltab,
int  mustHave 
) [static]

Definition at line 1080 of file mpq_lp.c.

References mpq_ILLread_lp_state::column_index, mpq_ILLread_lp_state::field, ILL_SYM_NOINDEX, ILLsymboltab_lookup(), mpq_ILLlp_error(), mpq_ILLread_lp_state_next_var(), and mpq_ILLread_lp_state_prev_field().

Referenced by mpq_read_bounds(), and mpq_read_integer().

Here is the call graph for this function:

static int mpq_read_constraints ( mpq_ILLread_lp_state state,
mpq_rawlpdata lp,
int  allowNewCols 
) [static]

Definition at line 1043 of file mpq_lp.c.

References mpq_ILLcheck_subject_to(), mpq_ILLlp_error(), mpq_ILLread_constraint_name(), mpq_ILLread_lp_state_next_constraint(), mpq_ILLread_lp_state_next_field(), mpq_ILLread_one_constraint(), and NULL.

Referenced by mpq_ILLread_lp().

Here is the call graph for this function:

static int mpq_read_integer ( mpq_ILLread_lp_state state,
mpq_rawlpdata lp 
) [static]

Definition at line 1106 of file mpq_lp.c.

References mpq_rawlpdata::coltab, ILL_FAILfalse, ILL_FAILtrue, ILL_SYM_NOINDEX, mpq_rawlpdata::intmarker, mpq_ILLlp_error(), mpq_ILLread_lp_state_next_field(), and mpq_read_colname().

Referenced by mpq_ILLread_lp().

Here is the call graph for this function:

static int mpq_read_minmax ( mpq_ILLread_lp_state state,
mpq_rawlpdata lp 
) [static]

Definition at line 815 of file mpq_lp.c.

References mpq_ILLread_lp_state::field, mpq_ILLread_lp_state::fieldOnFirstCol, mpq_ILL_MAX, mpq_ILL_MIN, mpq_ILLlp_error(), mpq_ILLread_lp_state_prev_field(), mpq_ILLutil_strcasecmp(), and mpq_rawlpdata::objsense.

Referenced by mpq_ILLread_lp().

Here is the call graph for this function:

static int mpq_read_objective ( mpq_ILLread_lp_state state,
mpq_rawlpdata lp 
) [static]

Definition at line 919 of file mpq_lp.c.

References ILL_FAILfalse, ILL_namebufsize, mpq_ILLlp_error(), mpq_ILLlp_warn(), mpq_ILLraw_add_row(), mpq_ILLread_constraint_expr(), mpq_ILLread_lp_state_colon(), mpq_ILLread_lp_state_has_colon(), mpq_ILLread_lp_state_next_var(), mpq_ILLread_lp_state_skip_blanks(), mpq_rawlpdata::nrows, NULL, mpq_rawlpdata::objindex, mpq_rawlpdata::rowtab, and ILLsymboltab::tablesize.

Referenced by mpq_ILLread_lp().

Here is the call graph for this function:

static int mpq_read_problem_name ( mpq_ILLread_lp_state state,
mpq_rawlpdata lp 
) [static]

Definition at line 783 of file mpq_lp.c.

References mpq_ILLread_lp_state::field, mpq_ILLread_lp_state::fieldOnFirstCol, ILL_IFFREE, ILL_IFTRACE, mpq_ILLlp_error(), mpq_ILLread_lp_state_next_field(), mpq_ILLutil_strcasecmp(), and mpq_rawlpdata::name.

Referenced by mpq_ILLread_lp().

Here is the call graph for this function:

static int mpq_write_bounds ( mpq_ILLlpdata lp,
char **  colnames 
) [static]

Definition at line 474 of file mpq_lp.c.

References mpq_ILLwrite_lp_state::buf, ILL_FAILtrue, mpq_ILLlpdata::lower, mpq_ILL_MAXDOUBLE, mpq_ILL_MINDOUBLE, mpq_ILLprint_report(), mpq_ILLraw_default_lower(), mpq_ILLraw_default_upper(), mpq_ILLraw_first_nondefault_bound(), mpq_ILLwrite_lp_state_append(), mpq_ILLwrite_lp_state_append_number(), mpq_ILLwrite_lp_state_init(), mpq_ILLwrite_lp_state_save_start(), mpq_ILLwrite_lp_state_start(), mpq_ILLlpdata::nstruct, NULL, mpq_ILLlpdata::structmap, and mpq_ILLlpdata::upper.

Here is the call graph for this function:

static void mpq_write_intvars ( mpq_ILLlpdata lp,
char **  colnames 
) [static]

Definition at line 538 of file mpq_lp.c.

References mpq_ILLwrite_lp_state::buf, mpq_ILLlpdata::intmarker, mpq_ILLprint_report(), mpq_ILLwrite_lp_state_append(), mpq_ILLwrite_lp_state_init(), mpq_ILLwrite_lp_state_save_start(), mpq_LINE_LEN, mpq_ILLlpdata::nstruct, and mpq_ILLwrite_lp_state::total.

Here is the call graph for this function:

static void mpq_write_objective ( mpq_ILLlpdata lp,
const char *  objname,
char **  colnames 
) [static]

Definition at line 279 of file mpq_lp.c.

References mpq_ILL_MIN, mpq_ILLprint_report(), mpq_ILLwrite_lp_state_append(), mpq_ILLwrite_lp_state_append_coef(), mpq_ILLwrite_lp_state_init(), mpq_ILLwrite_lp_state_save_start(), mpq_ILLwrite_lp_state_start(), mpq_LINE_LEN, mpq_ILLlpdata::nstruct, NULL, mpq_ILLlpdata::obj, mpq_ILLlpdata::objsense, mpq_ILLlpdata::probname, and mpq_ILLlpdata::structmap.

Referenced by mpq_ILLwrite_lp().

Here is the call graph for this function:

static int mpq_write_row ( mpq_ILLlpdata lp,
mpq_ILLlp_rows lprows,
int  i,
char **  rownames,
char **  colnames,
int *  colInRow,
mpq_t *  colCoef 
) [static]

Definition at line 415 of file mpq_lp.c.

References mpq_ILLwrite_lp_state::buf, ILL_FAILtrue, mpq_ILLprint_report(), mpq_ILLwrite_lp_state_append(), mpq_ILLwrite_lp_state_append_number(), mpq_write_the_expr(), mpq_ILLlpdata::nstruct, NULL, mpq_ILLlpdata::rangeval, mpq_ILLlpdata::rhs, and mpq_ILLlpdata::sense.

Referenced by mpq_ILLwrite_lp().

Here is the call graph for this function:

static void mpq_write_the_expr ( mpq_ILLlpdata lp,
mpq_ILLwrite_lp_state line,
char *  rowname,
mpq_ILLlp_rows lprows,
int  row,
char **  colnames,
int *  colInRow,
mpq_t *  colCoef,
int  ncols 
) [static]

Definition at line 351 of file mpq_lp.c.

References mpq_ILLwrite_lp_state::buf, mpq_ILLprint_report(), mpq_ILLwrite_lp_state_append(), mpq_ILLwrite_lp_state_append_coef(), mpq_ILLwrite_lp_state_init(), mpq_ILLwrite_lp_state_save_start(), mpq_ILLwrite_lp_state_start(), mpq_LINE_LEN, NULL, mpq_ILLlp_rows::rowbeg, mpq_ILLlp_rows::rowcnt, mpq_ILLlp_rows::rowind, mpq_ILLlp_rows::rowval, and mpq_ILLwrite_lp_state::total.

Referenced by mpq_write_row().

Here is the call graph for this function:


Variable Documentation

const int mpq_LINE_LEN = 256 [static]

Definition at line 98 of file mpq_lp.c.

Referenced by mpq_write_intvars(), mpq_write_objective(), and mpq_write_the_expr().

int TRACE = 0 [static]

Definition at line 109 of file mpq_lp.c.


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