mpf_lp.c File Reference

#include <stdio.h>
#include "qs_config.h"
#include "mpf_iqsutil.h"
#include "mpf_lp.h"
#include "mpf_rawlp.h"
#include "mpf_read_lp.h"
#include "mpf_write_lp.h"

Include dependency graph for mpf_lp.c:

Go to the source code of this file.

Functions

static int mpf_add_var (mpf_rawlpdata *lp, mpf_ILLread_lp_state *state, mpf_t coef, int row, int allowNew)
static int mpf_fix_names (mpf_qserror_collector *collector, char **names, int nnames, const char *extra, int prefix, char ***newnames)
int mpf_ILLis_lp_name_char (int c, int pos)
int mpf_ILLread_constraint_expr (mpf_ILLread_lp_state *state, mpf_rawlpdata *lp, int rowind, int allowNew)
int mpf_ILLread_constraint_name (mpf_ILLread_lp_state *state, char **rowname)
int mpf_ILLread_lp (mpf_qsline_reader *file, const char *mpf_fname, mpf_rawlpdata *lp)
int mpf_ILLread_one_constraint (mpf_ILLread_lp_state *state, const char *rowname, mpf_rawlpdata *lp, int allowNewCols)
int mpf_ILLwrite_lp (mpf_ILLlpdata *lp, mpf_qserror_collector *collector)
static int mpf_read_bounds (mpf_ILLread_lp_state *state, mpf_rawlpdata *lp)
static int mpf_read_colname (mpf_ILLread_lp_state *state, ILLsymboltab *coltab, int mustHave)
static int mpf_read_constraints (mpf_ILLread_lp_state *state, mpf_rawlpdata *lp, int allowNewCols)
static int mpf_read_integer (mpf_ILLread_lp_state *state, mpf_rawlpdata *lp)
static int mpf_read_minmax (mpf_ILLread_lp_state *state, mpf_rawlpdata *lp)
static int mpf_read_objective (mpf_ILLread_lp_state *state, mpf_rawlpdata *lp)
static int mpf_read_problem_name (mpf_ILLread_lp_state *state, mpf_rawlpdata *lp)
static int mpf_write_bounds (mpf_ILLlpdata *lp, char **colnames)
static void mpf_write_intvars (mpf_ILLlpdata *lp, char **colnames)
static void mpf_write_objective (mpf_ILLlpdata *lp, const char *objname, char **colnames)
static int mpf_write_row (mpf_ILLlpdata *lp, mpf_ILLlp_rows *lprows, int i, char **rownames, char **colnames, int *colInRow, mpf_t *colCoef)
static void mpf_write_the_expr (mpf_ILLlpdata *lp, mpf_ILLwrite_lp_state *line, char *rowname, mpf_ILLlp_rows *lprows, int row, char **colnames, int *colInRow, mpf_t *colCoef, int ncols)

Variables

static const int mpf_LINE_LEN = 256
static int TRACE = 0


Function Documentation

static int mpf_add_var ( mpf_rawlpdata lp,
mpf_ILLread_lp_state state,
mpf_t  coef,
int  row,
int  allowNew 
) [static]

Definition at line 1241 of file mpf_lp.c.

References mpf_rawlpdata::coltab, mpf_ILLread_lp_state::field, ILL_IFTRACE, ILLsymboltab_lookup(), mpf_ILLlp_error(), mpf_ILLraw_add_col(), mpf_ILLraw_add_col_coef(), mpf_ILLraw_rowname(), and mpf_rawlpdata::ncols.

Referenced by mpf_ILLread_constraint_expr().

Here is the call graph for this function:

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

Definition at line 584 of file mpf_lp.c.

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

Referenced by mpf_ILLwrite_lp().

Here is the call graph for this function:

int mpf_ILLis_lp_name_char ( int  c,
int  pos 
)

Definition at line 74 of file mpf_lp.c.

References NULL.

Referenced by mpf_fix_names(), and mpf_ILLread_lp_state_next_var().

int mpf_ILLread_constraint_expr ( mpf_ILLread_lp_state state,
mpf_rawlpdata lp,
int  rowind,
int  allowNew 
)

Definition at line 851 of file mpf_lp.c.

