ldbl_editor.c File Reference

#include "qs_config.h"
#include "ldbl_qsopt.h"
#include "ldbl_lpdata.h"
#include "ldbl_qstruct.h"
#include "ldbl_editor.h"
#include "ldbl_readline.h"
#include "ldbl_rawlp.h"
#include "stddefs.h"
#include "ldbl_read_lp.h"
#include "ldbl_lp.h"
#include "ldbl_lib.h"

Include dependency graph for ldbl_editor.c:

Go to the source code of this file.

Defines

#define ldbl_ADD   10
#define ldbl_COL   2
#define ldbl_DEL   8
#define ldbl_DUAL   12
#define ldbl_HELP   7
#define ldbl_ILL_BREAK_BODY   goto CLEANUP
#define ldbl_ILL_BREAK_BODY_IF(rval)   if (rval != 0) goto CLEANUP
#define ldbl_NCOMMAND   13
#define ldbl_NEW   9
#define ldbl_NONE   -1
#define ldbl_PLP   3
#define ldbl_PMPS   6
#define ldbl_PRIMAL   11
#define ldbl_PRTX   4
#define ldbl_QS_EXIT   0
#define ldbl_ROW   1
#define ldbl_SOLVE   5

Functions

static void ldbl_add_col (ldbl_QSdata *p, ldbl_rawlpdata *lp, ldbl_ILLread_lp_state *state)
static void ldbl_add_row (ldbl_QSdata *p, ldbl_rawlpdata *lp, ldbl_ILLread_lp_state *state)
static void ldbl_del_col (ldbl_QSdata *p, ldbl_rawlpdata *lp, ldbl_ILLread_lp_state *state)
static void ldbl_del_row (ldbl_QSdata *p, ldbl_rawlpdata *lp, ldbl_ILLread_lp_state *state)
static int ldbl_del_row_or_col (ldbl_QSdata *p, ldbl_rawlpdata *lp, ldbl_ILLread_lp_state *state, int isRow)
static int ldbl_fill_matrix (ldbl_rawlpdata *lp, ldbl_ILLread_lp_state *state, ldbl_ILLmatrix *m, long double *obj, int n)
static char * ldbl_get_row_col_name (ldbl_QSdata *p, ldbl_rawlpdata *lp, ldbl_ILLread_lp_state *state, int doRow)
static void ldbl_getCmd (ldbl_ILLread_lp_state *state, int *cmd, int *subcmd)
void ldbl_ILLeditor (ldbl_QSdata *p)
static void ldbl_ILLeditor_help (void)
static void ldbl_ILLeditor_help_cmd (int cmd, int subcmd)
void ldbl_ILLeditor_init (void)
int ldbl_ILLeditor_solve (ldbl_QSdata *p, int salgo)
static int ldbl_pull_info_from_p (ldbl_QSdata *p, ldbl_rawlpdata *lp)
static int ldbl_transpose (ldbl_rawlpdata *lp)

Variables

static const char * ldbl_commands [ldbl_NCOMMAND+1]
static char ldbl_hasSubCmd [ldbl_NCOMMAND+1]
static int TRACE = 0


Define Documentation

#define ldbl_ADD   10

Definition at line 67 of file ldbl_editor.c.

Referenced by ldbl_ILLeditor(), ldbl_ILLeditor_help(), ldbl_ILLeditor_help_cmd(), and ldbl_ILLeditor_init().

#define ldbl_COL   2

Definition at line 59 of file ldbl_editor.c.

Referenced by ldbl_getCmd(), ldbl_ILLeditor(), ldbl_ILLeditor_help(), ldbl_ILLeditor_help_cmd(), and ldbl_ILLeditor_init().

#define ldbl_DEL   8

Definition at line 65 of file ldbl_editor.c.

Referenced by ldbl_ILLeditor(), ldbl_ILLeditor_help(), ldbl_ILLeditor_help_cmd(), and ldbl_ILLeditor_init().

#define ldbl_DUAL   12

Definition at line 69 of file ldbl_editor.c.

Referenced by ldbl_ILLeditor(), and ldbl_ILLeditor_init().

#define ldbl_HELP   7

Definition at line 64 of file ldbl_editor.c.

Referenced by ldbl_ILLeditor_help(), ldbl_ILLeditor_help_cmd(), and ldbl_ILLeditor_init().

#define ldbl_ILL_BREAK_BODY   goto CLEANUP

Definition at line 44 of file ldbl_editor.c.

Referenced by ldbl_ILLeditor().

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

Definition at line 43 of file ldbl_editor.c.

Referenced by ldbl_add_col(), ldbl_add_row(), ldbl_del_row_or_col(), ldbl_get_row_col_name(), ldbl_ILLeditor(), ldbl_ILLeditor_solve(), and ldbl_pull_info_from_p().

