dbl_editor.c File Reference

#include "qs_config.h"
#include "dbl_qsopt.h"
#include "dbl_lpdata.h"
#include "dbl_qstruct.h"
#include "dbl_editor.h"
#include "dbl_readline.h"
#include "dbl_rawlp.h"
#include "stddefs.h"
#include "dbl_read_lp.h"
#include "dbl_lp.h"
#include "dbl_lib.h"

Include dependency graph for dbl_editor.c:

Go to the source code of this file.

Defines

#define dbl_ADD   10
#define dbl_COL   2
#define dbl_DEL   8
#define dbl_DUAL   12
#define dbl_HELP   7
#define dbl_ILL_BREAK_BODY   goto CLEANUP
#define dbl_ILL_BREAK_BODY_IF(rval)   if (rval != 0) goto CLEANUP
#define dbl_NCOMMAND   13
#define dbl_NEW   9
#define dbl_NONE   -1
#define dbl_PLP   3
#define dbl_PMPS   6
#define dbl_PRIMAL   11
#define dbl_PRTX   4
#define dbl_QS_EXIT   0
#define dbl_ROW   1
#define dbl_SOLVE   5

Functions

static void dbl_add_col (dbl_QSdata *p, dbl_rawlpdata *lp, dbl_ILLread_lp_state *state)
static void dbl_add_row (dbl_QSdata *p, dbl_rawlpdata *lp, dbl_ILLread_lp_state *state)
static void dbl_del_col (dbl_QSdata *p, dbl_rawlpdata *lp, dbl_ILLread_lp_state *state)
static void dbl_del_row (dbl_QSdata *p, dbl_rawlpdata *lp, dbl_ILLread_lp_state *state)
static int dbl_del_row_or_col (dbl_QSdata *p, dbl_rawlpdata *lp, dbl_ILLread_lp_state *state, int isRow)
static int dbl_fill_matrix (dbl_rawlpdata *lp, dbl_ILLread_lp_state *state, dbl_ILLmatrix *m, double *obj, int n)
static char * dbl_get_row_col_name (dbl_QSdata *p, dbl_rawlpdata *lp, dbl_ILLread_lp_state *state, int doRow)
static void dbl_getCmd (dbl_ILLread_lp_state *state, int *cmd, int *subcmd)
void dbl_ILLeditor (dbl_QSdata *p)
static void dbl_ILLeditor_help (void)
static void dbl_ILLeditor_help_cmd (int cmd, int subcmd)
void dbl_ILLeditor_init (void)
int dbl_ILLeditor_solve (dbl_QSdata *p, int salgo)
static int dbl_pull_info_from_p (dbl_QSdata *p, dbl_rawlpdata *lp)
static int dbl_transpose (dbl_rawlpdata *lp)

Variables

static const char * dbl_commands [dbl_NCOMMAND+1]
static char dbl_hasSubCmd [dbl_NCOMMAND+1]
static int TRACE = 0


Define Documentation

#define dbl_ADD   10

Definition at line 67 of file dbl_editor.c.

Referenced by dbl_ILLeditor(), dbl_ILLeditor_help(), dbl_ILLeditor_help_cmd(), and dbl_ILLeditor_init().

#define dbl_COL   2

Definition at line 59 of file dbl_editor.c.

Referenced by dbl_getCmd(), dbl_ILLeditor(), dbl_ILLeditor_help(), dbl_ILLeditor_help_cmd(), and dbl_ILLeditor_init().

#define dbl_DEL   8

Definition at line 65 of file dbl_editor.c.

Referenced by dbl_ILLeditor(), dbl_ILLeditor_help(), dbl_ILLeditor_help_cmd(), and dbl_ILLeditor_init().

#define dbl_DUAL   12

Definition at line 69 of file dbl_editor.c.

Referenced by dbl_ILLeditor(), and dbl_ILLeditor_init().

#define dbl_HELP   7

Definition at line 64 of file dbl_editor.c.

Referenced by dbl_ILLeditor_help(), dbl_ILLeditor_help_cmd(), and dbl_ILLeditor_init().

#define dbl_ILL_BREAK_BODY   goto CLEANUP

Definition at line 44 of file dbl_editor.c.

Referenced by dbl_ILLeditor().

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

Definition at line 43 of file dbl_editor.c.

Referenced by dbl_add_col(), dbl_add_row(), dbl_del_row_or_col(), dbl_get_row_col_name(), dbl_ILLeditor(), dbl_ILLeditor_solve(), and dbl_pull_info_from_p().

