mpq_editor.c File Reference

#include "qs_config.h"
#include "mpq_qsopt.h"
#include "mpq_lpdata.h"
#include "mpq_qstruct.h"
#include "mpq_editor.h"
#include "mpq_readline.h"
#include "mpq_rawlp.h"
#include "stddefs.h"
#include "mpq_read_lp.h"
#include "mpq_lp.h"
#include "mpq_lib.h"

Include dependency graph for mpq_editor.c:

Go to the source code of this file.

Defines

#define mpq_ADD   10
#define mpq_COL   2
#define mpq_DEL   8
#define mpq_DUAL   12
#define mpq_HELP   7
#define mpq_ILL_BREAK_BODY   goto CLEANUP
#define mpq_ILL_BREAK_BODY_IF(rval)   if (rval != 0) goto CLEANUP
#define mpq_NCOMMAND   13
#define mpq_NEW   9
#define mpq_NONE   -1
#define mpq_PLP   3
#define mpq_PMPS   6
#define mpq_PRIMAL   11
#define mpq_PRTX   4
#define mpq_QS_EXIT   0
#define mpq_ROW   1
#define mpq_SOLVE   5

Functions

static void mpq_add_col (mpq_QSdata *p, mpq_rawlpdata *lp, mpq_ILLread_lp_state *state)
static void mpq_add_row (mpq_QSdata *p, mpq_rawlpdata *lp, mpq_ILLread_lp_state *state)
static void mpq_del_col (mpq_QSdata *p, mpq_rawlpdata *lp, mpq_ILLread_lp_state *state)
static void mpq_del_row (mpq_QSdata *p, mpq_rawlpdata *lp, mpq_ILLread_lp_state *state)
static int mpq_del_row_or_col (mpq_QSdata *p, mpq_rawlpdata *lp, mpq_ILLread_lp_state *state, int isRow)
static int mpq_fill_matrix (mpq_rawlpdata *lp, mpq_ILLread_lp_state *state, mpq_ILLmatrix *m, mpq_t *obj, int n)
static char * mpq_get_row_col_name (mpq_QSdata *p, mpq_rawlpdata *lp, mpq_ILLread_lp_state *state, int doRow)
static void mpq_getCmd (mpq_ILLread_lp_state *state, int *cmd, int *subcmd)
void mpq_ILLeditor (mpq_QSdata *p)
static void mpq_ILLeditor_help (void)
static void mpq_ILLeditor_help_cmd (int cmd, int subcmd)
void mpq_ILLeditor_init (void)
int mpq_ILLeditor_solve (mpq_QSdata *p, int salgo)
static int mpq_pull_info_from_p (mpq_QSdata *p, mpq_rawlpdata *lp)
static int mpq_transpose (mpq_rawlpdata *lp)

Variables

static const char * mpq_commands [mpq_NCOMMAND+1]
static char mpq_hasSubCmd [mpq_NCOMMAND+1]
static int TRACE = 0


Define Documentation

#define mpq_ADD   10

Definition at line 67 of file mpq_editor.c.

Referenced by mpq_ILLeditor(), mpq_ILLeditor_help(), mpq_ILLeditor_help_cmd(), and mpq_ILLeditor_init().

#define mpq_COL   2

Definition at line 59 of file mpq_editor.c.

Referenced by mpq_getCmd(), mpq_ILLeditor(), mpq_ILLeditor_help(), mpq_ILLeditor_help_cmd(), and mpq_ILLeditor_init().

#define mpq_DEL   8

Definition at line 65 of file mpq_editor.c.

Referenced by mpq_ILLeditor(), mpq_ILLeditor_help(), mpq_ILLeditor_help_cmd(), and mpq_ILLeditor_init().

#define mpq_DUAL   12

Definition at line 69 of file mpq_editor.c.

Referenced by mpq_ILLeditor(), and mpq_ILLeditor_init().

#define mpq_HELP   7

Definition at line 64 of file mpq_editor.c.

Referenced by mpq_ILLeditor_help(), mpq_ILLeditor_help_cmd(), and mpq_ILLeditor_init().

#define mpq_ILL_BREAK_BODY   goto CLEANUP

Definition at line 44 of file mpq_editor.c.

Referenced by mpq_ILLeditor().

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

Definition at line 43 of file mpq_editor.c.

Referenced by mpq_add_col(), mpq_add_row(), mpq_del_row_or_col(), mpq_get_row_col_name(), mpq_ILLeditor(), mpq_ILLeditor_solve(), and mpq_pull_info_from_p().

