editor.c File Reference

#include "qs_config.h"
#include "qsopt.h"
#include "lpdata.h"
#include "qstruct.h"
#include "editor.h"
#include "readline.h"
#include "rawlp.h"
#include "stddefs.h"
#include "read_lp.h"
#include "lp.h"
#include "lib.h"

Include dependency graph for editor.c:

Go to the source code of this file.

Defines

#define ADD   10
#define COL   2
#define DEL   8
#define DUAL   12
#define HELP   7
#define ILL_BREAK_BODY   goto CLEANUP
#define ILL_BREAK_BODY_IF(rval)   if (rval != 0) goto CLEANUP
#define NCOMMAND   13
#define NEW   9
#define NONE   -1
#define PLP   3
#define PMPS   6
#define PRIMAL   11
#define PRTX   4
#define QS_EXIT   0
#define ROW   1
#define SOLVE   5

Functions

static void add_col (QSdata *p, rawlpdata *lp, ILLread_lp_state *state)
static void add_row (QSdata *p, rawlpdata *lp, ILLread_lp_state *state)
static void del_col (QSdata *p, rawlpdata *lp, ILLread_lp_state *state)
static void del_row (QSdata *p, rawlpdata *lp, ILLread_lp_state *state)
static int del_row_or_col (QSdata *p, rawlpdata *lp, ILLread_lp_state *state, int isRow)
static int fill_matrix (rawlpdata *lp, ILLread_lp_state *state, ILLmatrix *m, EGlpNum_t *obj, int n)
static char * get_row_col_name (QSdata *p, rawlpdata *lp, ILLread_lp_state *state, int doRow)
static void getCmd (ILLread_lp_state *state, int *cmd, int *subcmd)
void ILLeditor (QSdata *p)
static void ILLeditor_help (void)
static void ILLeditor_help_cmd (int cmd, int subcmd)
void ILLeditor_init (void)
int ILLeditor_solve (QSdata *p, int salgo)
static int pull_info_from_p (QSdata *p, rawlpdata *lp)
static int transpose (rawlpdata *lp)

Variables

static const char * commands [NCOMMAND+1]
static char hasSubCmd [NCOMMAND+1]
static int TRACE = 0


Define Documentation

#define ADD   10

Definition at line 67 of file editor.c.

Referenced by ILLeditor(), ILLeditor_help(), ILLeditor_help_cmd(), and ILLeditor_init().

#define COL   2

Definition at line 59 of file editor.c.

Referenced by getCmd(), ILLeditor(), ILLeditor_help(), ILLeditor_help_cmd(), and ILLeditor_init().

#define DEL   8

Definition at line 65 of file editor.c.

Referenced by ILLeditor(), ILLeditor_help(), ILLeditor_help_cmd(), and ILLeditor_init().

#define DUAL   12

Definition at line 69 of file editor.c.

Referenced by ILLeditor(), and ILLeditor_init().

#define HELP   7

Definition at line 64 of file editor.c.

Referenced by ILLeditor_help(), ILLeditor_help_cmd(), and ILLeditor_init().

#define ILL_BREAK_BODY   goto CLEANUP

Definition at line 44 of file editor.c.

Referenced by ILLeditor().

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

Definition at line 43 of file editor.c.

Referenced by add_col(), add_row(), del_row_or_col(), get_row_col_name(), ILLeditor(), ILLeditor_solve(), and pull_info_from_p().

#define NCOMMAND   13

Definition at line 70 of file editor.c.

Referenced by ILLeditor_init().

#define NEW   9

Definition at line 66 of file editor.c.

Referenced by ILLeditor_init().

#define NONE   -1

Definition at line 56 of file editor.c.

Referenced by ILLeditor(), and ILLeditor_help().

#define PLP   3

Definition at line 60 of file editor.c.

Referenced by ILLeditor(), ILLeditor_help(), ILLeditor_help_cmd(), and ILLeditor_init().

#define PMPS   6

Definition at line 63 of file editor.c.

Referenced by ILLeditor(), ILLeditor_help(), ILLeditor_help_cmd(), and ILLeditor_init().

#define PRIMAL   11

Definition at line 68 of file editor.c.

Referenced by ILLeditor(), and ILLeditor_init().

#define PRTX   4

Definition at line 61 of file editor.c.

Referenced by ILLeditor(), ILLeditor_help(), ILLeditor_help_cmd(), and ILLeditor_init().

#define QS_EXIT   0

Definition at line 57 of file editor.c.

Referenced by ILLeditor(), ILLeditor_help(), ILLeditor_help_cmd(), and ILLeditor_init().

