lp.c File Reference

#include <stdio.h>
#include "qs_config.h"
#include "iqsutil.h"
#include "lp.h"
#include "rawlp.h"
#include "read_lp.h"
#include "write_lp.h"

Include dependency graph for lp.c:

Go to the source code of this file.

Functions

static int add_var (rawlpdata *lp, ILLread_lp_state *state, EGlpNum_t coef, int row, int allowNew)
static int fix_names (qserror_collector *collector, char **names, int nnames, const char *extra, int prefix, char ***newnames)
int ILLis_lp_name_char (int c, int pos)
int ILLread_constraint_expr (ILLread_lp_state *state, rawlpdata *lp, int rowind, int allowNew)
int ILLread_constraint_name (ILLread_lp_state *state, char **rowname)
int ILLread_lp (qsline_reader *file, const char *fname, rawlpdata *lp)
int ILLread_one_constraint (ILLread_lp_state *state, const char *rowname, rawlpdata *lp, int allowNewCols)
int ILLwrite_lp (ILLlpdata *lp, qserror_collector *collector)
static int read_bounds (ILLread_lp_state *state, rawlpdata *lp)
static int read_colname (ILLread_lp_state *state, ILLsymboltab *coltab, int mustHave)
static int read_constraints (ILLread_lp_state *state, rawlpdata *lp, int allowNewCols)
static int read_integer (ILLread_lp_state *state, rawlpdata *lp)
static int read_minmax (ILLread_lp_state *state, rawlpdata *lp)
static int read_objective (ILLread_lp_state *state, rawlpdata *lp)
static int read_problem_name (ILLread_lp_state *state, rawlpdata *lp)
static int write_bounds (ILLlpdata *lp, char **colnames)
static void write_intvars (ILLlpdata *lp, char **colnames)
static void write_objective (ILLlpdata *lp, const char *objname, char **colnames)
static int write_row (ILLlpdata *lp, ILLlp_rows *lprows, int i, char **rownames, char **colnames, int *colInRow, EGlpNum_t *colCoef)
static void write_the_expr (ILLlpdata *lp, ILLwrite_lp_state *line, char *rowname, ILLlp_rows *lprows, int row, char **colnames, int *colInRow, EGlpNum_t *colCoef, int ncols)

Variables

static const int LINE_LEN = 256
static int TRACE = 0


Function Documentation

static int add_var ( rawlpdata lp,
ILLread_lp_state state,
EGlpNum_t  coef,
int  row,
int  allowNew 
) [static]

Definition at line 1241 of file lp.c.

References rawlpdata::coltab, ILLread_lp_state::field, ILL_IFTRACE, ILLlp_error(), ILLraw_add_col(), ILLraw_add_col_coef(), ILLraw_rowname(), ILLsymboltab_lookup(), and rawlpdata::ncols.

Referenced by ILLread_constraint_expr().

Here is the call graph for this function:

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

Definition at line 584 of file lp.c.

References ILL_FAILfalse, ILL_namebufsize, ILL_SAFE_MALLOC, ILL_UTIL_STR, ILLdata_warn(), ILLis_lp_name_char(), ILLsymboltab_create(), ILLsymboltab_free(), ILLsymboltab_init(), ILLsymboltab_register(), ILLsymboltab_rename(), ILLsymboltab_uname(), and NULL.

Referenced by ILLwrite_lp().

Here is the call graph for this function:

int ILLis_lp_name_char ( int  c,
int  pos 
)

Definition at line 74 of file lp.c.

References NULL.

Referenced by fix_names(), and ILLread_lp_state_next_var().

int ILLread_constraint_expr ( ILLread_lp_state state,
rawlpdata lp,
int  rowind,
int  allowNew 
)

Definition at line 851 of file lp.c.

References add_var(), ILLlp_error(), ILLlp_warn(), ILLraw_rowname(), ILLread_lp_state_next_var(), ILLread_lp_state_possible_coef(), ILLread_lp_state_sign(), and NULL.

Referenced by ILLread_one_constraint(), and read_objective().

Here is the call graph for this function:

int ILLread_constraint_name ( ILLread_lp_state state,
char **  rowname 
)

Definition at line 971 of file lp.c.

References ILLlp_error(), ILLread_lp_state_colon(), ILLread_lp_state_has_colon(), ILLread_lp_state_next_var(), and NULL.

Referenced by get_row_col_name(), and read_constraints().

Here is the call graph for this function:

int ILLread_lp ( qsline_reader file,
const char *  fname,
rawlpdata lp 
)

Definition at line 685 of file lp.c.