References mpf_add_var(), mpf_ILLlp_error(), mpf_ILLlp_warn(), mpf_ILLraw_rowname(), mpf_ILLread_lp_state_next_var(), mpf_ILLread_lp_state_possible_coef(), mpf_ILLread_lp_state_sign(), and NULL.

Referenced by mpf_ILLread_one_constraint(), and mpf_read_objective().

Here is the call graph for this function:

int mpf_ILLread_constraint_name ( mpf_ILLread_lp_state state,
char **  rowname 
)

Definition at line 971 of file mpf_lp.c.

References mpf_ILLlp_error(), mpf_ILLread_lp_state_colon(), mpf_ILLread_lp_state_has_colon(), mpf_ILLread_lp_state_next_var(), and NULL.

Referenced by mpf_get_row_col_name(), and mpf_read_constraints().

Here is the call graph for this function:

int mpf_ILLread_lp ( mpf_qsline_reader file,
const char *  mpf_fname,
mpf_rawlpdata lp 
)

Definition at line 685 of file mpf_lp.c.

References mpf_ILLread_lp_state::bound_val, mpf_rawlpdata::coltab, mpf_qsline_reader::error_collector, ILLsymboltab_create(), mpf_ILLinit_rawlpdata(), mpf_ILLlp_error(), mpf_ILLraw_fill_in_bounds(), mpf_ILLraw_fill_in_rownames(), mpf_ILLread_lp_state_init(), mpf_ILLread_lp_state_keyword(), mpf_ILLread_lp_state_next_field(), mpf_read_bounds(), mpf_read_constraints(), mpf_read_integer(), mpf_read_minmax(), mpf_read_objective(), mpf_read_problem_name(), mpf_rawlpdata::ncols, mpf_rawlpdata::nrows, NULL, and mpf_rawlpdata::rowtab.

Referenced by mpf_ILLread().

Here is the call graph for this function:

int mpf_ILLread_one_constraint ( mpf_ILLread_lp_state state,
const char *  rowname,
mpf_rawlpdata lp,
int  allowNewCols 
)

Definition at line 998 of file mpf_lp.c.

References ILL_IFTRACE, ILLsymboltab_lookup(), mpf_ILLlp_error(), mpf_ILLraw_add_row(), mpf_ILLraw_rowname(), mpf_ILLread_constraint_expr(), mpf_ILLread_lp_state_sense(), mpf_ILLread_lp_state_value(), mpf_rawlpdata::nrows, NULL, mpf_rawlpdata::rhs, mpf_rawlpdata::rowsense, mpf_rawlpdata::rowtab, and mpf_ILLread_lp_state::sense_val.

Referenced by mpf_add_col(), mpf_add_row(), and mpf_read_constraints().

Here is the call graph for this function:

int mpf_ILLwrite_lp ( mpf_ILLlpdata lp,
mpf_qserror_collector collector 
)

Definition at line 173 of file mpf_lp.c.

References mpf_ILLlpdata::colnames, mpf_ILLlpdata::coltab, ILL_FAILfalse, ILL_FAILtrue, ILL_SAFE_MALLOC, ILLsymboltab_contains(), mpf_ILLmatrix::matcols, mpf_fix_names(), mpf_ILLdata_error(), mpf_ILLlp_rows_init(), mpf_ILLprint_report(), mpf_write_objective(), mpf_write_row(), mpf_ILLlpdata::nrows, mpf_ILLlpdata::nstruct, NULL, mpf_ILLlpdata::objname, mpf_ILLlpdata::rownames, mpf_ILLlpdata::rowtab, mpf_ILLlpdata::sos, and ILLsymboltab::tablesize.

Referenced by mpf_ILLlib_optimize(), mpf_ILLwrite_lp_file(), and mpf_QSreport_prob().

Here is the call graph for this function:

static int mpf_read_bounds ( mpf_ILLread_lp_state state,
mpf_rawlpdata lp 
) [static]

Definition at line 1133 of file mpf_lp.c.

