#include "qs_config.h"
#include "mpf_qsopt.h"
#include "mpf_lpdata.h"
#include "mpf_qstruct.h"
#include "mpf_editor.h"
#include "mpf_readline.h"
#include "mpf_rawlp.h"
#include "stddefs.h"
#include "mpf_read_lp.h"
#include "mpf_lp.h"
#include "mpf_lib.h"
Include dependency graph for mpf_editor.c:

Go to the source code of this file.
Defines | |
| #define | mpf_ADD 10 |
| #define | mpf_COL 2 |
| #define | mpf_DEL 8 |
| #define | mpf_DUAL 12 |
| #define | mpf_HELP 7 |
| #define | mpf_ILL_BREAK_BODY goto CLEANUP |
| #define | mpf_ILL_BREAK_BODY_IF(rval) if (rval != 0) goto CLEANUP |
| #define | mpf_NCOMMAND 13 |
| #define | mpf_NEW 9 |
| #define | mpf_NONE -1 |
| #define | mpf_PLP 3 |
| #define | mpf_PMPS 6 |
| #define | mpf_PRIMAL 11 |
| #define | mpf_PRTX 4 |
| #define | mpf_QS_EXIT 0 |
| #define | mpf_ROW 1 |
| #define | mpf_SOLVE 5 |
Functions | |
| static void | mpf_add_col (mpf_QSdata *p, mpf_rawlpdata *lp, mpf_ILLread_lp_state *state) |
| static void | mpf_add_row (mpf_QSdata *p, mpf_rawlpdata *lp, mpf_ILLread_lp_state *state) |
| static void | mpf_del_col (mpf_QSdata *p, mpf_rawlpdata *lp, mpf_ILLread_lp_state *state) |
| static void | mpf_del_row (mpf_QSdata *p, mpf_rawlpdata *lp, mpf_ILLread_lp_state *state) |
| static int | mpf_del_row_or_col (mpf_QSdata *p, mpf_rawlpdata *lp, mpf_ILLread_lp_state *state, int isRow) |
| static int | mpf_fill_matrix (mpf_rawlpdata *lp, mpf_ILLread_lp_state *state, mpf_ILLmatrix *m, mpf_t *obj, int n) |
| static char * | mpf_get_row_col_name (mpf_QSdata *p, mpf_rawlpdata *lp, mpf_ILLread_lp_state *state, int doRow) |
| static void | mpf_getCmd (mpf_ILLread_lp_state *state, int *cmd, int *subcmd) |
| void | mpf_ILLeditor (mpf_QSdata *p) |
| static void | mpf_ILLeditor_help (void) |
| static void | mpf_ILLeditor_help_cmd (int cmd, int subcmd) |
| void | mpf_ILLeditor_init (void) |
| int | mpf_ILLeditor_solve (mpf_QSdata *p, int salgo) |
| static int | mpf_pull_info_from_p (mpf_QSdata *p, mpf_rawlpdata *lp) |
| static int | mpf_transpose (mpf_rawlpdata *lp) |
Variables | |
| static const char * | mpf_commands [mpf_NCOMMAND+1] |
| static char | mpf_hasSubCmd [mpf_NCOMMAND+1] |
| static int | TRACE = 0 |
| #define mpf_ADD 10 |
Definition at line 67 of file mpf_editor.c.
Referenced by mpf_ILLeditor(), mpf_ILLeditor_help(), mpf_ILLeditor_help_cmd(), and mpf_ILLeditor_init().
| #define mpf_COL 2 |
Definition at line 59 of file mpf_editor.c.
Referenced by mpf_getCmd(), mpf_ILLeditor(), mpf_ILLeditor_help(), mpf_ILLeditor_help_cmd(), and mpf_ILLeditor_init().
| #define mpf_DEL 8 |
Definition at line 65 of file mpf_editor.c.
Referenced by mpf_ILLeditor(), mpf_ILLeditor_help(), mpf_ILLeditor_help_cmd(), and mpf_ILLeditor_init().
| #define mpf_DUAL 12 |
Definition at line 69 of file mpf_editor.c.
Referenced by mpf_ILLeditor(), and mpf_ILLeditor_init().
| #define mpf_HELP 7 |
Definition at line 64 of file mpf_editor.c.
Referenced by mpf_ILLeditor_help(), mpf_ILLeditor_help_cmd(), and mpf_ILLeditor_init().
| #define mpf_ILL_BREAK_BODY goto CLEANUP |
| #define mpf_ILL_BREAK_BODY_IF | ( | rval | ) | if (rval != 0) goto CLEANUP |
Definition at line 43 of file mpf_editor.c.
Referenced by mpf_add_col(), mpf_add_row(), mpf_del_row_or_col(), mpf_get_row_col_name(), mpf_ILLeditor(), mpf_ILLeditor_solve(), and mpf_pull_info_from_p().
| #define mpf_NCOMMAND 13 |
| #define mpf_NEW 9 |
| #define mpf_NONE -1 |
Definition at line 56 of file mpf_editor.c.
Referenced by mpf_ILLeditor(), and mpf_ILLeditor_help().
| #define mpf_PLP 3 |
Definition at line 60 of file mpf_editor.c.
Referenced by mpf_ILLeditor(), mpf_ILLeditor_help(), mpf_ILLeditor_help_cmd(), and mpf_ILLeditor_init().
| #define mpf_PMPS 6 |
Definition at line 63 of file mpf_editor.c.
Referenced by mpf_ILLeditor(), mpf_ILLeditor_help(), mpf_ILLeditor_help_cmd(), and mpf_ILLeditor_init().
| #define mpf_PRIMAL 11 |
Definition at line 68 of file mpf_editor.c.
Referenced by mpf_ILLeditor(), and mpf_ILLeditor_init().
| #define mpf_PRTX 4 |
Definition at line 61 of file mpf_editor.c.
Referenced by mpf_ILLeditor(), mpf_ILLeditor_help(), mpf_ILLeditor_help_cmd(), and mpf_ILLeditor_init().
| #define mpf_QS_EXIT 0 |
Definition at line 57 of file mpf_editor.c.
Referenced by mpf_ILLeditor(), mpf_ILLeditor_help(), mpf_ILLeditor_help_cmd(), and mpf_ILLeditor_init().
| #define mpf_ROW 1 |
Definition at line 58 of file mpf_editor.c.
Referenced by mpf_getCmd(), mpf_ILLeditor(), mpf_ILLeditor_help(), mpf_ILLeditor_help_cmd(), and mpf_ILLeditor_init().
| #define mpf_SOLVE 5 |
Definition at line 62 of file mpf_editor.c.
Referenced by mpf_getCmd(), mpf_ILLeditor(), mpf_ILLeditor_help(), mpf_ILLeditor_help_cmd(), and mpf_ILLeditor_init().
| static void mpf_add_col | ( | mpf_QSdata * | p, | |
| mpf_rawlpdata * | lp, | |||
| mpf_ILLread_lp_state * | state | |||
| ) | [static] |
Definition at line 594 of file mpf_editor.c.
References ILL_FAILfalse, ILL_IFFREE, ILL_IFTRACE, ILLsymboltab_delete(), mpf_ILLmatrix::matbeg, mpf_ILLmatrix::matcnt, mpf_ILLmatrix::matind, mpf_ILLmatrix::matval, mpf_fill_matrix(), mpf_get_row_col_name(), mpf_ILL_BREAK_BODY_IF, mpf_ILLmatrix_free(), mpf_ILLmatrix_init(), mpf_ILLraw_clear_matrix(), mpf_ILLread_lp_state_next_line(), mpf_ILLread_lp_state_value(), mpf_ILLread_one_constraint(), mpf_QSadd_cols(), mpf_transpose(), mpf_rawlpdata::ncols, mpf_rawlpdata::nrows, NULL, and mpf_rawlpdata::rowtab.
Referenced by mpf_ILLeditor(), and mpf_read_mps_line_in_section().
Here is the call graph for this function:

| static void mpf_add_row | ( | mpf_QSdata * | p, | |
| mpf_rawlpdata * | lp, | |||
| mpf_ILLread_lp_state * | state | |||
| ) | [static] |
Definition at line 535 of file mpf_editor.c.
References ILL_FAILfalse, ILL_IFFREE, ILL_IFTRACE, ILLsymboltab_delete(), mpf_ILLmatrix::matbeg, mpf_ILLmatrix::matcnt, mpf_ILLmatrix::matind, mpf_ILLmatrix::matval, mpf_fill_matrix(), mpf_get_row_col_name(), mpf_ILL_BREAK_BODY_IF, mpf_ILLmatrix_free(), mpf_ILLmatrix_init(), mpf_ILLraw_clear_matrix(), mpf_ILLread_one_constraint(), mpf_QSadd_rows(), mpf_rawlpdata::nrows, NULL, mpf_rawlpdata::rhs, mpf_rawlpdata::rowsense, and mpf_rawlpdata::rowtab.
Referenced by mpf_ILLeditor(), and mpf_read_mps_line_in_section().
Here is the call graph for this function:

| static void mpf_del_col | ( | mpf_QSdata * | p, | |
| mpf_rawlpdata * | lp, | |||
| mpf_ILLread_lp_state * | state | |||
| ) | [static] |
Definition at line 769 of file mpf_editor.c.
References mpf_del_row_or_col(), and mpf_rawlpdata::ncols.
Referenced by mpf_ILLeditor().
Here is the call graph for this function:

| static void mpf_del_row | ( | mpf_QSdata * | p, | |
| mpf_rawlpdata * | lp, | |||
| mpf_ILLread_lp_state * | state | |||
| ) | [static] |
Definition at line 756 of file mpf_editor.c.
References mpf_del_row_or_col(), and mpf_rawlpdata::nrows.
Referenced by mpf_ILLeditor().
Here is the call graph for this function:

| static int mpf_del_row_or_col | ( | mpf_QSdata * | p, | |
| mpf_rawlpdata * | lp, | |||
| mpf_ILLread_lp_state * | state, | |||
| int | isRow | |||
| ) | [static] |
Definition at line 724 of file mpf_editor.c.
References mpf_ILLlpdata::colnames, mpf_rawlpdata::coltab, mpf_ILLread_lp_state::field, ILL_RESULT, ILLsymboltab_delete(), mpf_ILL_BREAK_BODY_IF, mpf_ILLlp_error(), mpf_ILLread_lp_state_next_field_on_line(), mpf_ILLutil_array_index(), mpf_QSdelete_cols(), mpf_QSdelete_rows(), mpf_ILLlpdata::nrows, mpf_ILLlpdata::nstruct, mpf_qsdata::qslp, mpf_ILLlpdata::rownames, and mpf_rawlpdata::rowtab.
Referenced by mpf_del_col(), and mpf_del_row().
Here is the call graph for this function:

| static int mpf_fill_matrix | ( | mpf_rawlpdata * | lp, | |
| mpf_ILLread_lp_state * | state, | |||
| mpf_ILLmatrix * | m, | |||
| mpf_t * | obj, | |||
| int | n | |||
| ) | [static] |
Definition at line 468 of file mpf_editor.c.
References mpf_colptr::coef, mpf_rawlpdata::cols, ILL_FAILfalse, ILL_RESULT, ILL_SAFE_MALLOC, mpf_ILLmatrix::matbeg, mpf_ILLmatrix::matcnt, mpf_ILLmatrix::matcols, mpf_ILLmatrix::matind, mpf_ILLmatrix::matrows, mpf_ILLmatrix::matsize, mpf_ILLmatrix::matval, mpf_ILLlp_error(), mpf_ILLlp_warn(), mpf_ILLraw_colname(), mpf_rawlpdata::ncols, mpf_colptr::next, mpf_rawlpdata::nrows, NULL, and mpf_colptr::this_val.
Referenced by mpf_add_col(), and mpf_add_row().
Here is the call graph for this function:

| static char* mpf_get_row_col_name | ( | mpf_QSdata * | p, | |
| mpf_rawlpdata * | lp, | |||
| mpf_ILLread_lp_state * | state, | |||
| int | doRow | |||
| ) | [static] |
Definition at line 429 of file mpf_editor.c.
References mpf_rawlpdata::coltab, ILL_IFFREE, ILL_namebufsize, ILLsymboltab_lookup(), mpf_ILL_BREAK_BODY_IF, mpf_ILLlib_findName(), mpf_ILLlp_error(), mpf_ILLread_constraint_name(), mpf_rawlpdata::ncols, mpf_rawlpdata::nrows, NULL, mpf_qsdata::qslp, and mpf_rawlpdata::rowtab.
Referenced by mpf_add_col(), and mpf_add_row().
Here is the call graph for this function:

| static void mpf_getCmd | ( | mpf_ILLread_lp_state * | state, | |
| int * | cmd, | |||
| int * | subcmd | |||
| ) | [static] |
Definition at line 165 of file mpf_editor.c.
References mpf_ILLread_lp_state::field, ILL_IFTRACE, mpf_COL, mpf_commands, mpf_hasSubCmd, mpf_ILLread_lp_state_next_field_on_line(), mpf_ILLutil_index(), mpf_ROW, and mpf_SOLVE.
Referenced by mpf_ILLeditor().
Here is the call graph for this function:

| void mpf_ILLeditor | ( | mpf_QSdata * | p | ) |
Definition at line 188 of file mpf_editor.c.
References DUAL_SIMPLEX, ILL_IFTRACE, mpf_qsdata::lp, mpf_ADD, mpf_add_col(), mpf_add_row(), mpf_COL, mpf_DEL, mpf_del_col(), mpf_del_row(), mpf_DUAL, mpf_getCmd(), mpf_ILL_BREAK_BODY, mpf_ILL_BREAK_BODY_IF, mpf_ILLeditor_help(), mpf_ILLeditor_solve(), mpf_ILLfree_rawlpdata(), mpf_ILLlib_print_x(), mpf_ILLline_reader_free(), mpf_ILLline_reader_new(), mpf_ILLread_lp_state_init(), mpf_ILLread_lp_state_next_field(), mpf_ILLread_lp_state_next_field_on_line(), mpf_ILLread_lp_state_next_line(), mpf_NONE, mpf_PLP, mpf_PMPS, mpf_PRIMAL, mpf_PRTX, mpf_pull_info_from_p(), mpf_QS_EXIT, mpf_QSwrite_prob(), mpf_QSwrite_prob_file(), mpf_ROW, mpf_SOLVE, and PRIMAL_SIMPLEX.
Referenced by mpf_solver_main().
Here is the call graph for this function:

| static void mpf_ILLeditor_help | ( | void | ) | [static] |
Definition at line 112 of file mpf_editor.c.
References mpf_ADD, mpf_COL, mpf_DEL, mpf_HELP, mpf_ILLeditor_help_cmd(), mpf_NONE, mpf_PLP, mpf_PMPS, mpf_PRTX, mpf_QS_EXIT, mpf_ROW, and mpf_SOLVE.
Referenced by mpf_ILLeditor().
Here is the call graph for this function:

| static void mpf_ILLeditor_help_cmd | ( | int | cmd, | |
| int | subcmd | |||
| ) | [static] |
Definition at line 128 of file mpf_editor.c.
References mpf_ADD, mpf_COL, mpf_commands, mpf_DEL, mpf_HELP, mpf_PLP, mpf_PMPS, mpf_PRTX, mpf_QS_EXIT, mpf_ROW, and mpf_SOLVE.
Referenced by mpf_ILLeditor_help().
| void mpf_ILLeditor_init | ( | void | ) |
Definition at line 74 of file mpf_editor.c.
References mpf_ADD, mpf_COL, mpf_commands, mpf_DEL, mpf_DUAL, mpf_hasSubCmd, mpf_HELP, mpf_NCOMMAND, mpf_NEW, mpf_PLP, mpf_PMPS, mpf_PRIMAL, mpf_PRTX, mpf_QS_EXIT, mpf_ROW, mpf_SOLVE, and NULL.
Referenced by mpf_solver_main().
| int mpf_ILLeditor_solve | ( | mpf_QSdata * | p, | |
| int | salgo | |||
| ) |
Definition at line 324 of file mpf_editor.c.
References ILL_RESULT, mpf_ILL_BREAK_BODY_IF, mpf_QSget_objval(), mpf_QSopt_dual(), mpf_QSopt_primal(), PRIMAL_SIMPLEX, and mpf_qsdata::simplex_display.
Referenced by mpf_ILLeditor(), mpf_solver_main(), and QSexact_solver().
Here is the call graph for this function:

| static int mpf_pull_info_from_p | ( | mpf_QSdata * | p, | |
| mpf_rawlpdata * | lp | |||
| ) | [static] |
Definition at line 357 of file mpf_editor.c.
References mpf_ILLlpdata::colnames, mpf_rawlpdata::coltab, ILL_FAILfalse, ILL_RETURN, ILLsymboltab_create(), mpf_ILLlpdata::intmarker, mpf_qsdata::lp, mpf_ILL_BREAK_BODY_IF, mpf_ILLinit_rawlpdata(), mpf_ILLraw_add_col(), mpf_ILLraw_add_row(), mpf_ILLlpdata::nrows, mpf_ILLlpdata::nstruct, NULL, mpf_lpinfo::O, mpf_ILLlpdata::objname, mpf_ILLlpdata::rhs, mpf_ILLlpdata::rownames, mpf_rawlpdata::rowtab, and mpf_ILLlpdata::sense.
Referenced by mpf_ILLeditor().
Here is the call graph for this function:

| static int mpf_transpose | ( | mpf_rawlpdata * | lp | ) | [static] |
Definition at line 391 of file mpf_editor.c.
References mpf_rawlpdata::coltab, ILL_RETURN, mpf_rawlpdata::ncols, mpf_rawlpdata::nrows, QSMAX, mpf_rawlpdata::rhs, mpf_rawlpdata::rhssize, mpf_rawlpdata::rowsense, mpf_rawlpdata::rowtab, and mpf_rawlpdata::sensesize.
Referenced by mpf_add_col().
const char* mpf_commands[mpf_NCOMMAND+1] [static] |
Definition at line 71 of file mpf_editor.c.
Referenced by mpf_getCmd(), mpf_ILLeditor_help_cmd(), and mpf_ILLeditor_init().
char mpf_hasSubCmd[mpf_NCOMMAND+1] [static] |
int TRACE = 0 [static] |
Definition at line 41 of file mpf_editor.c.
1.4.7