fp20_editor.c File Reference

#include "qs_config.h"
#include "fp20_qsopt.h"
#include "fp20_lpdata.h"
#include "fp20_qstruct.h"
#include "fp20_editor.h"
#include "fp20_readline.h"
#include "fp20_rawlp.h"
#include "stddefs.h"
#include "fp20_read_lp.h"
#include "fp20_lp.h"
#include "fp20_lib.h"

Include dependency graph for fp20_editor.c:

Go to the source code of this file.

Defines

#define fp20_ADD   10
#define fp20_COL   2
#define fp20_DEL   8
#define fp20_DUAL   12
#define fp20_HELP   7
#define fp20_ILL_BREAK_BODY   goto CLEANUP
#define fp20_ILL_BREAK_BODY_IF(rval)   if (rval != 0) goto CLEANUP
#define fp20_NCOMMAND   13
#define fp20_NEW   9
#define fp20_NONE   -1
#define fp20_PLP   3
#define fp20_PMPS   6
#define fp20_PRIMAL   11
#define fp20_PRTX   4
#define fp20_QS_EXIT   0
#define fp20_ROW   1
#define fp20_SOLVE   5

Functions

static void fp20_add_col (fp20_QSdata *p, fp20_rawlpdata *lp, fp20_ILLread_lp_state *state)
static void fp20_add_row (fp20_QSdata *p, fp20_rawlpdata *lp, fp20_ILLread_lp_state *state)
static void fp20_del_col (fp20_QSdata *p, fp20_rawlpdata *lp, fp20_ILLread_lp_state *state)
static void fp20_del_row (fp20_QSdata *p, fp20_rawlpdata *lp, fp20_ILLread_lp_state *state)
static int fp20_del_row_or_col (fp20_QSdata *p, fp20_rawlpdata *lp, fp20_ILLread_lp_state *state, int isRow)
static int fp20_fill_matrix (fp20_rawlpdata *lp, fp20_ILLread_lp_state *state, fp20_ILLmatrix *m, EGfp20_t *obj, int n)
static char * fp20_get_row_col_name (fp20_QSdata *p, fp20_rawlpdata *lp, fp20_ILLread_lp_state *state, int doRow)
static void fp20_getCmd (fp20_ILLread_lp_state *state, int *cmd, int *subcmd)
void fp20_ILLeditor (fp20_QSdata *p)
static void fp20_ILLeditor_help (void)
static void fp20_ILLeditor_help_cmd (int cmd, int subcmd)
void fp20_ILLeditor_init (void)
int fp20_ILLeditor_solve (fp20_QSdata *p, int salgo)
static int fp20_pull_info_from_p (fp20_QSdata *p, fp20_rawlpdata *lp)
static int fp20_transpose (fp20_rawlpdata *lp)

Variables

static const char * fp20_commands [fp20_NCOMMAND+1]
static char fp20_hasSubCmd [fp20_NCOMMAND+1]
static int TRACE = 0


Define Documentation

#define fp20_ADD   10

Definition at line 67 of file fp20_editor.c.

Referenced by fp20_ILLeditor(), fp20_ILLeditor_help(), fp20_ILLeditor_help_cmd(), and fp20_ILLeditor_init().

#define fp20_COL   2

Definition at line 59 of file fp20_editor.c.

Referenced by fp20_getCmd(), fp20_ILLeditor(), fp20_ILLeditor_help(), fp20_ILLeditor_help_cmd(), and fp20_ILLeditor_init().

#define fp20_DEL   8

Definition at line 65 of file fp20_editor.c.

Referenced by fp20_ILLeditor(), fp20_ILLeditor_help(), fp20_ILLeditor_help_cmd(), and fp20_ILLeditor_init().

#define fp20_DUAL   12

Definition at line 69 of file fp20_editor.c.

Referenced by fp20_ILLeditor(), and fp20_ILLeditor_init().

#define fp20_HELP   7

Definition at line 64 of file fp20_editor.c.

Referenced by fp20_ILLeditor_help(), fp20_ILLeditor_help_cmd(), and fp20_ILLeditor_init().

#define fp20_ILL_BREAK_BODY   goto CLEANUP

Definition at line 44 of file fp20_editor.c.

Referenced by fp20_ILLeditor().

#define fp20_ILL_BREAK_BODY_IF ( rval   )     if (rval != 0) goto CLEANUP

Definition at line 43 of file fp20_editor.c.

Referenced by fp20_add_col(), fp20_add_row(), fp20_del_row_or_col(), fp20_get_row_col_name(), fp20_ILLeditor(), fp20_ILLeditor_solve(), and fp20_pull_info_from_p().