References mpf_rawlpdata::coltab, ILL_FAILtrue, ILL_IFTRACE, mpf_rawlpdata::lower, mpf_ILLlp_error(), mpf_ILLlp_warn(), mpf_ILLraw_colname(), mpf_ILLraw_init_bounds(), mpf_ILLraw_set_fixedBound(), mpf_ILLraw_set_lowerBound(), mpf_ILLraw_set_unbound(), mpf_ILLraw_set_upperBound(), mpf_ILLread_lp_state_next_field(), mpf_ILLread_lp_state_possible_bound_value(), mpf_ILLtest_lp_state_bound_sense(), mpf_ILLtest_lp_state_next_is(), mpf_read_colname(), and mpf_rawlpdata::upper.

Referenced by mpf_ILLread_lp().

Here is the call graph for this function:

static int mpf_read_colname ( mpf_ILLread_lp_state state,
ILLsymboltab coltab,
int  mustHave 
) [static]

Definition at line 1080 of file mpf_lp.c.

References mpf_ILLread_lp_state::column_index, mpf_ILLread_lp_state::field, ILL_SYM_NOINDEX, ILLsymboltab_lookup(), mpf_ILLlp_error(), mpf_ILLread_lp_state_next_var(), and mpf_ILLread_lp_state_prev_field().

Referenced by mpf_read_bounds(), and mpf_read_integer().

Here is the call graph for this function:

static int mpf_read_constraints ( mpf_ILLread_lp_state state,
mpf_rawlpdata lp,
int  allowNewCols 
) [static]

Definition at line 1043 of file mpf_lp.c.

References mpf_ILLcheck_subject_to(), mpf_ILLlp_error(), mpf_ILLread_constraint_name(), mpf_ILLread_lp_state_next_constraint(), mpf_ILLread_lp_state_next_field(), mpf_ILLread_one_constraint(), and NULL.

Referenced by mpf_ILLread_lp().

Here is the call graph for this function:

static int mpf_read_integer ( mpf_ILLread_lp_state state,
mpf_rawlpdata lp 
) [static]

Definition at line 1106 of file mpf_lp.c.

References mpf_rawlpdata::coltab, ILL_FAILfalse, ILL_FAILtrue, ILL_SYM_NOINDEX, mpf_rawlpdata::intmarker, mpf_ILLlp_error(), mpf_ILLread_lp_state_next_field(), and mpf_read_colname().

Referenced by mpf_ILLread_lp().

Here is the call graph for this function:

static int mpf_read_minmax ( mpf_ILLread_lp_state state,
mpf_rawlpdata lp 
) [static]

Definition at line 815 of file mpf_lp.c.

References mpf_ILLread_lp_state::field, mpf_ILLread_lp_state::fieldOnFirstCol, mpf_ILL_MAX, mpf_ILL_MIN, mpf_ILLlp_error(), mpf_ILLread_lp_state_prev_field(), mpf_ILLutil_strcasecmp(), and mpf_rawlpdata::objsense.

Referenced by mpf_ILLread_lp().

Here is the call graph for this function:

static int mpf_read_objective ( mpf_ILLread_lp_state state,
mpf_rawlpdata lp 
) [static]

Definition at line 919 of file mpf_lp.c.

References ILL_FAILfalse, ILL_namebufsize, mpf_ILLlp_error(), mpf_ILLlp_warn(), mpf_ILLraw_add_row(), mpf_ILLread_constraint_expr(), mpf_ILLread_lp_state_colon(), mpf_ILLread_lp_state_has_colon(), mpf_ILLread_lp_state_next_var(), mpf_ILLread_lp_state_skip_blanks(), mpf_rawlpdata::nrows, NULL, mpf_rawlpdata::objindex, mpf_rawlpdata::rowtab, and ILLsymboltab::tablesize.

Referenced by mpf_ILLread_lp().

Here is the call graph for this function:

static int mpf_read_problem_name ( mpf_ILLread_lp_state state,
mpf_rawlpdata lp 
) [static]

Definition at line 783 of file mpf_lp.c.

References mpf_ILLread_lp_state::field, mpf_ILLread_lp_state::fieldOnFirstCol, ILL_IFFREE, ILL_IFTRACE, mpf_ILLlp_error(), mpf_ILLread_lp_state_next_field(), mpf_ILLutil_strcasecmp(), and mpf_rawlpdata::name.

Referenced by mpf_ILLread_lp().

Here is the call graph for this function:

static int mpf_write_bounds ( mpf_ILLlpdata lp,
char **  colnames 
) [static]

Definition at line 474 of file mpf_lp.c.