#define mpq_NCOMMAND   13

Definition at line 70 of file mpq_editor.c.

Referenced by mpq_ILLeditor_init().

#define mpq_NEW   9

Definition at line 66 of file mpq_editor.c.

Referenced by mpq_ILLeditor_init().

#define mpq_NONE   -1

Definition at line 56 of file mpq_editor.c.

Referenced by mpq_ILLeditor(), and mpq_ILLeditor_help().

#define mpq_PLP   3

Definition at line 60 of file mpq_editor.c.

Referenced by mpq_ILLeditor(), mpq_ILLeditor_help(), mpq_ILLeditor_help_cmd(), and mpq_ILLeditor_init().

#define mpq_PMPS   6

Definition at line 63 of file mpq_editor.c.

Referenced by mpq_ILLeditor(), mpq_ILLeditor_help(), mpq_ILLeditor_help_cmd(), and mpq_ILLeditor_init().

#define mpq_PRIMAL   11

Definition at line 68 of file mpq_editor.c.

Referenced by mpq_ILLeditor(), and mpq_ILLeditor_init().

#define mpq_PRTX   4

Definition at line 61 of file mpq_editor.c.

Referenced by mpq_ILLeditor(), mpq_ILLeditor_help(), mpq_ILLeditor_help_cmd(), and mpq_ILLeditor_init().

#define mpq_QS_EXIT   0

Definition at line 57 of file mpq_editor.c.

Referenced by mpq_ILLeditor(), mpq_ILLeditor_help(), mpq_ILLeditor_help_cmd(), and mpq_ILLeditor_init().

#define mpq_ROW   1

Definition at line 58 of file mpq_editor.c.

Referenced by mpq_getCmd(), mpq_ILLeditor(), mpq_ILLeditor_help(), mpq_ILLeditor_help_cmd(), and mpq_ILLeditor_init().

#define mpq_SOLVE   5

Definition at line 62 of file mpq_editor.c.

Referenced by mpq_getCmd(), mpq_ILLeditor(), mpq_ILLeditor_help(), mpq_ILLeditor_help_cmd(), and mpq_ILLeditor_init().


Function Documentation

static void mpq_add_col ( mpq_QSdata p,
mpq_rawlpdata lp,
mpq_ILLread_lp_state state 
) [static]

Definition at line 594 of file mpq_editor.c.

References ILL_FAILfalse, ILL_IFFREE, ILL_IFTRACE, ILLsymboltab_delete(), mpq_ILLmatrix::matbeg, mpq_ILLmatrix::matcnt, mpq_ILLmatrix::matind, mpq_ILLmatrix::matval, mpq_fill_matrix(), mpq_get_row_col_name(), mpq_ILL_BREAK_BODY_IF, mpq_ILLmatrix_free(), mpq_ILLmatrix_init(), mpq_ILLraw_clear_matrix(), mpq_ILLread_lp_state_next_line(), mpq_ILLread_lp_state_value(), mpq_ILLread_one_constraint(), mpq_QSadd_cols(), mpq_transpose(), mpq_rawlpdata::ncols, mpq_rawlpdata::nrows, NULL, and mpq_rawlpdata::rowtab.

Referenced by mpq_ILLeditor(), and mpq_read_mps_line_in_section().

Here is the call graph for this function:

static void mpq_add_row ( mpq_QSdata p,
mpq_rawlpdata lp,
mpq_ILLread_lp_state state 
) [static]

Definition at line 535 of file mpq_editor.c.

References ILL_FAILfalse, ILL_IFFREE, ILL_IFTRACE, ILLsymboltab_delete(), mpq_ILLmatrix::matbeg, mpq_ILLmatrix::matcnt, mpq_ILLmatrix::matind, mpq_ILLmatrix::matval, mpq_fill_matrix(), mpq_get_row_col_name(), mpq_ILL_BREAK_BODY_IF, mpq_ILLmatrix_free(), mpq_ILLmatrix_init(), mpq_ILLraw_clear_matrix(), mpq_ILLread_one_constraint(), mpq_QSadd_rows(), mpq_rawlpdata::nrows, NULL, mpq_rawlpdata::rhs, mpq_rawlpdata::rowsense, and mpq_rawlpdata::rowtab.

Referenced by mpq_ILLeditor(), and mpq_read_mps_line_in_section().

Here is the call graph for this function:

static void mpq_del_col ( mpq_QSdata p,
mpq_rawlpdata lp,
mpq_ILLread_lp_state state 
) [static]

Definition at line 769 of file mpq_editor.c.

References mpq_del_row_or_col(), and mpq_rawlpdata::ncols.

Referenced by mpq_ILLeditor().

Here is the call graph for this function:

static void mpq_del_row ( mpq_QSdata p,
mpq_rawlpdata lp,
mpq_ILLread_lp_state state 
) [static]

Definition at line 756 of file mpq_editor.c.

References mpq_del_row_or_col(), and mpq_rawlpdata::nrows.

Referenced by mpq_ILLeditor().

Here is the call graph for this function:

static int mpq_del_row_or_col ( mpq_QSdata p,
mpq_rawlpdata lp,
mpq_ILLread_lp_state state,
int  isRow 
) [static]

Definition at line 724 of file mpq_editor.c.

References mpq_ILLlpdata::colnames, mpq_rawlpdata::coltab, mpq_ILLread_lp_state::field, ILL_RESULT, ILLsymboltab_delete(), mpq_ILL_BREAK_BODY_IF, mpq_ILLlp_error(), mpq_ILLread_lp_state_next_field_on_line(), mpq_ILLutil_array_index(), mpq_QSdelete_cols(), mpq_QSdelete_rows(), mpq_ILLlpdata::nrows, mpq_ILLlpdata::nstruct, mpq_qsdata::qslp, mpq_ILLlpdata::rownames, and mpq_rawlpdata::rowtab.

Referenced by mpq_del_col(), and mpq_del_row().

Here is the call graph for this function:

static int mpq_fill_matrix ( mpq_rawlpdata lp,
mpq_ILLread_lp_state state,
mpq_ILLmatrix m,
mpq_t *  obj,
int  n 
) [static]

Definition at line 468 of file mpq_editor.c.

References mpq_colptr::coef, mpq_rawlpdata::cols, ILL_FAILfalse, ILL_RESULT, ILL_SAFE_MALLOC, mpq_ILLmatrix::matbeg, mpq_ILLmatrix::matcnt, mpq_ILLmatrix::matcols, mpq_ILLmatrix::matind, mpq_ILLmatrix::matrows, mpq_ILLmatrix::matsize, mpq_ILLmatrix::matval, mpq_ILLlp_error(), mpq_ILLlp_warn(), mpq_ILLraw_colname(), mpq_rawlpdata::ncols, mpq_colptr::next, mpq_rawlpdata::nrows, NULL, and mpq_colptr::this_val.

Referenced by mpq_add_col(), and mpq_add_row().

Here is the call graph for this function:

static char* mpq_get_row_col_name ( mpq_QSdata p,
mpq_rawlpdata lp,
mpq_ILLread_lp_state state,
int  doRow 
) [static]

Definition at line 429 of file mpq_editor.c.

References mpq_rawlpdata::coltab, ILL_IFFREE, ILL_namebufsize, ILLsymboltab_lookup(), mpq_ILL_BREAK_BODY_IF, mpq_ILLlib_findName(), mpq_ILLlp_error(), mpq_ILLread_constraint_name(), mpq_rawlpdata::ncols, mpq_rawlpdata::nrows, NULL, mpq_qsdata::qslp, and mpq_rawlpdata::rowtab.

Referenced by mpq_add_col(), and mpq_add_row().

Here is the call graph for this function:

static void mpq_getCmd ( mpq_ILLread_lp_state state,
int *  cmd,
int *  subcmd 
) [static]

Definition at line 165 of file mpq_editor.c.

References mpq_ILLread_lp_state::field, ILL_IFTRACE, mpq_COL, mpq_commands, mpq_hasSubCmd, mpq_ILLread_lp_state_next_field_on_line(), mpq_ILLutil_index(), mpq_ROW, and mpq_SOLVE.

Referenced by mpq_ILLeditor().

Here is the call graph for this function:

void mpq_ILLeditor ( mpq_QSdata p  ) 

Definition at line 188 of file mpq_editor.c.