#define fp20_NCOMMAND   13

Definition at line 70 of file fp20_editor.c.

Referenced by fp20_ILLeditor_init().

#define fp20_NEW   9

Definition at line 66 of file fp20_editor.c.

Referenced by fp20_ILLeditor_init().

#define fp20_NONE   -1

Definition at line 56 of file fp20_editor.c.

Referenced by fp20_ILLeditor(), and fp20_ILLeditor_help().

#define fp20_PLP   3

Definition at line 60 of file fp20_editor.c.

Referenced by fp20_ILLeditor(), fp20_ILLeditor_help(), fp20_ILLeditor_help_cmd(), and fp20_ILLeditor_init().

#define fp20_PMPS   6

Definition at line 63 of file fp20_editor.c.

Referenced by fp20_ILLeditor(), fp20_ILLeditor_help(), fp20_ILLeditor_help_cmd(), and fp20_ILLeditor_init().

#define fp20_PRIMAL   11

Definition at line 68 of file fp20_editor.c.

Referenced by fp20_ILLeditor(), and fp20_ILLeditor_init().

#define fp20_PRTX   4

Definition at line 61 of file fp20_editor.c.

Referenced by fp20_ILLeditor(), fp20_ILLeditor_help(), fp20_ILLeditor_help_cmd(), and fp20_ILLeditor_init().

#define fp20_QS_EXIT   0

Definition at line 57 of file fp20_editor.c.

Referenced by fp20_ILLeditor(), fp20_ILLeditor_help(), fp20_ILLeditor_help_cmd(), and fp20_ILLeditor_init().

#define fp20_ROW   1

Definition at line 58 of file fp20_editor.c.

Referenced by fp20_getCmd(), fp20_ILLeditor(), fp20_ILLeditor_help(), fp20_ILLeditor_help_cmd(), and fp20_ILLeditor_init().

#define fp20_SOLVE   5

Definition at line 62 of file fp20_editor.c.

Referenced by fp20_getCmd(), fp20_ILLeditor(), fp20_ILLeditor_help(), fp20_ILLeditor_help_cmd(), and fp20_ILLeditor_init().


Function Documentation

static void fp20_add_col ( fp20_QSdata p,
fp20_rawlpdata lp,
fp20_ILLread_lp_state state 
) [static]

Definition at line 594 of file fp20_editor.c.

References fp20_fill_matrix(), fp20_get_row_col_name(), fp20_ILL_BREAK_BODY_IF, fp20_ILLmatrix_free(), fp20_ILLmatrix_init(), fp20_ILLraw_clear_matrix(), fp20_ILLread_lp_state_next_line(), fp20_ILLread_lp_state_value(), fp20_ILLread_one_constraint(), fp20_QSadd_cols(), fp20_transpose(), ILL_FAILfalse, ILL_IFFREE, ILL_IFTRACE, ILLsymboltab_delete(), fp20_ILLmatrix::matbeg, fp20_ILLmatrix::matcnt, fp20_ILLmatrix::matind, fp20_ILLmatrix::matval, fp20_rawlpdata::ncols, fp20_rawlpdata::nrows, NULL, and fp20_rawlpdata::rowtab.

Referenced by fp20_ILLeditor(), and fp20_read_mps_line_in_section().

Here is the call graph for this function:

static void fp20_add_row ( fp20_QSdata p,
fp20_rawlpdata lp,
fp20_ILLread_lp_state state 
) [static]

Definition at line 535 of file fp20_editor.c.

References fp20_fill_matrix(), fp20_get_row_col_name(), fp20_ILL_BREAK_BODY_IF, fp20_ILLmatrix_free(), fp20_ILLmatrix_init(), fp20_ILLraw_clear_matrix(), fp20_ILLread_one_constraint(), fp20_QSadd_rows(), ILL_FAILfalse, ILL_IFFREE, ILL_IFTRACE, ILLsymboltab_delete(), fp20_ILLmatrix::matbeg, fp20_ILLmatrix::matcnt, fp20_ILLmatrix::matind, fp20_ILLmatrix::matval, fp20_rawlpdata::nrows, NULL, fp20_rawlpdata::rhs, fp20_rawlpdata::rowsense, and fp20_rawlpdata::rowtab.

Referenced by fp20_ILLeditor(), and fp20_read_mps_line_in_section().

Here is the call graph for this function:

static void fp20_del_col ( fp20_QSdata p,
fp20_rawlpdata lp,
fp20_ILLread_lp_state state 
) [static]

