ldbl_lp.c File Reference

#include <stdio.h>
#include "qs_config.h"
#include "ldbl_iqsutil.h"
#include "ldbl_lp.h"
#include "ldbl_rawlp.h"
#include "ldbl_read_lp.h"
#include "ldbl_write_lp.h"

Include dependency graph for ldbl_lp.c:

Go to the source code of this file.

Functions

static int ldbl_add_var (ldbl_rawlpdata *lp, ldbl_ILLread_lp_state *state, long double coef, int row, int allowNew)
static int ldbl_fix_names (ldbl_qserror_collector *collector, char **names, int nnames, const char *extra, int prefix, char ***newnames)
int ldbl_ILLis_lp_name_char (int c, int pos)
int ldbl_ILLread_constraint_expr (ldbl_ILLread_lp_state *state, ldbl_rawlpdata *lp, int rowind, int allowNew)
int ldbl_ILLread_constraint_name (ldbl_ILLread_lp_state *state, char **rowname)
int ldbl_ILLread_lp (ldbl_qsline_reader *file, const char *ldbl_fname, ldbl_rawlpdata *lp)
int ldbl_ILLread_one_constraint (ldbl_ILLread_lp_state *state, const char *rowname, ldbl_rawlpdata *lp, int allowNewCols)
int ldbl_ILLwrite_lp (ldbl_ILLlpdata *lp, ldbl_qserror_collector *collector)
static int ldbl_read_bounds (ldbl_ILLread_lp_state *state, ldbl_rawlpdata *lp)
static int ldbl_read_colname (ldbl_ILLread_lp_state *state, ILLsymboltab *coltab, int mustHave)
static int ldbl_read_constraints (ldbl_ILLread_lp_state *state, ldbl_rawlpdata *lp, int allowNewCols)
static int ldbl_read_integer (ldbl_ILLread_lp_state *state, ldbl_rawlpdata *lp)
static int ldbl_read_minmax (ldbl_ILLread_lp_state *state, ldbl_rawlpdata *lp)
static int ldbl_read_objective (ldbl_ILLread_lp_state *state, ldbl_rawlpdata *lp)
static int ldbl_read_problem_name (ldbl_ILLread_lp_state *state, ldbl_rawlpdata *lp)
static int ldbl_write_bounds (ldbl_ILLlpdata *lp, char **colnames)
static void ldbl_write_intvars (ldbl_ILLlpdata *lp, char **colnames)
static void ldbl_write_objective (ldbl_ILLlpdata *lp, const char *objname, char **colnames)
static int ldbl_write_row (ldbl_ILLlpdata *lp, ldbl_ILLlp_rows *lprows, int i, char **rownames, char **colnames, int *colInRow, long double *colCoef)
static void ldbl_write_the_expr (ldbl_ILLlpdata *lp, ldbl_ILLwrite_lp_state *line, char *rowname, ldbl_ILLlp_rows *lprows, int row, char **colnames, int *colInRow, long double *colCoef, int ncols)

Variables

static const int ldbl_LINE_LEN = 256
static int TRACE = 0


Function Documentation

static int ldbl_add_var ( ldbl_rawlpdata lp,
ldbl_ILLread_lp_state state,
long double  coef,
int  row,
int  allowNew 
) [static]

Definition at line 1241 of file ldbl_lp.c.

References ldbl_rawlpdata::coltab, ldbl_ILLread_lp_state::field, ILL_IFTRACE, ILLsymboltab_lookup(), ldbl_ILLlp_error(), ldbl_ILLraw_add_col(), ldbl_ILLraw_add_col_coef(), ldbl_ILLraw_rowname(), and ldbl_rawlpdata::ncols.

Referenced by ldbl_ILLread_constraint_expr().

Here is the call graph for this function:

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

Definition at line 584 of file ldbl_lp.c.

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

Referenced by ldbl_ILLwrite_lp().

Here is the call graph for this function:

int ldbl_ILLis_lp_name_char ( int  c,
int  pos 
)

Definition at line 74 of file ldbl_lp.c.

References NULL.

Referenced by ldbl_fix_names(), and ldbl_ILLread_lp_state_next_var().

int ldbl_ILLread_constraint_expr ( ldbl_ILLread_lp_state state,
ldbl_rawlpdata lp,
int  rowind,
int  allowNew 
)

Definition at line 851 of file ldbl_lp.c.