#define dbl_NCOMMAND   13

Definition at line 70 of file dbl_editor.c.

Referenced by dbl_ILLeditor_init().

#define dbl_NEW   9

Definition at line 66 of file dbl_editor.c.

Referenced by dbl_ILLeditor_init().

#define dbl_NONE   -1

Definition at line 56 of file dbl_editor.c.

Referenced by dbl_ILLeditor(), and dbl_ILLeditor_help().

#define dbl_PLP   3

Definition at line 60 of file dbl_editor.c.

Referenced by dbl_ILLeditor(), dbl_ILLeditor_help(), dbl_ILLeditor_help_cmd(), and dbl_ILLeditor_init().

#define dbl_PMPS   6

Definition at line 63 of file dbl_editor.c.

Referenced by dbl_ILLeditor(), dbl_ILLeditor_help(), dbl_ILLeditor_help_cmd(), and dbl_ILLeditor_init().

#define dbl_PRIMAL   11

Definition at line 68 of file dbl_editor.c.

Referenced by dbl_ILLeditor(), and dbl_ILLeditor_init().

#define dbl_PRTX   4

Definition at line 61 of file dbl_editor.c.

Referenced by dbl_ILLeditor(), dbl_ILLeditor_help(), dbl_ILLeditor_help_cmd(), and dbl_ILLeditor_init().

#define dbl_QS_EXIT   0

Definition at line 57 of file dbl_editor.c.

Referenced by dbl_ILLeditor(), dbl_ILLeditor_help(), dbl_ILLeditor_help_cmd(), and dbl_ILLeditor_init().

#define dbl_ROW   1

Definition at line 58 of file dbl_editor.c.

Referenced by dbl_getCmd(), dbl_ILLeditor(), dbl_ILLeditor_help(), dbl_ILLeditor_help_cmd(), and dbl_ILLeditor_init().

#define dbl_SOLVE   5

Definition at line 62 of file dbl_editor.c.

Referenced by dbl_getCmd(), dbl_ILLeditor(), dbl_ILLeditor_help(), dbl_ILLeditor_help_cmd(), and dbl_ILLeditor_init().


Function Documentation

static void dbl_add_col ( dbl_QSdata p,
dbl_rawlpdata lp,
dbl_ILLread_lp_state state 
) [static]

Definition at line 594 of file dbl_editor.c.

References dbl_fill_matrix(), dbl_get_row_col_name(), dbl_ILL_BREAK_BODY_IF, dbl_ILLmatrix_free(), dbl_ILLmatrix_init(), dbl_ILLraw_clear_matrix(), dbl_ILLread_lp_state_next_line(), dbl_ILLread_lp_state_value(), dbl_ILLread_one_constraint(), dbl_QSadd_cols(), dbl_transpose(), ILL_FAILfalse, ILL_IFFREE, ILL_IFTRACE, ILLsymboltab_delete(), dbl_ILLmatrix::matbeg, dbl_ILLmatrix::matcnt, dbl_ILLmatrix::matind, dbl_ILLmatrix::matval, dbl_rawlpdata::ncols, dbl_rawlpdata::nrows, NULL, and dbl_rawlpdata::rowtab.

Referenced by dbl_ILLeditor(), and dbl_read_mps_line_in_section().

Here is the call graph for this function:

static void dbl_add_row ( dbl_QSdata p,
dbl_rawlpdata lp,
dbl_ILLread_lp_state state 
) [static]

Definition at line 535 of file dbl_editor.c.

References dbl_fill_matrix(), dbl_get_row_col_name(), dbl_ILL_BREAK_BODY_IF, dbl_ILLmatrix_free(), dbl_ILLmatrix_init(), dbl_ILLraw_clear_matrix(), dbl_ILLread_one_constraint(), dbl_QSadd_rows(), ILL_FAILfalse, ILL_IFFREE, ILL_IFTRACE, ILLsymboltab_delete(), dbl_ILLmatrix::matbeg, dbl_ILLmatrix::matcnt, dbl_ILLmatrix::matind, dbl_ILLmatrix::matval, dbl_rawlpdata::nrows, NULL, dbl_rawlpdata::rhs, dbl_rawlpdata::rowsense, and dbl_rawlpdata::rowtab.

Referenced by dbl_ILLeditor(), and dbl_read_mps_line_in_section().

Here is the call graph for this function:

static void dbl_del_col ( dbl_QSdata p,
dbl_rawlpdata lp,
dbl_ILLread_lp_state state 
) [static]