#define ROW   1

Definition at line 58 of file editor.c.

Referenced by getCmd(), ILLeditor(), ILLeditor_help(), ILLeditor_help_cmd(), and ILLeditor_init().

#define SOLVE   5

Definition at line 62 of file editor.c.

Referenced by getCmd(), ILLeditor(), ILLeditor_help(), ILLeditor_help_cmd(), and ILLeditor_init().


Function Documentation

static void add_col ( QSdata p,
rawlpdata lp,
ILLread_lp_state state 
) [static]

Definition at line 594 of file editor.c.

References fill_matrix(), get_row_col_name(), ILL_BREAK_BODY_IF, ILL_FAILfalse, ILL_IFFREE, ILL_IFTRACE, ILLmatrix_free(), ILLmatrix_init(), ILLraw_clear_matrix(), ILLread_lp_state_next_line(), ILLread_lp_state_value(), ILLread_one_constraint(), ILLsymboltab_delete(), ILLmatrix::matbeg, ILLmatrix::matcnt, ILLmatrix::matind, ILLmatrix::matval, rawlpdata::ncols, rawlpdata::nrows, NULL, QSadd_cols(), rawlpdata::rowtab, and transpose().

Referenced by ILLeditor(), and read_mps_line_in_section().

Here is the call graph for this function:

static void add_row ( QSdata p,
rawlpdata lp,
ILLread_lp_state state 
) [static]

Definition at line 535 of file editor.c.

References fill_matrix(), get_row_col_name(), ILL_BREAK_BODY_IF, ILL_FAILfalse, ILL_IFFREE, ILL_IFTRACE, ILLmatrix_free(), ILLmatrix_init(), ILLraw_clear_matrix(), ILLread_one_constraint(), ILLsymboltab_delete(), ILLmatrix::matbeg, ILLmatrix::matcnt, ILLmatrix::matind, ILLmatrix::matval, rawlpdata::nrows, NULL, QSadd_rows(), rawlpdata::rhs, rawlpdata::rowsense, and rawlpdata::rowtab.

Referenced by ILLeditor(), and read_mps_line_in_section().

Here is the call graph for this function:

static void del_col ( QSdata p,
rawlpdata lp,
ILLread_lp_state state 
) [static]

Definition at line 769 of file editor.c.

References del_row_or_col(), and rawlpdata::ncols.

Referenced by ILLeditor().

Here is the call graph for this function:

static void del_row ( QSdata p,
rawlpdata lp,
ILLread_lp_state state 
) [static]

Definition at line 756 of file editor.c.

References del_row_or_col(), and rawlpdata::nrows.

Referenced by ILLeditor().

Here is the call graph for this function:

static int del_row_or_col ( QSdata p,
rawlpdata lp,
ILLread_lp_state state,
int  isRow 
) [static]

Definition at line 724 of file editor.c.

References ILLlpdata::colnames, rawlpdata::coltab, ILLread_lp_state::field, ILL_BREAK_BODY_IF, ILL_RESULT, ILLlp_error(), ILLread_lp_state_next_field_on_line(), ILLsymboltab_delete(), ILLutil_array_index(), ILLlpdata::nrows, ILLlpdata::nstruct, QSdelete_cols(), QSdelete_rows(), qsdata::qslp, ILLlpdata::rownames, and rawlpdata::rowtab.

Referenced by del_col(), and del_row().

Here is the call graph for this function:

static int fill_matrix ( rawlpdata lp,
ILLread_lp_state state,
ILLmatrix m,
EGlpNum_t *  obj,
int  n 
) [static]

Definition at line 468 of file editor.c.

References colptr::coef, rawlpdata::cols, ILL_FAILfalse, ILL_RESULT, ILL_SAFE_MALLOC, ILLlp_error(), ILLlp_warn(), ILLraw_colname(), ILLmatrix::matbeg, ILLmatrix::matcnt, ILLmatrix::matcols, ILLmatrix::matind, ILLmatrix::matrows, ILLmatrix::matsize, ILLmatrix::matval, rawlpdata::ncols, colptr::next, rawlpdata::nrows, NULL, and colptr::this_val.

Referenced by add_col(), and add_row().

Here is the call graph for this function:

static char* get_row_col_name ( QSdata p,
rawlpdata lp,
ILLread_lp_state state,
int  doRow 
) [static]

Definition at line 429 of file editor.c.