#define ldbl_NCOMMAND   13

Definition at line 70 of file ldbl_editor.c.

Referenced by ldbl_ILLeditor_init().

#define ldbl_NEW   9

Definition at line 66 of file ldbl_editor.c.

Referenced by ldbl_ILLeditor_init().

#define ldbl_NONE   -1

Definition at line 56 of file ldbl_editor.c.

Referenced by ldbl_ILLeditor(), and ldbl_ILLeditor_help().

#define ldbl_PLP   3

Definition at line 60 of file ldbl_editor.c.

Referenced by ldbl_ILLeditor(), ldbl_ILLeditor_help(), ldbl_ILLeditor_help_cmd(), and ldbl_ILLeditor_init().

#define ldbl_PMPS   6

Definition at line 63 of file ldbl_editor.c.

Referenced by ldbl_ILLeditor(), ldbl_ILLeditor_help(), ldbl_ILLeditor_help_cmd(), and ldbl_ILLeditor_init().

#define ldbl_PRIMAL   11

Definition at line 68 of file ldbl_editor.c.

Referenced by ldbl_ILLeditor(), and ldbl_ILLeditor_init().

#define ldbl_PRTX   4

Definition at line 61 of file ldbl_editor.c.

Referenced by ldbl_ILLeditor(), ldbl_ILLeditor_help(), ldbl_ILLeditor_help_cmd(), and ldbl_ILLeditor_init().

#define ldbl_QS_EXIT   0

Definition at line 57 of file ldbl_editor.c.

Referenced by ldbl_ILLeditor(), ldbl_ILLeditor_help(), ldbl_ILLeditor_help_cmd(), and ldbl_ILLeditor_init().

#define ldbl_ROW   1

Definition at line 58 of file ldbl_editor.c.

Referenced by ldbl_getCmd(), ldbl_ILLeditor(), ldbl_ILLeditor_help(), ldbl_ILLeditor_help_cmd(), and ldbl_ILLeditor_init().

#define ldbl_SOLVE   5

Definition at line 62 of file ldbl_editor.c.

Referenced by ldbl_getCmd(), ldbl_ILLeditor(), ldbl_ILLeditor_help(), ldbl_ILLeditor_help_cmd(), and ldbl_ILLeditor_init().


Function Documentation

static void ldbl_add_col ( ldbl_QSdata p,
ldbl_rawlpdata lp,
ldbl_ILLread_lp_state state 
) [static]

Definition at line 594 of file ldbl_editor.c.

References ILL_FAILfalse, ILL_IFFREE, ILL_IFTRACE, ILLsymboltab_delete(), ldbl_fill_matrix(), ldbl_get_row_col_name(), ldbl_ILL_BREAK_BODY_IF, ldbl_ILLmatrix_free(), ldbl_ILLmatrix_init(), ldbl_ILLraw_clear_matrix(), ldbl_ILLread_lp_state_next_line(), ldbl_ILLread_lp_state_value(), ldbl_ILLread_one_constraint(), ldbl_QSadd_cols(), ldbl_transpose(), ldbl_ILLmatrix::matbeg, ldbl_ILLmatrix::matcnt, ldbl_ILLmatrix::matind, ldbl_ILLmatrix::matval, ldbl_rawlpdata::ncols, ldbl_rawlpdata::nrows, NULL, and ldbl_rawlpdata::rowtab.

Referenced by ldbl_ILLeditor(), and ldbl_read_mps_line_in_section().

Here is the call graph for this function:

static void ldbl_add_row ( ldbl_QSdata p,
ldbl_rawlpdata lp,
ldbl_ILLread_lp_state state 
) [static]

Definition at line 535 of file ldbl_editor.c.

References ILL_FAILfalse, ILL_IFFREE, ILL_IFTRACE, ILLsymboltab_delete(), ldbl_fill_matrix(), ldbl_get_row_col_name(), ldbl_ILL_BREAK_BODY_IF, ldbl_ILLmatrix_free(), ldbl_ILLmatrix_init(), ldbl_ILLraw_clear_matrix(), ldbl_ILLread_one_constraint(), ldbl_QSadd_rows(), ldbl_ILLmatrix::matbeg, ldbl_ILLmatrix::matcnt, ldbl_ILLmatrix::matind, ldbl_ILLmatrix::matval, ldbl_rawlpdata::nrows, NULL, ldbl_rawlpdata::rhs, ldbl_rawlpdata::rowsense, and ldbl_rawlpdata::rowtab.

Referenced by ldbl_ILLeditor(), and ldbl_read_mps_line_in_section().