References mpf_ILLwrite_lp_state::buf, ILL_FAILtrue, mpf_ILLlpdata::lower, mpf_ILL_MAXDOUBLE, mpf_ILL_MINDOUBLE, mpf_ILLprint_report(), mpf_ILLraw_default_lower(), mpf_ILLraw_default_upper(), mpf_ILLraw_first_nondefault_bound(), mpf_ILLwrite_lp_state_append(), mpf_ILLwrite_lp_state_append_number(), mpf_ILLwrite_lp_state_init(), mpf_ILLwrite_lp_state_save_start(), mpf_ILLwrite_lp_state_start(), mpf_ILLlpdata::nstruct, NULL, mpf_ILLlpdata::structmap, and mpf_ILLlpdata::upper.

Here is the call graph for this function:

static void mpf_write_intvars ( mpf_ILLlpdata lp,
char **  colnames 
) [static]

Definition at line 538 of file mpf_lp.c.

References mpf_ILLwrite_lp_state::buf, mpf_ILLlpdata::intmarker, mpf_ILLprint_report(), mpf_ILLwrite_lp_state_append(), mpf_ILLwrite_lp_state_init(), mpf_ILLwrite_lp_state_save_start(), mpf_LINE_LEN, mpf_ILLlpdata::nstruct, and mpf_ILLwrite_lp_state::total.

Here is the call graph for this function:

static void mpf_write_objective ( mpf_ILLlpdata lp,
const char *  objname,
char **  colnames 
) [static]

Definition at line 279 of file mpf_lp.c.

References mpf_ILL_MIN, mpf_ILLprint_report(), mpf_ILLwrite_lp_state_append(), mpf_ILLwrite_lp_state_append_coef(), mpf_ILLwrite_lp_state_init(), mpf_ILLwrite_lp_state_save_start(), mpf_ILLwrite_lp_state_start(), mpf_LINE_LEN, mpf_ILLlpdata::nstruct, NULL, mpf_ILLlpdata::obj, mpf_ILLlpdata::objsense, mpf_ILLlpdata::probname, and mpf_ILLlpdata::structmap.

Referenced by mpf_ILLwrite_lp().

Here is the call graph for this function:

static int mpf_write_row ( mpf_ILLlpdata lp,
mpf_ILLlp_rows lprows,
int  i,
char **  rownames,
char **  colnames,
int *  colInRow,
mpf_t *  colCoef 
) [static]

Definition at line 415 of file mpf_lp.c.

References mpf_ILLwrite_lp_state::buf, ILL_FAILtrue, mpf_ILLprint_report(), mpf_ILLwrite_lp_state_append(), mpf_ILLwrite_lp_state_append_number(), mpf_write_the_expr(), mpf_ILLlpdata::nstruct, NULL, mpf_ILLlpdata::rangeval, mpf_ILLlpdata::rhs, and mpf_ILLlpdata::sense.

Referenced by mpf_ILLwrite_lp().

Here is the call graph for this function:

static void mpf_write_the_expr ( mpf_ILLlpdata lp,
mpf_ILLwrite_lp_state line,
char *  rowname,
mpf_ILLlp_rows lprows,
int  row,
char **  colnames,
int *  colInRow,
mpf_t *  colCoef,
int  ncols 
) [static]

Definition at line 351 of file mpf_lp.c.

References mpf_ILLwrite_lp_state::buf, mpf_ILLprint_report(), mpf_ILLwrite_lp_state_append(), mpf_ILLwrite_lp_state_append_coef(), mpf_ILLwrite_lp_state_init(), mpf_ILLwrite_lp_state_save_start(), mpf_ILLwrite_lp_state_start(), mpf_LINE_LEN, NULL, mpf_ILLlp_rows::rowbeg, mpf_ILLlp_rows::rowcnt, mpf_ILLlp_rows::rowind, mpf_ILLlp_rows::rowval, and mpf_ILLwrite_lp_state::total.

Referenced by mpf_write_row().

Here is the call graph for this function:


Variable Documentation

const int mpf_LINE_LEN = 256 [static]

Definition at line 98 of file mpf_lp.c.

Referenced by mpf_write_intvars(), mpf_write_objective(), and mpf_write_the_expr().

int TRACE = 0 [static]

Definition at line 109 of file mpf_lp.c.


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