Definition at line 769 of file dbl_editor.c.

References dbl_del_row_or_col(), and dbl_rawlpdata::ncols.

Referenced by dbl_ILLeditor().

Here is the call graph for this function:

static void dbl_del_row ( dbl_QSdata p,
dbl_rawlpdata lp,
dbl_ILLread_lp_state state 
) [static]

Definition at line 756 of file dbl_editor.c.

References dbl_del_row_or_col(), and dbl_rawlpdata::nrows.

Referenced by dbl_ILLeditor().

Here is the call graph for this function:

static int dbl_del_row_or_col ( dbl_QSdata p,
dbl_rawlpdata lp,
dbl_ILLread_lp_state state,
int  isRow 
) [static]

Definition at line 724 of file dbl_editor.c.

References dbl_ILLlpdata::colnames, dbl_rawlpdata::coltab, dbl_ILL_BREAK_BODY_IF, dbl_ILLlp_error(), dbl_ILLread_lp_state_next_field_on_line(), dbl_ILLutil_array_index(), dbl_QSdelete_cols(), dbl_QSdelete_rows(), dbl_ILLread_lp_state::field, ILL_RESULT, ILLsymboltab_delete(), dbl_ILLlpdata::nrows, dbl_ILLlpdata::nstruct, dbl_qsdata::qslp, dbl_ILLlpdata::rownames, and dbl_rawlpdata::rowtab.

Referenced by dbl_del_col(), and dbl_del_row().

Here is the call graph for this function:

static int dbl_fill_matrix ( dbl_rawlpdata lp,
dbl_ILLread_lp_state state,
dbl_ILLmatrix m,
double *  obj,
int  n 
) [static]

Definition at line 468 of file dbl_editor.c.

References dbl_colptr::coef, dbl_rawlpdata::cols, dbl_ILLlp_error(), dbl_ILLlp_warn(), dbl_ILLraw_colname(), ILL_FAILfalse, ILL_RESULT, ILL_SAFE_MALLOC, dbl_ILLmatrix::matbeg, dbl_ILLmatrix::matcnt, dbl_ILLmatrix::matcols, dbl_ILLmatrix::matind, dbl_ILLmatrix::matrows, dbl_ILLmatrix::matsize, dbl_ILLmatrix::matval, dbl_rawlpdata::ncols, dbl_colptr::next, dbl_rawlpdata::nrows, NULL, and dbl_colptr::this_val.

Referenced by dbl_add_col(), and dbl_add_row().

Here is the call graph for this function:

static char* dbl_get_row_col_name ( dbl_QSdata p,
dbl_rawlpdata lp,
dbl_ILLread_lp_state state,
int  doRow 
) [static]

Definition at line 429 of file dbl_editor.c.

References dbl_rawlpdata::coltab, dbl_ILL_BREAK_BODY_IF, dbl_ILL_UTIL_STR, dbl_ILLlib_findName(), dbl_ILLlp_error(), dbl_ILLread_constraint_name(), ILL_IFFREE, ILL_namebufsize, ILLsymboltab_lookup(), dbl_rawlpdata::ncols, dbl_rawlpdata::nrows, NULL, dbl_qsdata::qslp, and dbl_rawlpdata::rowtab.

Referenced by dbl_add_col(), and dbl_add_row().

Here is the call graph for this function:

static void dbl_getCmd ( dbl_ILLread_lp_state state,
int *  cmd,
int *  subcmd 
) [static]

Definition at line 165 of file dbl_editor.c.

References dbl_COL, dbl_commands, dbl_hasSubCmd, dbl_ILL_SWAP, dbl_ILLread_lp_state_next_field_on_line(), dbl_ILLutil_index(), dbl_ROW, dbl_SOLVE, dbl_ILLread_lp_state::field, and ILL_IFTRACE.

Referenced by dbl_ILLeditor().

Here is the call graph for this function:

void dbl_ILLeditor ( dbl_QSdata p  ) 

Definition at line 188 of file dbl_editor.c.