Definition at line 769 of file fp20_editor.c.

References fp20_del_row_or_col(), and fp20_rawlpdata::ncols.

Referenced by fp20_ILLeditor().

Here is the call graph for this function:

static void fp20_del_row ( fp20_QSdata p,
fp20_rawlpdata lp,
fp20_ILLread_lp_state state 
) [static]

Definition at line 756 of file fp20_editor.c.

References fp20_del_row_or_col(), and fp20_rawlpdata::nrows.

Referenced by fp20_ILLeditor().

Here is the call graph for this function:

static int fp20_del_row_or_col ( fp20_QSdata p,
fp20_rawlpdata lp,
fp20_ILLread_lp_state state,
int  isRow 
) [static]

Definition at line 724 of file fp20_editor.c.

References fp20_ILLlpdata::colnames, fp20_rawlpdata::coltab, fp20_ILLread_lp_state::field, fp20_ILL_BREAK_BODY_IF, fp20_ILLlp_error(), fp20_ILLread_lp_state_next_field_on_line(), fp20_ILLutil_array_index(), fp20_QSdelete_cols(), fp20_QSdelete_rows(), ILL_RESULT, ILLsymboltab_delete(), fp20_ILLlpdata::nrows, fp20_ILLlpdata::nstruct, fp20_qsdata::qslp, fp20_ILLlpdata::rownames, and fp20_rawlpdata::rowtab.

Referenced by fp20_del_col(), and fp20_del_row().

Here is the call graph for this function:

static int fp20_fill_matrix ( fp20_rawlpdata lp,
fp20_ILLread_lp_state state,
fp20_ILLmatrix m,
EGfp20_t *  obj,
int  n 
) [static]

Definition at line 468 of file fp20_editor.c.

References fp20_colptr::coef, fp20_rawlpdata::cols, fp20_ILLlp_error(), fp20_ILLlp_warn(), fp20_ILLraw_colname(), ILL_FAILfalse, ILL_RESULT, ILL_SAFE_MALLOC, fp20_ILLmatrix::matbeg, fp20_ILLmatrix::matcnt, fp20_ILLmatrix::matcols, fp20_ILLmatrix::matind, fp20_ILLmatrix::matrows, fp20_ILLmatrix::matsize, fp20_ILLmatrix::matval, fp20_rawlpdata::ncols, fp20_colptr::next, fp20_rawlpdata::nrows, NULL, and fp20_colptr::this_val.

Referenced by fp20_add_col(), and fp20_add_row().

Here is the call graph for this function:

static char* fp20_get_row_col_name ( fp20_QSdata p,
fp20_rawlpdata lp,
fp20_ILLread_lp_state state,
int  doRow 
) [static]

Definition at line 429 of file fp20_editor.c.

References fp20_rawlpdata::coltab, fp20_ILL_BREAK_BODY_IF, fp20_ILL_UTIL_STR, fp20_ILLlib_findName(), fp20_ILLlp_error(), fp20_ILLread_constraint_name(), ILL_IFFREE, ILL_namebufsize, ILLsymboltab_lookup(), fp20_rawlpdata::ncols, fp20_rawlpdata::nrows, NULL, fp20_qsdata::qslp, and fp20_rawlpdata::rowtab.

Referenced by fp20_add_col(), and fp20_add_row().

Here is the call graph for this function:

static void fp20_getCmd ( fp20_ILLread_lp_state state,
int *  cmd,
int *  subcmd 
) [static]

Definition at line 165 of file fp20_editor.c.

References fp20_ILLread_lp_state::field, fp20_COL, fp20_commands, fp20_hasSubCmd, fp20_ILL_SWAP, fp20_ILLread_lp_state_next_field_on_line(), fp20_ILLutil_index(), fp20_ROW, fp20_SOLVE, and ILL_IFTRACE.

Referenced by fp20_ILLeditor().

Here is the call graph for this function:

void fp20_ILLeditor ( fp20_QSdata p  ) 

Definition at line 188 of file fp20_editor.c.