References rawlpdata::coltab, ILL_BREAK_BODY_IF, ILL_IFFREE, ILL_namebufsize, ILL_UTIL_STR, ILLlib_findName(), ILLlp_error(), ILLread_constraint_name(), ILLsymboltab_lookup(), rawlpdata::ncols, rawlpdata::nrows, NULL, qsdata::qslp, and rawlpdata::rowtab.

Referenced by add_col(), and add_row().

Here is the call graph for this function:

static void getCmd ( ILLread_lp_state state,
int *  cmd,
int *  subcmd 
) [static]

Definition at line 165 of file editor.c.

References COL, commands, ILLread_lp_state::field, hasSubCmd, ILL_IFTRACE, ILL_SWAP, ILLread_lp_state_next_field_on_line(), ILLutil_index(), ROW, and SOLVE.

Referenced by ILLeditor().

Here is the call graph for this function:

void ILLeditor ( QSdata p  ) 

Definition at line 188 of file editor.c.

References ADD, add_col(), add_row(), COL, DEL, del_col(), del_row(), DUAL, DUAL_SIMPLEX, getCmd(), ILL_BREAK_BODY, ILL_BREAK_BODY_IF, ILL_IFTRACE, ILLeditor_help(), ILLeditor_solve(), ILLfree_rawlpdata(), ILLlib_print_x(), ILLline_reader_free(), ILLline_reader_new(), ILLread_lp_state_init(), ILLread_lp_state_next_field(), ILLread_lp_state_next_field_on_line(), ILLread_lp_state_next_line(), qsdata::lp, NONE, PLP, PMPS, PRIMAL, PRIMAL_SIMPLEX, PRTX, pull_info_from_p(), QS_EXIT, QSwrite_prob(), QSwrite_prob_file(), ROW, and SOLVE.

Referenced by solver_main().

Here is the call graph for this function:

static void ILLeditor_help ( void   )  [static]

Definition at line 112 of file editor.c.

References ADD, COL, DEL, HELP, ILLeditor_help_cmd(), NONE, PLP, PMPS, PRTX, QS_EXIT, ROW, and SOLVE.

Referenced by ILLeditor().

Here is the call graph for this function:

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

Definition at line 128 of file editor.c.

References ADD, COL, commands, DEL, HELP, PLP, PMPS, PRTX, QS_EXIT, ROW, and SOLVE.

Referenced by ILLeditor_help().

void ILLeditor_init ( void   ) 

Definition at line 74 of file editor.c.

References ADD, COL, commands, DEL, DUAL, hasSubCmd, HELP, NCOMMAND, NEW, NULL, PLP, PMPS, PRIMAL, PRTX, QS_EXIT, ROW, and SOLVE.

Referenced by solver_main().

int ILLeditor_solve ( QSdata p,
int  salgo 
)

Definition at line 324 of file editor.c.

References ILL_BREAK_BODY_IF, ILL_RESULT, PRIMAL_SIMPLEX, QSget_objval(), QSopt_dual(), QSopt_primal(), and qsdata::simplex_display.

Referenced by ILLeditor(), and solver_main().

Here is the call graph for this function:

static int pull_info_from_p ( QSdata p,
rawlpdata lp 
) [static]

Definition at line 357 of file editor.c.

References ILLlpdata::colnames, rawlpdata::coltab, ILL_BREAK_BODY_IF, ILL_FAILfalse, ILL_RETURN, ILLinit_rawlpdata(), ILLraw_add_col(), ILLraw_add_row(), ILLsymboltab_create(), ILLlpdata::intmarker, qsdata::lp, ILLlpdata::nrows, ILLlpdata::nstruct, NULL, lpinfo::O, ILLlpdata::objname, ILLlpdata::rhs, ILLlpdata::rownames, rawlpdata::rowtab, and ILLlpdata::sense.

Referenced by ILLeditor().

Here is the call graph for this function:

static int transpose ( rawlpdata lp  )  [static]

Definition at line 391 of file editor.c.

References rawlpdata::coltab, ILL_RETURN, ILL_SWAP, rawlpdata::ncols, rawlpdata::nrows, QSMAX, rawlpdata::rhs, rawlpdata::rhssize, rawlpdata::rowsense, rawlpdata::rowtab, and rawlpdata::sensesize.

Referenced by add_col().


Variable Documentation

const char* commands[NCOMMAND+1] [static]

Definition at line 71 of file editor.c.

Referenced by getCmd(), ILLeditor_help_cmd(), and ILLeditor_init().

char hasSubCmd[NCOMMAND+1] [static]

Definition at line 72 of file editor.c.

Referenced by getCmd(), and ILLeditor_init().

int TRACE = 0 [static]

Definition at line 41 of file editor.c.


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