Here is the call graph for this function:

static void ldbl_del_col ( ldbl_QSdata p,
ldbl_rawlpdata lp,
ldbl_ILLread_lp_state state 
) [static]

Definition at line 769 of file ldbl_editor.c.

References ldbl_del_row_or_col(), and ldbl_rawlpdata::ncols.

Referenced by ldbl_ILLeditor().

Here is the call graph for this function:

static void ldbl_del_row ( ldbl_QSdata p,
ldbl_rawlpdata lp,
ldbl_ILLread_lp_state state 
) [static]

Definition at line 756 of file ldbl_editor.c.

References ldbl_del_row_or_col(), and ldbl_rawlpdata::nrows.

Referenced by ldbl_ILLeditor().

Here is the call graph for this function:

static int ldbl_del_row_or_col ( ldbl_QSdata p,
ldbl_rawlpdata lp,
ldbl_ILLread_lp_state state,
int  isRow 
) [static]

Definition at line 724 of file ldbl_editor.c.

References ldbl_ILLlpdata::colnames, ldbl_rawlpdata::coltab, ldbl_ILLread_lp_state::field, ILL_RESULT, ILLsymboltab_delete(), ldbl_ILL_BREAK_BODY_IF, ldbl_ILLlp_error(), ldbl_ILLread_lp_state_next_field_on_line(), ldbl_ILLutil_array_index(), ldbl_QSdelete_cols(), ldbl_QSdelete_rows(), ldbl_ILLlpdata::nrows, ldbl_ILLlpdata::nstruct, ldbl_qsdata::qslp, ldbl_ILLlpdata::rownames, and ldbl_rawlpdata::rowtab.

Referenced by ldbl_del_col(), and ldbl_del_row().

Here is the call graph for this function:

static int ldbl_fill_matrix ( ldbl_rawlpdata lp,
ldbl_ILLread_lp_state state,
ldbl_ILLmatrix m,
long double *  obj,
int  n 
) [static]

Definition at line 468 of file ldbl_editor.c.

References ldbl_colptr::coef, ldbl_rawlpdata::cols, ILL_FAILfalse, ILL_RESULT, ILL_SAFE_MALLOC, ldbl_ILLlp_error(), ldbl_ILLlp_warn(), ldbl_ILLraw_colname(), ldbl_ILLmatrix::matbeg, ldbl_ILLmatrix::matcnt, ldbl_ILLmatrix::matcols, ldbl_ILLmatrix::matind, ldbl_ILLmatrix::matrows, ldbl_ILLmatrix::matsize, ldbl_ILLmatrix::matval, ldbl_rawlpdata::ncols, ldbl_colptr::next, ldbl_rawlpdata::nrows, NULL, and ldbl_colptr::this_val.

Referenced by ldbl_add_col(), and ldbl_add_row().

Here is the call graph for this function:

static char* ldbl_get_row_col_name ( ldbl_QSdata p,
ldbl_rawlpdata lp,
ldbl_ILLread_lp_state state,
int  doRow 
) [static]

Definition at line 429 of file ldbl_editor.c.

References ldbl_rawlpdata::coltab, ILL_IFFREE, ILL_namebufsize, ILLsymboltab_lookup(), ldbl_ILL_BREAK_BODY_IF, ldbl_ILLlib_findName(), ldbl_ILLlp_error(), ldbl_ILLread_constraint_name(), ldbl_rawlpdata::ncols, ldbl_rawlpdata::nrows, NULL, ldbl_qsdata::qslp, and ldbl_rawlpdata::rowtab.

Referenced by ldbl_add_col(), and ldbl_add_row().

Here is the call graph for this function:

static void ldbl_getCmd ( ldbl_ILLread_lp_state state,
int *  cmd,
int *  subcmd 
) [static]

Definition at line 165 of file ldbl_editor.c.

References ldbl_ILLread_lp_state::field, ILL_IFTRACE, ldbl_COL, ldbl_commands, ldbl_hasSubCmd, ldbl_ILLread_lp_state_next_field_on_line(), ldbl_ILLutil_index(), ldbl_ROW, and ldbl_SOLVE.

Referenced by ldbl_ILLeditor().

Here is the call graph for this function:

void ldbl_ILLeditor ( ldbl_QSdata p  ) 

Definition at line 188 of file ldbl_editor.c.