References DUAL_SIMPLEX, fp20_ADD, fp20_add_col(), fp20_add_row(), fp20_COL, fp20_DEL, fp20_del_col(), fp20_del_row(), fp20_DUAL, fp20_getCmd(), fp20_ILL_BREAK_BODY, fp20_ILL_BREAK_BODY_IF, fp20_ILLeditor_help(), fp20_ILLeditor_solve(), fp20_ILLfree_rawlpdata(), fp20_ILLlib_print_x(), fp20_ILLline_reader_free(), fp20_ILLline_reader_new(), fp20_ILLread_lp_state_init(), fp20_ILLread_lp_state_next_field(), fp20_ILLread_lp_state_next_field_on_line(), fp20_ILLread_lp_state_next_line(), fp20_NONE, fp20_PLP, fp20_PMPS, fp20_PRIMAL, fp20_PRTX, fp20_pull_info_from_p(), fp20_QS_EXIT, fp20_QSwrite_prob(), fp20_QSwrite_prob_file(), fp20_ROW, fp20_SOLVE, ILL_IFTRACE, fp20_qsdata::lp, and PRIMAL_SIMPLEX.

Here is the call graph for this function:

static void fp20_ILLeditor_help ( void   )  [static]

Definition at line 112 of file fp20_editor.c.

References fp20_ADD, fp20_COL, fp20_DEL, fp20_HELP, fp20_ILLeditor_help_cmd(), fp20_NONE, fp20_PLP, fp20_PMPS, fp20_PRTX, fp20_QS_EXIT, fp20_ROW, and fp20_SOLVE.

Referenced by fp20_ILLeditor().

Here is the call graph for this function:

static void fp20_ILLeditor_help_cmd ( int  cmd,
int  subcmd 
) [static]

Definition at line 128 of file fp20_editor.c.

References fp20_ADD, fp20_COL, fp20_commands, fp20_DEL, fp20_HELP, fp20_PLP, fp20_PMPS, fp20_PRTX, fp20_QS_EXIT, fp20_ROW, and fp20_SOLVE.

Referenced by fp20_ILLeditor_help().

void fp20_ILLeditor_init ( void   ) 

Definition at line 74 of file fp20_editor.c.

References fp20_ADD, fp20_COL, fp20_commands, fp20_DEL, fp20_DUAL, fp20_hasSubCmd, fp20_HELP, fp20_NCOMMAND, fp20_NEW, fp20_PLP, fp20_PMPS, fp20_PRIMAL, fp20_PRTX, fp20_QS_EXIT, fp20_ROW, fp20_SOLVE, and NULL.

int fp20_ILLeditor_solve ( fp20_QSdata p,
int  salgo 
)

Definition at line 324 of file fp20_editor.c.

References fp20_ILL_BREAK_BODY_IF, fp20_QSget_objval(), fp20_QSopt_dual(), fp20_QSopt_primal(), ILL_RESULT, PRIMAL_SIMPLEX, and fp20_qsdata::simplex_display.

Here is the call graph for this function:

static int fp20_pull_info_from_p ( fp20_QSdata p,
fp20_rawlpdata lp 
) [static]

Definition at line 357 of file fp20_editor.c.

References fp20_ILLlpdata::colnames, fp20_rawlpdata::coltab, fp20_ILL_BREAK_BODY_IF, fp20_ILLinit_rawlpdata(), fp20_ILLraw_add_col(), fp20_ILLraw_add_row(), ILL_FAILfalse, ILL_RETURN, ILLsymboltab_create(), fp20_ILLlpdata::intmarker, fp20_qsdata::lp, fp20_ILLlpdata::nrows, fp20_ILLlpdata::nstruct, NULL, fp20_lpinfo::O, fp20_ILLlpdata::objname, fp20_ILLlpdata::rhs, fp20_ILLlpdata::rownames, fp20_rawlpdata::rowtab, and fp20_ILLlpdata::sense.

Referenced by fp20_ILLeditor().

Here is the call graph for this function:

static int fp20_transpose ( fp20_rawlpdata lp  )  [static]

Definition at line 391 of file fp20_editor.c.

References fp20_rawlpdata::coltab, fp20_ILL_SWAP, ILL_RETURN, fp20_rawlpdata::ncols, fp20_rawlpdata::nrows, QSMAX, fp20_rawlpdata::rhs, fp20_rawlpdata::rhssize, fp20_rawlpdata::rowsense, fp20_rawlpdata::rowtab, and fp20_rawlpdata::sensesize.

Referenced by fp20_add_col().


Variable Documentation

const char* fp20_commands[fp20_NCOMMAND+1] [static]

Definition at line 71 of file fp20_editor.c.

Referenced by fp20_getCmd(), fp20_ILLeditor_help_cmd(), and fp20_ILLeditor_init().

char fp20_hasSubCmd[fp20_NCOMMAND+1] [static]

Definition at line 72 of file fp20_editor.c.

Referenced by fp20_getCmd(), and fp20_ILLeditor_init().

int TRACE = 0 [static]

Definition at line 41 of file fp20_editor.c.


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