References DUAL_SIMPLEX, ILL_IFTRACE, mpq_qsdata::lp, mpq_ADD, mpq_add_col(), mpq_add_row(), mpq_COL, mpq_DEL, mpq_del_col(), mpq_del_row(), mpq_DUAL, mpq_getCmd(), mpq_ILL_BREAK_BODY, mpq_ILL_BREAK_BODY_IF, mpq_ILLeditor_help(), mpq_ILLeditor_solve(), mpq_ILLfree_rawlpdata(), mpq_ILLlib_print_x(), mpq_ILLline_reader_free(), mpq_ILLline_reader_new(), mpq_ILLread_lp_state_init(), mpq_ILLread_lp_state_next_field(), mpq_ILLread_lp_state_next_field_on_line(), mpq_ILLread_lp_state_next_line(), mpq_NONE, mpq_PLP, mpq_PMPS, mpq_PRIMAL, mpq_PRTX, mpq_pull_info_from_p(), mpq_QS_EXIT, mpq_QSwrite_prob(), mpq_QSwrite_prob_file(), mpq_ROW, mpq_SOLVE, and PRIMAL_SIMPLEX.

Referenced by mpq_solver_main().

Here is the call graph for this function:

static void mpq_ILLeditor_help ( void   )  [static]

Definition at line 112 of file mpq_editor.c.

References mpq_ADD, mpq_COL, mpq_DEL, mpq_HELP, mpq_ILLeditor_help_cmd(), mpq_NONE, mpq_PLP, mpq_PMPS, mpq_PRTX, mpq_QS_EXIT, mpq_ROW, and mpq_SOLVE.

Referenced by mpq_ILLeditor().

Here is the call graph for this function:

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

Definition at line 128 of file mpq_editor.c.

References mpq_ADD, mpq_COL, mpq_commands, mpq_DEL, mpq_HELP, mpq_PLP, mpq_PMPS, mpq_PRTX, mpq_QS_EXIT, mpq_ROW, and mpq_SOLVE.

Referenced by mpq_ILLeditor_help().

void mpq_ILLeditor_init ( void   ) 

Definition at line 74 of file mpq_editor.c.

References mpq_ADD, mpq_COL, mpq_commands, mpq_DEL, mpq_DUAL, mpq_hasSubCmd, mpq_HELP, mpq_NCOMMAND, mpq_NEW, mpq_PLP, mpq_PMPS, mpq_PRIMAL, mpq_PRTX, mpq_QS_EXIT, mpq_ROW, mpq_SOLVE, and NULL.

Referenced by mpq_solver_main().

int mpq_ILLeditor_solve ( mpq_QSdata p,
int  salgo 
)

Definition at line 324 of file mpq_editor.c.

References ILL_RESULT, mpq_ILL_BREAK_BODY_IF, mpq_QSget_objval(), mpq_QSopt_dual(), mpq_QSopt_primal(), PRIMAL_SIMPLEX, and mpq_qsdata::simplex_display.

Referenced by mpq_ILLeditor(), mpq_solver_main(), and QSexact_solver().

Here is the call graph for this function:

static int mpq_pull_info_from_p ( mpq_QSdata p,
mpq_rawlpdata lp 
) [static]

Definition at line 357 of file mpq_editor.c.

References mpq_ILLlpdata::colnames, mpq_rawlpdata::coltab, ILL_FAILfalse, ILL_RETURN, ILLsymboltab_create(), mpq_ILLlpdata::intmarker, mpq_qsdata::lp, mpq_ILL_BREAK_BODY_IF, mpq_ILLinit_rawlpdata(), mpq_ILLraw_add_col(), mpq_ILLraw_add_row(), mpq_ILLlpdata::nrows, mpq_ILLlpdata::nstruct, NULL, mpq_lpinfo::O, mpq_ILLlpdata::objname, mpq_ILLlpdata::rhs, mpq_ILLlpdata::rownames, mpq_rawlpdata::rowtab, and mpq_ILLlpdata::sense.

Referenced by mpq_ILLeditor().

Here is the call graph for this function:

static int mpq_transpose ( mpq_rawlpdata lp  )  [static]

Definition at line 391 of file mpq_editor.c.

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

Referenced by mpq_add_col().


Variable Documentation

const char* mpq_commands[mpq_NCOMMAND+1] [static]

Definition at line 71 of file mpq_editor.c.

Referenced by mpq_getCmd(), mpq_ILLeditor_help_cmd(), and mpq_ILLeditor_init().

char mpq_hasSubCmd[mpq_NCOMMAND+1] [static]

Definition at line 72 of file mpq_editor.c.

Referenced by mpq_getCmd(), and mpq_ILLeditor_init().

int TRACE = 0 [static]

Definition at line 41 of file mpq_editor.c.


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