References DUAL_SIMPLEX, ILL_IFTRACE, ldbl_ADD, ldbl_add_col(), ldbl_add_row(), ldbl_COL, ldbl_DEL, ldbl_del_col(), ldbl_del_row(), ldbl_DUAL, ldbl_getCmd(), ldbl_ILL_BREAK_BODY, ldbl_ILL_BREAK_BODY_IF, ldbl_ILLeditor_help(), ldbl_ILLeditor_solve(), ldbl_ILLfree_rawlpdata(), ldbl_ILLlib_print_x(), ldbl_ILLline_reader_free(), ldbl_ILLline_reader_new(), ldbl_ILLread_lp_state_init(), ldbl_ILLread_lp_state_next_field(), ldbl_ILLread_lp_state_next_field_on_line(), ldbl_ILLread_lp_state_next_line(), ldbl_NONE, ldbl_PLP, ldbl_PMPS, ldbl_PRIMAL, ldbl_PRTX, ldbl_pull_info_from_p(), ldbl_QS_EXIT, ldbl_QSwrite_prob(), ldbl_QSwrite_prob_file(), ldbl_ROW, ldbl_SOLVE, ldbl_qsdata::lp, and PRIMAL_SIMPLEX.

Referenced by ldbl_solver_main().

Here is the call graph for this function:

static void ldbl_ILLeditor_help ( void   )  [static]

Definition at line 112 of file ldbl_editor.c.

References ldbl_ADD, ldbl_COL, ldbl_DEL, ldbl_HELP, ldbl_ILLeditor_help_cmd(), ldbl_NONE, ldbl_PLP, ldbl_PMPS, ldbl_PRTX, ldbl_QS_EXIT, ldbl_ROW, and ldbl_SOLVE.

Referenced by ldbl_ILLeditor().

Here is the call graph for this function:

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

Definition at line 128 of file ldbl_editor.c.

References ldbl_ADD, ldbl_COL, ldbl_commands, ldbl_DEL, ldbl_HELP, ldbl_PLP, ldbl_PMPS, ldbl_PRTX, ldbl_QS_EXIT, ldbl_ROW, and ldbl_SOLVE.

Referenced by ldbl_ILLeditor_help().

void ldbl_ILLeditor_init ( void   ) 

Definition at line 74 of file ldbl_editor.c.

References ldbl_ADD, ldbl_COL, ldbl_commands, ldbl_DEL, ldbl_DUAL, ldbl_hasSubCmd, ldbl_HELP, ldbl_NCOMMAND, ldbl_NEW, ldbl_PLP, ldbl_PMPS, ldbl_PRIMAL, ldbl_PRTX, ldbl_QS_EXIT, ldbl_ROW, ldbl_SOLVE, and NULL.

Referenced by ldbl_solver_main().

int ldbl_ILLeditor_solve ( ldbl_QSdata p,
int  salgo 
)

Definition at line 324 of file ldbl_editor.c.

References ILL_RESULT, ldbl_ILL_BREAK_BODY_IF, ldbl_QSget_objval(), ldbl_QSopt_dual(), ldbl_QSopt_primal(), PRIMAL_SIMPLEX, and ldbl_qsdata::simplex_display.

Referenced by ldbl_ILLeditor(), and ldbl_solver_main().

Here is the call graph for this function:

static int ldbl_pull_info_from_p ( ldbl_QSdata p,
ldbl_rawlpdata lp 
) [static]

Definition at line 357 of file ldbl_editor.c.

References ldbl_ILLlpdata::colnames, ldbl_rawlpdata::coltab, ILL_FAILfalse, ILL_RETURN, ILLsymboltab_create(), ldbl_ILLlpdata::intmarker, ldbl_ILL_BREAK_BODY_IF, ldbl_ILLinit_rawlpdata(), ldbl_ILLraw_add_col(), ldbl_ILLraw_add_row(), ldbl_qsdata::lp, ldbl_ILLlpdata::nrows, ldbl_ILLlpdata::nstruct, NULL, ldbl_lpinfo::O, ldbl_ILLlpdata::objname, ldbl_ILLlpdata::rhs, ldbl_ILLlpdata::rownames, ldbl_rawlpdata::rowtab, and ldbl_ILLlpdata::sense.

Referenced by ldbl_ILLeditor().

Here is the call graph for this function:

static int ldbl_transpose ( ldbl_rawlpdata lp  )  [static]

Definition at line 391 of file ldbl_editor.c.

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

Referenced by ldbl_add_col().


Variable Documentation

const char* ldbl_commands[ldbl_NCOMMAND+1] [static]

Definition at line 71 of file ldbl_editor.c.

Referenced by ldbl_getCmd(), ldbl_ILLeditor_help_cmd(), and ldbl_ILLeditor_init().

char ldbl_hasSubCmd[ldbl_NCOMMAND+1] [static]

Definition at line 72 of file ldbl_editor.c.

Referenced by ldbl_getCmd(), and ldbl_ILLeditor_init().

int TRACE = 0 [static]

Definition at line 41 of file ldbl_editor.c.


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