References dbl_ADD, dbl_add_col(), dbl_add_row(), dbl_COL, dbl_DEL, dbl_del_col(), dbl_del_row(), dbl_DUAL, dbl_getCmd(), dbl_ILL_BREAK_BODY, dbl_ILL_BREAK_BODY_IF, dbl_ILLeditor_help(), dbl_ILLeditor_solve(), dbl_ILLfree_rawlpdata(), dbl_ILLlib_print_x(), dbl_ILLline_reader_free(), dbl_ILLline_reader_new(), dbl_ILLread_lp_state_init(), dbl_ILLread_lp_state_next_field(), dbl_ILLread_lp_state_next_field_on_line(), dbl_ILLread_lp_state_next_line(), dbl_NONE, dbl_PLP, dbl_PMPS, dbl_PRIMAL, dbl_PRTX, dbl_pull_info_from_p(), dbl_QS_EXIT, dbl_QSwrite_prob(), dbl_QSwrite_prob_file(), dbl_ROW, dbl_SOLVE, DUAL_SIMPLEX, ILL_IFTRACE, dbl_qsdata::lp, and PRIMAL_SIMPLEX.

Here is the call graph for this function:

static void dbl_ILLeditor_help ( void   )  [static]

Definition at line 112 of file dbl_editor.c.

References dbl_ADD, dbl_COL, dbl_DEL, dbl_HELP, dbl_ILLeditor_help_cmd(), dbl_NONE, dbl_PLP, dbl_PMPS, dbl_PRTX, dbl_QS_EXIT, dbl_ROW, and dbl_SOLVE.

Referenced by dbl_ILLeditor().

Here is the call graph for this function:

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

Definition at line 128 of file dbl_editor.c.

References dbl_ADD, dbl_COL, dbl_commands, dbl_DEL, dbl_HELP, dbl_PLP, dbl_PMPS, dbl_PRTX, dbl_QS_EXIT, dbl_ROW, and dbl_SOLVE.

Referenced by dbl_ILLeditor_help().

void dbl_ILLeditor_init ( void   ) 

Definition at line 74 of file dbl_editor.c.

References dbl_ADD, dbl_COL, dbl_commands, dbl_DEL, dbl_DUAL, dbl_hasSubCmd, dbl_HELP, dbl_NCOMMAND, dbl_NEW, dbl_PLP, dbl_PMPS, dbl_PRIMAL, dbl_PRTX, dbl_QS_EXIT, dbl_ROW, dbl_SOLVE, and NULL.

int dbl_ILLeditor_solve ( dbl_QSdata p,
int  salgo 
)

Definition at line 324 of file dbl_editor.c.

References dbl_ILL_BREAK_BODY_IF, dbl_QSget_objval(), dbl_QSopt_dual(), dbl_QSopt_primal(), ILL_RESULT, PRIMAL_SIMPLEX, and dbl_qsdata::simplex_display.

Here is the call graph for this function:

static int dbl_pull_info_from_p ( dbl_QSdata p,
dbl_rawlpdata lp 
) [static]

Definition at line 357 of file dbl_editor.c.

References dbl_ILLlpdata::colnames, dbl_rawlpdata::coltab, dbl_ILL_BREAK_BODY_IF, dbl_ILLinit_rawlpdata(), dbl_ILLraw_add_col(), dbl_ILLraw_add_row(), ILL_FAILfalse, ILL_RETURN, ILLsymboltab_create(), dbl_ILLlpdata::intmarker, dbl_qsdata::lp, dbl_ILLlpdata::nrows, dbl_ILLlpdata::nstruct, NULL, dbl_lpinfo::O, dbl_ILLlpdata::objname, dbl_ILLlpdata::rhs, dbl_ILLlpdata::rownames, dbl_rawlpdata::rowtab, and dbl_ILLlpdata::sense.

Referenced by dbl_ILLeditor().

Here is the call graph for this function:

static int dbl_transpose ( dbl_rawlpdata lp  )  [static]

Definition at line 391 of file dbl_editor.c.

References dbl_rawlpdata::coltab, dbl_ILL_SWAP, ILL_RETURN, dbl_rawlpdata::ncols, dbl_rawlpdata::nrows, QSMAX, dbl_rawlpdata::rhs, dbl_rawlpdata::rhssize, dbl_rawlpdata::rowsense, dbl_rawlpdata::rowtab, and dbl_rawlpdata::sensesize.

Referenced by dbl_add_col().


Variable Documentation

const char* dbl_commands[dbl_NCOMMAND+1] [static]

Definition at line 71 of file dbl_editor.c.

Referenced by dbl_getCmd(), dbl_ILLeditor_help_cmd(), and dbl_ILLeditor_init().

char dbl_hasSubCmd[dbl_NCOMMAND+1] [static]

Definition at line 72 of file dbl_editor.c.

Referenced by dbl_getCmd(), and dbl_ILLeditor_init().

int TRACE = 0 [static]

Definition at line 41 of file dbl_editor.c.


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