References ldbl_add_var(), ldbl_ILLlp_error(), ldbl_ILLlp_warn(), ldbl_ILLraw_rowname(), ldbl_ILLread_lp_state_next_var(), ldbl_ILLread_lp_state_possible_coef(), ldbl_ILLread_lp_state_sign(), and NULL.

Referenced by ldbl_ILLread_one_constraint(), and ldbl_read_objective().

Here is the call graph for this function:

int ldbl_ILLread_constraint_name ( ldbl_ILLread_lp_state state,
char **  rowname 
)

Definition at line 971 of file ldbl_lp.c.

References ldbl_ILLlp_error(), ldbl_ILLread_lp_state_colon(), ldbl_ILLread_lp_state_has_colon(), ldbl_ILLread_lp_state_next_var(), and NULL.

Referenced by ldbl_get_row_col_name(), and ldbl_read_constraints().

Here is the call graph for this function:

int ldbl_ILLread_lp ( ldbl_qsline_reader file,
const char *  ldbl_fname,
ldbl_rawlpdata lp 
)

Definition at line 685 of file ldbl_lp.c.

References ldbl_ILLread_lp_state::bound_val, ldbl_rawlpdata::coltab, ldbl_qsline_reader::error_collector, ILLsymboltab_create(), ldbl_ILLinit_rawlpdata(), ldbl_ILLlp_error(), ldbl_ILLraw_fill_in_bounds(), ldbl_ILLraw_fill_in_rownames(), ldbl_ILLread_lp_state_init(), ldbl_ILLread_lp_state_keyword(), ldbl_ILLread_lp_state_next_field(), ldbl_read_bounds(), ldbl_read_constraints(), ldbl_read_integer(), ldbl_read_minmax(), ldbl_read_objective(), ldbl_read_problem_name(), ldbl_rawlpdata::ncols, ldbl_rawlpdata::nrows, NULL, and ldbl_rawlpdata::rowtab.

Referenced by ldbl_ILLread().

Here is the call graph for this function:

int ldbl_ILLread_one_constraint ( ldbl_ILLread_lp_state state,
const char *  rowname,
ldbl_rawlpdata lp,
int  allowNewCols 
)

Definition at line 998 of file ldbl_lp.c.

References ILL_IFTRACE, ILLsymboltab_lookup(), ldbl_ILLlp_error(), ldbl_ILLraw_add_row(), ldbl_ILLraw_rowname(), ldbl_ILLread_constraint_expr(), ldbl_ILLread_lp_state_sense(), ldbl_ILLread_lp_state_value(), ldbl_rawlpdata::nrows, NULL, ldbl_rawlpdata::rhs, ldbl_rawlpdata::rowsense, ldbl_rawlpdata::rowtab, and ldbl_ILLread_lp_state::sense_val.

Referenced by ldbl_add_col(), ldbl_add_row(), and ldbl_read_constraints().

Here is the call graph for this function:

int ldbl_ILLwrite_lp ( ldbl_ILLlpdata lp,
ldbl_qserror_collector collector 
)

Definition at line 173 of file ldbl_lp.c.

References ldbl_ILLlpdata::colnames, ldbl_ILLlpdata::coltab, ILL_FAILfalse, ILL_FAILtrue, ILL_SAFE_MALLOC, ILLsymboltab_contains(), ldbl_fix_names(), ldbl_ILLdata_error(), ldbl_ILLlp_rows_init(), ldbl_ILLprint_report(), ldbl_write_objective(), ldbl_write_row(), ldbl_ILLmatrix::matcols, ldbl_ILLlpdata::nrows, ldbl_ILLlpdata::nstruct, NULL, ldbl_ILLlpdata::objname, ldbl_ILLlpdata::rownames, ldbl_ILLlpdata::rowtab, ldbl_ILLlpdata::sos, and ILLsymboltab::tablesize.

Referenced by ldbl_ILLlib_optimize(), ldbl_ILLwrite_lp_file(), and ldbl_QSreport_prob().

Here is the call graph for this function:

static int ldbl_read_bounds ( ldbl_ILLread_lp_state state,
ldbl_rawlpdata lp 
) [static]

Definition at line 1133 of file ldbl_lp.c.