References ILLread_lp_state::bound_val, rawlpdata::coltab, qsline_reader::error_collector, ILLinit_rawlpdata(), ILLlp_error(), ILLraw_fill_in_bounds(), ILLraw_fill_in_rownames(), ILLread_lp_state_init(), ILLread_lp_state_keyword(), ILLread_lp_state_next_field(), ILLsymboltab_create(), rawlpdata::ncols, rawlpdata::nrows, NULL, read_bounds(), read_constraints(), read_integer(), read_minmax(), read_objective(), read_problem_name(), and rawlpdata::rowtab.

Referenced by ILLread().

Here is the call graph for this function:

int ILLread_one_constraint ( ILLread_lp_state state,
const char *  rowname,
rawlpdata lp,
int  allowNewCols 
)

Definition at line 998 of file lp.c.

References ILL_IFTRACE, ILLlp_error(), ILLraw_add_row(), ILLraw_rowname(), ILLread_constraint_expr(), ILLread_lp_state_sense(), ILLread_lp_state_value(), ILLsymboltab_lookup(), rawlpdata::nrows, NULL, rawlpdata::rhs, rawlpdata::rowsense, rawlpdata::rowtab, and ILLread_lp_state::sense_val.

Referenced by add_col(), add_row(), and read_constraints().

Here is the call graph for this function:

int ILLwrite_lp ( ILLlpdata lp,
qserror_collector collector 
)

Definition at line 173 of file lp.c.

References ILLlpdata::colnames, ILLlpdata::coltab, fix_names(), ILL_FAILfalse, ILL_FAILtrue, ILL_SAFE_MALLOC, ILLdata_error(), ILLlp_rows_init(), ILLprint_report(), ILLsymboltab_contains(), ILLmatrix::matcols, ILLlpdata::nrows, ILLlpdata::nstruct, NULL, ILLlpdata::objname, ILLlpdata::rownames, ILLlpdata::rowtab, ILLlpdata::sos, ILLsymboltab::tablesize, write_objective(), and write_row().

Referenced by ILLlib_optimize(), ILLwrite_lp_file(), and QSreport_prob().

Here is the call graph for this function:

static int read_bounds ( ILLread_lp_state state,
rawlpdata lp 
) [static]

Definition at line 1133 of file lp.c.

References rawlpdata::coltab, ILL_FAILtrue, ILL_IFTRACE, ILLlp_error(), ILLlp_warn(), ILLraw_colname(), ILLraw_init_bounds(), ILLraw_set_fixedBound(), ILLraw_set_lowerBound(), ILLraw_set_unbound(), ILLraw_set_upperBound(), ILLread_lp_state_next_field(), ILLread_lp_state_possible_bound_value(), ILLtest_lp_state_bound_sense(), ILLtest_lp_state_next_is(), rawlpdata::lower, read_colname(), and rawlpdata::upper.

Referenced by ILLread_lp().

Here is the call graph for this function:

static int read_colname ( ILLread_lp_state state,
ILLsymboltab coltab,
int  mustHave 
) [static]

Definition at line 1080 of file lp.c.

References ILLread_lp_state::column_index, ILLread_lp_state::field, ILL_SYM_NOINDEX, ILLlp_error(), ILLread_lp_state_next_var(), ILLread_lp_state_prev_field(), and ILLsymboltab_lookup().

Referenced by read_bounds(), and read_integer().

Here is the call graph for this function:

static int read_constraints ( ILLread_lp_state state,
rawlpdata lp,
int  allowNewCols 
) [static]

Definition at line 1043 of file lp.c.

References ILLcheck_subject_to(), ILLlp_error(), ILLread_constraint_name(), ILLread_lp_state_next_constraint(), ILLread_lp_state_next_field(), ILLread_one_constraint(), and NULL.

Referenced by ILLread_lp().

Here is the call graph for this function:

static int read_integer ( ILLread_lp_state state,
rawlpdata lp 
) [static]

Definition at line 1106 of file lp.c.

References rawlpdata::coltab, ILL_FAILfalse, ILL_FAILtrue, ILL_SYM_NOINDEX, ILLlp_error(), ILLread_lp_state_next_field(), rawlpdata::intmarker, and read_colname().

Referenced by ILLread_lp().

Here is the call graph for this function:

static int read_minmax ( ILLread_lp_state state,
rawlpdata lp 
) [static]

Definition at line 815 of file lp.c.

References ILLread_lp_state::field, ILLread_lp_state::fieldOnFirstCol, ILL_MAX, ILL_MIN, ILLlp_error(), ILLread_lp_state_prev_field(), ILLutil_strcasecmp(), and rawlpdata::objsense.

Referenced by ILLread_lp().

Here is the call graph for this function:

static int read_objective ( ILLread_lp_state state,
rawlpdata lp 
) [static]