References ldbl_rawlpdata::coltab, ILL_FAILtrue, ILL_IFTRACE, ldbl_ILLlp_error(), ldbl_ILLlp_warn(), ldbl_ILLraw_colname(), ldbl_ILLraw_init_bounds(), ldbl_ILLraw_set_fixedBound(), ldbl_ILLraw_set_lowerBound(), ldbl_ILLraw_set_unbound(), ldbl_ILLraw_set_upperBound(), ldbl_ILLread_lp_state_next_field(), ldbl_ILLread_lp_state_possible_bound_value(), ldbl_ILLtest_lp_state_bound_sense(), ldbl_ILLtest_lp_state_next_is(), ldbl_read_colname(), ldbl_rawlpdata::lower, and ldbl_rawlpdata::upper.

Referenced by ldbl_ILLread_lp().

Here is the call graph for this function:

static int ldbl_read_colname ( ldbl_ILLread_lp_state state,
ILLsymboltab coltab,
int  mustHave 
) [static]

Definition at line 1080 of file ldbl_lp.c.

References ldbl_ILLread_lp_state::column_index, ldbl_ILLread_lp_state::field, ILL_SYM_NOINDEX, ILLsymboltab_lookup(), ldbl_ILLlp_error(), ldbl_ILLread_lp_state_next_var(), and ldbl_ILLread_lp_state_prev_field().

Referenced by ldbl_read_bounds(), and ldbl_read_integer().

Here is the call graph for this function:

static int ldbl_read_constraints ( ldbl_ILLread_lp_state state,
ldbl_rawlpdata lp,
int  allowNewCols 
) [static]

Definition at line 1043 of file ldbl_lp.c.

References ldbl_ILLcheck_subject_to(), ldbl_ILLlp_error(), ldbl_ILLread_constraint_name(), ldbl_ILLread_lp_state_next_constraint(), ldbl_ILLread_lp_state_next_field(), ldbl_ILLread_one_constraint(), and NULL.

Referenced by ldbl_ILLread_lp().

Here is the call graph for this function:

static int ldbl_read_integer ( ldbl_ILLread_lp_state state,
ldbl_rawlpdata lp 
) [static]

Definition at line 1106 of file ldbl_lp.c.

References ldbl_rawlpdata::coltab, ILL_FAILfalse, ILL_FAILtrue, ILL_SYM_NOINDEX, ldbl_rawlpdata::intmarker, ldbl_ILLlp_error(), ldbl_ILLread_lp_state_next_field(), and ldbl_read_colname().

Referenced by ldbl_ILLread_lp().

Here is the call graph for this function:

static int ldbl_read_minmax ( ldbl_ILLread_lp_state state,
ldbl_rawlpdata lp 
) [static]

Definition at line 815 of file ldbl_lp.c.

References ldbl_ILLread_lp_state::field, ldbl_ILLread_lp_state::fieldOnFirstCol, ldbl_ILL_MAX, ldbl_ILL_MIN, ldbl_ILLlp_error(), ldbl_ILLread_lp_state_prev_field(), ldbl_ILLutil_strcasecmp(), and ldbl_rawlpdata::objsense.

Referenced by ldbl_ILLread_lp().

Here is the call graph for this function:

static int ldbl_read_objective ( ldbl_ILLread_lp_state state,
ldbl_rawlpdata lp 
) [static]

Definition at line 919 of file ldbl_lp.c.

References ILL_FAILfalse, ILL_namebufsize, ldbl_ILLlp_error(), ldbl_ILLlp_warn(), ldbl_ILLraw_add_row(), ldbl_ILLread_constraint_expr(), ldbl_ILLread_lp_state_colon(), ldbl_ILLread_lp_state_has_colon(), ldbl_ILLread_lp_state_next_var(), ldbl_ILLread_lp_state_skip_blanks(), ldbl_rawlpdata::nrows, NULL, ldbl_rawlpdata::objindex, ldbl_rawlpdata::rowtab, and ILLsymboltab::tablesize.

Referenced by ldbl_ILLread_lp().

Here is the call graph for this function:

static int ldbl_read_problem_name ( ldbl_ILLread_lp_state state,
ldbl_rawlpdata lp 
) [static]

Definition at line 783 of file ldbl_lp.c.

References ldbl_ILLread_lp_state::field, ldbl_ILLread_lp_state::fieldOnFirstCol, ILL_IFFREE, ILL_IFTRACE, ldbl_ILLlp_error(), ldbl_ILLread_lp_state_next_field(), ldbl_ILLutil_strcasecmp(), and ldbl_rawlpdata::name.

Referenced by ldbl_ILLread_lp().

Here is the call graph for this function:

static int ldbl_write_bounds ( ldbl_ILLlpdata lp,
char **  colnames 
) [static]

Definition at line 474 of file ldbl_lp.c.

References ldbl_ILLwrite_lp_state::buf, ILL_FAILtrue, ldbl_ILL_MAXDOUBLE, ldbl_ILL_MINDOUBLE, ldbl_ILLprint_report(), ldbl_ILLraw_default_lower(), ldbl_ILLraw_default_upper(), ldbl_ILLraw_first_nondefault_bound(), ldbl_ILLwrite_lp_state_append(), ldbl_ILLwrite_lp_state_append_number(), ldbl_ILLwrite_lp_state_init(), ldbl_ILLwrite_lp_state_save_start(), ldbl_ILLwrite_lp_state_start(), ldbl_ILLlpdata::lower, ldbl_ILLlpdata::nstruct, NULL, ldbl_ILLlpdata::structmap, and ldbl_ILLlpdata::upper.

Here is the call graph for this function:

static void ldbl_write_intvars ( ldbl_ILLlpdata lp,
char **  colnames 
) [static]

Definition at line 538 of file ldbl_lp.c.

References ldbl_ILLwrite_lp_state::buf, ldbl_ILLlpdata::intmarker, ldbl_ILLprint_report(), ldbl_ILLwrite_lp_state_append(), ldbl_ILLwrite_lp_state_init(), ldbl_ILLwrite_lp_state_save_start(), ldbl_LINE_LEN, ldbl_ILLlpdata::nstruct, and ldbl_ILLwrite_lp_state::total.

Here is the call graph for this function:

static void ldbl_write_objective ( ldbl_ILLlpdata lp,
const char *  objname,
char **  colnames 
) [static]

Definition at line 279 of file ldbl_lp.c.

References ldbl_ILL_MIN, ldbl_ILLprint_report(), ldbl_ILLwrite_lp_state_append(), ldbl_ILLwrite_lp_state_append_coef(), ldbl_ILLwrite_lp_state_init(), ldbl_ILLwrite_lp_state_save_start(), ldbl_ILLwrite_lp_state_start(), ldbl_LINE_LEN, ldbl_ILLlpdata::nstruct, NULL, ldbl_ILLlpdata::obj, ldbl_ILLlpdata::objsense, ldbl_ILLlpdata::probname, and ldbl_ILLlpdata::structmap.

Referenced by ldbl_ILLwrite_lp().

Here is the call graph for this function:

static int ldbl_write_row ( ldbl_ILLlpdata lp,
ldbl_ILLlp_rows lprows,
int  i,
char **  rownames,
char **  colnames,
int *  colInRow,
long double *  colCoef 
) [static]

Definition at line 415 of file ldbl_lp.c.

References ldbl_ILLwrite_lp_state::buf, ILL_FAILtrue, ldbl_ILLprint_report(), ldbl_ILLwrite_lp_state_append(), ldbl_ILLwrite_lp_state_append_number(), ldbl_write_the_expr(), ldbl_ILLlpdata::nstruct, NULL, ldbl_ILLlpdata::rangeval, ldbl_ILLlpdata::rhs, and ldbl_ILLlpdata::sense.

Referenced by ldbl_ILLwrite_lp().

Here is the call graph for this function:

static void ldbl_write_the_expr ( ldbl_ILLlpdata lp,
ldbl_ILLwrite_lp_state line,
char *  rowname,
ldbl_ILLlp_rows lprows,
int  row,
char **  colnames,
int *  colInRow,
long double *  colCoef,
int  ncols 
) [static]

Definition at line 351 of file ldbl_lp.c.

References ldbl_ILLwrite_lp_state::buf, ldbl_ILLprint_report(), ldbl_ILLwrite_lp_state_append(), ldbl_ILLwrite_lp_state_append_coef(), ldbl_ILLwrite_lp_state_init(), ldbl_ILLwrite_lp_state_save_start(), ldbl_ILLwrite_lp_state_start(), ldbl_LINE_LEN, NULL, ldbl_ILLlp_rows::rowbeg, ldbl_ILLlp_rows::rowcnt, ldbl_ILLlp_rows::rowind, ldbl_ILLlp_rows::rowval, and ldbl_ILLwrite_lp_state::total.

Referenced by ldbl_write_row().

Here is the call graph for this function:


Variable Documentation

const int ldbl_LINE_LEN = 256 [static]

Definition at line 98 of file ldbl_lp.c.

Referenced by ldbl_write_intvars(), ldbl_write_objective(), and ldbl_write_the_expr().

int TRACE = 0 [static]

Definition at line 109 of file ldbl_lp.c.


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