Definition at line 919 of file lp.c.

References ILL_FAILfalse, ILL_namebufsize, ILLlp_error(), ILLlp_warn(), ILLraw_add_row(), ILLread_constraint_expr(), ILLread_lp_state_colon(), ILLread_lp_state_has_colon(), ILLread_lp_state_next_var(), ILLread_lp_state_skip_blanks(), rawlpdata::nrows, NULL, rawlpdata::objindex, rawlpdata::rowtab, and ILLsymboltab::tablesize.

Referenced by ILLread_lp().

Here is the call graph for this function:

static int read_problem_name ( ILLread_lp_state state,
rawlpdata lp 
) [static]

Definition at line 783 of file lp.c.

References ILLread_lp_state::field, ILLread_lp_state::fieldOnFirstCol, ILL_IFFREE, ILL_IFTRACE, ILL_UTIL_STR, ILLlp_error(), ILLread_lp_state_next_field(), ILLutil_strcasecmp(), and rawlpdata::name.

Referenced by ILLread_lp().

Here is the call graph for this function:

static int write_bounds ( ILLlpdata lp,
char **  colnames 
) [static]

Definition at line 474 of file lp.c.

References ILLwrite_lp_state::buf, ILL_FAILtrue, ILL_MAXDOUBLE, ILL_MINDOUBLE, ILLprint_report(), ILLraw_default_lower(), ILLraw_default_upper(), ILLraw_first_nondefault_bound(), ILLwrite_lp_state_append(), ILLwrite_lp_state_append_number(), ILLwrite_lp_state_init(), ILLwrite_lp_state_save_start(), ILLwrite_lp_state_start(), ILLlpdata::lower, ILLlpdata::nstruct, NULL, ILLlpdata::structmap, and ILLlpdata::upper.

Here is the call graph for this function:

static void write_intvars ( ILLlpdata lp,
char **  colnames 
) [static]

Definition at line 538 of file lp.c.

References ILLwrite_lp_state::buf, ILLprint_report(), ILLwrite_lp_state_append(), ILLwrite_lp_state_init(), ILLwrite_lp_state_save_start(), ILLlpdata::intmarker, LINE_LEN, ILLlpdata::nstruct, and ILLwrite_lp_state::total.

Here is the call graph for this function:

static void write_objective ( ILLlpdata lp,
const char *  objname,
char **  colnames 
) [static]

Definition at line 279 of file lp.c.

References ILL_MIN, ILLprint_report(), ILLwrite_lp_state_append(), ILLwrite_lp_state_append_coef(), ILLwrite_lp_state_init(), ILLwrite_lp_state_save_start(), ILLwrite_lp_state_start(), LINE_LEN, ILLlpdata::nstruct, NULL, ILLlpdata::obj, ILLlpdata::objsense, ILLlpdata::probname, and ILLlpdata::structmap.

Referenced by ILLwrite_lp().

Here is the call graph for this function:

static int write_row ( ILLlpdata lp,
ILLlp_rows lprows,
int  i,
char **  rownames,
char **  colnames,
int *  colInRow,
EGlpNum_t *  colCoef 
) [static]

Definition at line 415 of file lp.c.

References ILLwrite_lp_state::buf, ILL_FAILtrue, ILLprint_report(), ILLwrite_lp_state_append(), ILLwrite_lp_state_append_number(), ILLlpdata::nstruct, NULL, ILLlpdata::rangeval, ILLlpdata::rhs, ILLlpdata::sense, and write_the_expr().

Referenced by ILLwrite_lp().

Here is the call graph for this function:

static void write_the_expr ( ILLlpdata lp,
ILLwrite_lp_state line,
char *  rowname,
ILLlp_rows lprows,
int  row,
char **  colnames,
int *  colInRow,
EGlpNum_t *  colCoef,
int  ncols 
) [static]

Definition at line 351 of file lp.c.

References ILLwrite_lp_state::buf, ILLprint_report(), ILLwrite_lp_state_append(), ILLwrite_lp_state_append_coef(), ILLwrite_lp_state_init(), ILLwrite_lp_state_save_start(), ILLwrite_lp_state_start(), LINE_LEN, NULL, ILLlp_rows::rowbeg, ILLlp_rows::rowcnt, ILLlp_rows::rowind, ILLlp_rows::rowval, and ILLwrite_lp_state::total.

Referenced by write_row().

Here is the call graph for this function:


Variable Documentation

const int LINE_LEN = 256 [static]

Definition at line 98 of file lp.c.

Referenced by write_intvars(), write_objective(), and write_the_expr().

int TRACE = 0 [static]

Definition at line 109 of file lp.c.


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