ldbl_read_lp.c File Reference

#include "qs_config.h"
#include "ldbl_iqsutil.h"
#include "ldbl_read_lp.h"
#include "ldbl_lp.h"
#include "ldbl_rawlp.h"
#include "ldbl_lpdefs.h"
#include "ldbl_format.h"

Include dependency graph for ldbl_read_lp.c:

Go to the source code of this file.

Defines

#define ldbl_END_LINE(p)   (((*p) == '\\' || (*p) == '\n' || (*p) == '\0') ? 1 : 0)

Functions

int ldbl_ILLcheck_subject_to (ldbl_ILLread_lp_state *state)
int ldbl_ILLget_value (char *line, long double *coef)
int ldbl_ILLlp_error (ldbl_ILLread_lp_state *state, const char *format,...)
void ldbl_ILLlp_warn (ldbl_ILLread_lp_state *state, const char *format,...)
int ldbl_ILLread_lp_state_bad_keyword (ldbl_ILLread_lp_state *state)
int ldbl_ILLread_lp_state_colon (ldbl_ILLread_lp_state *state)
int ldbl_ILLread_lp_state_has_colon (ldbl_ILLread_lp_state *state)
int ldbl_ILLread_lp_state_init (ldbl_ILLread_lp_state *state, ldbl_qsline_reader *file, const char *ldbl_fname, int inter)
int ldbl_ILLread_lp_state_keyword (ldbl_ILLread_lp_state *state, const char *kwd[])
int ldbl_ILLread_lp_state_next_constraint (ldbl_ILLread_lp_state *state)
int ldbl_ILLread_lp_state_next_field (ldbl_ILLread_lp_state *state)
int ldbl_ILLread_lp_state_next_field_on_line (ldbl_ILLread_lp_state *state)
int ldbl_ILLread_lp_state_next_line (ldbl_ILLread_lp_state *state)
int ldbl_ILLread_lp_state_next_var (ldbl_ILLread_lp_state *state)
int ldbl_ILLread_lp_state_possible_bound_value (ldbl_ILLread_lp_state *state)
int ldbl_ILLread_lp_state_possible_coef (ldbl_ILLread_lp_state *state, long double *coef, const long double defValue)
void ldbl_ILLread_lp_state_prev_field (ldbl_ILLread_lp_state *state)
static void ldbl_ILLread_lp_state_print_at (ldbl_ILLread_lp_state *state)
int ldbl_ILLread_lp_state_sense (ldbl_ILLread_lp_state *state)
int ldbl_ILLread_lp_state_sign (ldbl_ILLread_lp_state *state, long double *sign)
int ldbl_ILLread_lp_state_skip_blanks (ldbl_ILLread_lp_state *state, int wrapLines)
int ldbl_ILLread_lp_state_value (ldbl_ILLread_lp_state *state, long double *coef)
void ldbl_ILLtest_lp_state_bound_sense (ldbl_ILLread_lp_state *state)
int ldbl_ILLtest_lp_state_keyword (ldbl_ILLread_lp_state *state, const char *kwd[])
int ldbl_ILLtest_lp_state_next_is (ldbl_ILLread_lp_state *state, const char *str)
int ldbl_ILLtest_lp_state_sense (ldbl_ILLread_lp_state *state, int all)
static void ldbl_lp_err (ldbl_ILLread_lp_state *state, int isError, const char *format, va_list args)
static int ldbl_next_field (ldbl_ILLread_lp_state *state, int acrossLines)

Variables

static const char * ldbl_all_keyword []
static int ldbl_all_keyword_len []
static int TRACE = 0


Define Documentation

#define ldbl_END_LINE (  )     (((*p) == '\\' || (*p) == '\n' || (*p) == '\0') ? 1 : 0)

Definition at line 49 of file ldbl_read_lp.c.

Referenced by ldbl_ILLmps_check_end_of_line(), ldbl_ILLmps_next_bound(), ldbl_ILLread_lp_state_next_line(), ldbl_ILLread_lp_state_possible_bound_value(), ldbl_ILLread_lp_state_print_at(), ldbl_ILLread_lp_state_sense(), and ldbl_ILLread_lp_state_skip_blanks().


Function Documentation

int ldbl_ILLcheck_subject_to ( ldbl_ILLread_lp_state state  ) 

Definition at line 781 of file ldbl_read_lp.c.

References ILL_RESULT, ldbl_ILL_ISBLANK, ldbl_ILLread_lp_state_bad_keyword(), ldbl_ILLread_lp_state_next_field(), ldbl_ILLread_lp_state_prev_field(), and ldbl_ILLread_lp_state_skip_blanks().

Referenced by ldbl_read_constraints().

Here is the call graph for this function:

int ldbl_ILLget_value ( char *  line,
long double *  coef 
)

Definition at line 695 of file ldbl_read_lp.c.

References ILL_IFTRACE, ILL_namebufsize, and ILL_RESULT.

Referenced by ldbl_get_double(), and ldbl_ILLread_lp_state_value().

int ldbl_ILLlp_error ( ldbl_ILLread_lp_state state,
const char *  format,
  ... 
)

Definition at line 668 of file ldbl_read_lp.c.

References ldbl_lp_err().

Referenced by ldbl_add_var(), ldbl_del_row_or_col(), ldbl_fill_matrix(), ldbl_get_row_col_name(), ldbl_ILLread_constraint_expr(), ldbl_ILLread_constraint_name(), ldbl_ILLread_lp(), ldbl_ILLread_lp_state_bad_keyword(), ldbl_ILLread_lp_state_next_constraint(), ldbl_ILLread_lp_state_sense(), ldbl_ILLread_one_constraint(), ldbl_read_bounds(), ldbl_read_colname(), ldbl_read_constraints(), ldbl_read_integer(), ldbl_read_minmax(), ldbl_read_objective(), and ldbl_read_problem_name().

Here is the call graph for this function:

void ldbl_ILLlp_warn ( ldbl_ILLread_lp_state state,
const char *  format,
  ... 
)

Definition at line 680 of file ldbl_read_lp.c.

References ldbl_lp_err(), and NULL.

Referenced by ldbl_fill_matrix(), ldbl_ILLread_constraint_expr(), ldbl_read_bounds(), and ldbl_read_objective().

Here is the call graph for this function:

int ldbl_ILLread_lp_state_bad_keyword ( ldbl_ILLread_lp_state state  ) 

Definition at line 268 of file ldbl_read_lp.c.

References ldbl_ILLread_lp_state::field, ldbl_ILLread_lp_state::fieldOnFirstCol, and ldbl_ILLlp_error().

Referenced by ldbl_ILLcheck_subject_to(), and ldbl_ILLread_lp_state_keyword().

Here is the call graph for this function:

int ldbl_ILLread_lp_state_colon ( ldbl_ILLread_lp_state state  ) 

Definition at line 311 of file ldbl_read_lp.c.

References ldbl_ILLread_lp_state_skip_blanks().

Referenced by ldbl_ILLread_constraint_name(), and ldbl_read_objective().

Here is the call graph for this function:

int ldbl_ILLread_lp_state_has_colon ( ldbl_ILLread_lp_state state  ) 

Definition at line 322 of file ldbl_read_lp.c.

References ldbl_ILLread_lp_state_skip_blanks(), and ldbl_ILLread_lp_state::p.

Referenced by ldbl_ILLread_constraint_name(), and ldbl_read_objective().

Here is the call graph for this function:

int ldbl_ILLread_lp_state_init ( ldbl_ILLread_lp_state state,
ldbl_qsline_reader file,
const char *  ldbl_fname,
int  inter 
)

Definition at line 64 of file ldbl_read_lp.c.

References ldbl_ILLread_lp_state::bound_val, ldbl_ILLread_lp_state::eof, ldbl_ILLread_lp_state::field, ldbl_ILLread_lp_state::fieldOnFirstCol, ldbl_ILLread_lp_state::file, ldbl_ILLread_lp_state::file_name, ILL_FAILtrue, ILL_RETURN, ldbl_ILLread_lp_state_skip_blanks(), ldbl_ILLread_lp_state::ldbl_interactive, ldbl_ILLread_lp_state::line, ldbl_ILLread_lp_state::line_num, NULL, ldbl_ILLread_lp_state::p, and ldbl_ILLread_lp_state::realline.

Referenced by ldbl_ILLeditor(), and ldbl_ILLread_lp().

Here is the call graph for this function:

int ldbl_ILLread_lp_state_keyword ( ldbl_ILLread_lp_state state,
const char *  kwd[] 
)

Definition at line 299 of file ldbl_read_lp.c.

References ldbl_ILLread_lp_state::eof, ldbl_ILLread_lp_state_bad_keyword(), and ldbl_ILLtest_lp_state_keyword().

Here is the call graph for this function:

int ldbl_ILLread_lp_state_next_constraint ( ldbl_ILLread_lp_state state  ) 

Definition at line 338 of file ldbl_read_lp.c.

References ldbl_ILLread_lp_state::eof, ldbl_all_keyword, ldbl_ILLlp_error(), ldbl_ILLread_lp_state_next_field(), ldbl_ILLread_lp_state_prev_field(), ldbl_ILLread_lp_state_skip_blanks(), ldbl_ILLtest_lp_state_keyword(), and ldbl_ILLread_lp_state::line_num.

Referenced by ldbl_read_constraints().

Here is the call graph for this function:

int ldbl_ILLread_lp_state_next_field ( ldbl_ILLread_lp_state state  ) 

Definition at line 196 of file ldbl_read_lp.c.

References ldbl_next_field().

Referenced by ldbl_ILLcheck_subject_to(), ldbl_ILLeditor(), ldbl_ILLread_lp(), ldbl_ILLread_lp_state_next_constraint(), ldbl_read_bounds(), ldbl_read_constraints(), ldbl_read_integer(), and ldbl_read_problem_name().

Here is the call graph for this function:

int ldbl_ILLread_lp_state_next_field_on_line ( ldbl_ILLread_lp_state state  ) 

Definition at line 190 of file ldbl_read_lp.c.

References ldbl_next_field().

Referenced by ldbl_del_row_or_col(), ldbl_getCmd(), and ldbl_ILLeditor().

Here is the call graph for this function:

int ldbl_ILLread_lp_state_next_line ( ldbl_ILLread_lp_state state  ) 

Definition at line 89 of file ldbl_read_lp.c.

References ldbl_ILLread_lp_state::eof, ldbl_ILLread_lp_state::field, ldbl_ILLread_lp_state::fieldOnFirstCol, ldbl_ILLread_lp_state::file, ldbl_ILLread_lp_state::file_name, ILL_IFTRACE, ILL_namebufsize, ldbl_END_LINE, ldbl_ILL_ISBLANK, ldbl_ILLline_reader_get, ldbl_ILLread_lp_state::ldbl_interactive, ldbl_ILLread_lp_state::line, ldbl_ILLread_lp_state::line_num, NULL, ldbl_ILLread_lp_state::p, and ldbl_ILLread_lp_state::realline.

Referenced by ldbl_add_col(), ldbl_ILLeditor(), and ldbl_ILLread_lp_state_skip_blanks().

int ldbl_ILLread_lp_state_next_var ( ldbl_ILLread_lp_state state  ) 

Definition at line 220 of file ldbl_read_lp.c.

References ldbl_all_keyword, ldbl_all_keyword_len, ldbl_ILLis_lp_name_char(), ldbl_ILLread_lp_state_skip_blanks(), and NULL.

Referenced by ldbl_ILLread_constraint_expr(), ldbl_ILLread_constraint_name(), ldbl_read_colname(), and ldbl_read_objective().

Here is the call graph for this function:

int ldbl_ILLread_lp_state_possible_bound_value ( ldbl_ILLread_lp_state state  ) 

Definition at line 429 of file ldbl_read_lp.c.

References ldbl_END_LINE, ldbl_ILL_MAXDOUBLE, ldbl_ILL_MINDOUBLE, ldbl_ILLread_lp_state_sign(), ldbl_ILLread_lp_state_skip_blanks(), ldbl_ILLread_lp_state_value(), and NULL.

Referenced by ldbl_read_bounds().

Here is the call graph for this function:

int ldbl_ILLread_lp_state_possible_coef ( ldbl_ILLread_lp_state state,
long double *  coef,
const long double  defValue 
)

Definition at line 419 of file ldbl_read_lp.c.

References ldbl_ILLread_lp_state_value().

Referenced by ldbl_ILLread_constraint_expr().

Here is the call graph for this function:

void ldbl_ILLread_lp_state_prev_field ( ldbl_ILLread_lp_state state  ) 

Definition at line 202 of file ldbl_read_lp.c.

References ldbl_ILLread_lp_state::fieldOnFirstCol, ldbl_ILL_ISBLANK, ldbl_ILLread_lp_state::line, and ldbl_ILLread_lp_state::p.

Referenced by ldbl_ILLcheck_subject_to(), ldbl_ILLread_lp_state_next_constraint(), ldbl_read_colname(), and ldbl_read_minmax().

static void ldbl_ILLread_lp_state_print_at ( ldbl_ILLread_lp_state state  )  [static]

Definition at line 582 of file ldbl_read_lp.c.

References ldbl_ILLread_lp_state::eof, ldbl_END_LINE, ldbl_ILL_ISBLANK, and ldbl_ILLread_lp_state::p.

Referenced by ldbl_lp_err().

int ldbl_ILLread_lp_state_sense ( ldbl_ILLread_lp_state state  ) 

Definition at line 554 of file ldbl_read_lp.c.

References ldbl_END_LINE, ldbl_ILLlp_error(), and ldbl_ILLtest_lp_state_sense().

Referenced by ldbl_ILLread_one_constraint().

Here is the call graph for this function:

int ldbl_ILLread_lp_state_sign ( ldbl_ILLread_lp_state state,
long double *  sign 
)

Definition at line 363 of file ldbl_read_lp.c.

References ldbl_ILLread_lp_state_skip_blanks().

Referenced by ldbl_ILLread_constraint_expr(), and ldbl_ILLread_lp_state_possible_bound_value().

Here is the call graph for this function:

int ldbl_ILLread_lp_state_skip_blanks ( ldbl_ILLread_lp_state state,
int  wrapLines 
)

Definition at line 141 of file ldbl_read_lp.c.

References ldbl_END_LINE, ldbl_ILL_ISBLANK, ldbl_ILLread_lp_state_next_line(), and ldbl_ILLread_lp_state::p.

Referenced by ldbl_ILLcheck_subject_to(), ldbl_ILLread_lp_state_colon(), ldbl_ILLread_lp_state_has_colon(), ldbl_ILLread_lp_state_init(), ldbl_ILLread_lp_state_next_constraint(), ldbl_ILLread_lp_state_next_var(), ldbl_ILLread_lp_state_possible_bound_value(), ldbl_ILLread_lp_state_sign(), ldbl_ILLread_lp_state_value(), ldbl_ILLtest_lp_state_next_is(), ldbl_ILLtest_lp_state_sense(), ldbl_lp_err(), ldbl_next_field(), and ldbl_read_objective().

Here is the call graph for this function:

int ldbl_ILLread_lp_state_value ( ldbl_ILLread_lp_state state,
long double *  coef 
)

Definition at line 396 of file ldbl_read_lp.c.

References ILL_RESULT, ldbl_ILLget_value(), and ldbl_ILLread_lp_state_skip_blanks().

Referenced by ldbl_add_col(), ldbl_ILLread_lp_state_possible_bound_value(), ldbl_ILLread_lp_state_possible_coef(), and ldbl_ILLread_one_constraint().

Here is the call graph for this function:

void ldbl_ILLtest_lp_state_bound_sense ( ldbl_ILLread_lp_state state  ) 

Definition at line 548 of file ldbl_read_lp.c.

References ldbl_ILLtest_lp_state_sense().

Referenced by ldbl_read_bounds().

Here is the call graph for this function:

int ldbl_ILLtest_lp_state_keyword ( ldbl_ILLread_lp_state state,
const char *  kwd[] 
)

Definition at line 280 of file ldbl_read_lp.c.

References ldbl_ILLread_lp_state::eof, ldbl_ILLread_lp_state::field, ldbl_ILLread_lp_state::fieldOnFirstCol, and NULL.

Referenced by ldbl_ILLread_lp_state_keyword(), and ldbl_ILLread_lp_state_next_constraint().

int ldbl_ILLtest_lp_state_next_is ( ldbl_ILLread_lp_state state,
const char *  str 
)

Definition at line 383 of file ldbl_read_lp.c.

References ldbl_ILLread_lp_state_skip_blanks(), and ldbl_ILLread_lp_state::p.

Referenced by ldbl_read_bounds().

Here is the call graph for this function:

int ldbl_ILLtest_lp_state_sense ( ldbl_ILLread_lp_state state,
int  all 
)

Definition at line 487 of file ldbl_read_lp.c.

References ldbl_ILLread_lp_state_skip_blanks(), and ldbl_ILLread_lp_state::sense_val.

Referenced by ldbl_ILLread_lp_state_sense(), and ldbl_ILLtest_lp_state_bound_sense().

Here is the call graph for this function:

static void ldbl_lp_err ( ldbl_ILLread_lp_state state,
int  isError,
const char *  format,
va_list  args 
) [static]

Definition at line 614 of file ldbl_read_lp.c.

References ldbl_qsline_reader::error_collector, ldbl_ILLread_lp_state::file, ldbl_ILLread_lp_state::file_name, ILL_FAILfalse, ldbl_ILLformat_error, ldbl_ILLformat_error_create(), ldbl_ILLformat_error_delete(), ldbl_ILLread_lp_state_print_at(), ldbl_ILLread_lp_state_skip_blanks(), ldbl_ILLread_lp_state::ldbl_interactive, ldbl_ILLread_lp_state::line, ldbl_ILLread_lp_state::line_num, NULL, ldbl_ILLread_lp_state::p, QS_LP_FORMAT_ERROR, QS_LP_FORMAT_WARN, and ldbl_ILLread_lp_state::realline.

Referenced by ldbl_ILLlp_error(), and ldbl_ILLlp_warn().

Here is the call graph for this function:

static int ldbl_next_field ( ldbl_ILLread_lp_state state,
int  acrossLines 
) [static]

Definition at line 172 of file ldbl_read_lp.c.

References ldbl_ILLread_lp_state_skip_blanks().

Referenced by ldbl_ILLread_lp_state_next_field(), and ldbl_ILLread_lp_state_next_field_on_line().

Here is the call graph for this function:


Variable Documentation

const char* ldbl_all_keyword[] [static]

Initial value:

 {
  "MIN", "MINIMUM", "MINIMIZE",
  "MAX", "MAXIMUM", "MAXIMIZE",
  "SUBJECT", "ST", "PROBLEM", "PROB",
  "BOUNDS", "BOUND", "INTEGER", "END", NULL
}

Definition at line 51 of file ldbl_read_lp.c.

Referenced by ldbl_ILLread_lp_state_next_constraint(), and ldbl_ILLread_lp_state_next_var().

int ldbl_all_keyword_len[] [static]

Initial value:

 {
  3, 7, 8,
  3, 7, 8,
  7, 2, 7, 4,
  6, 5, 7, 3, -1
}

Definition at line 57 of file ldbl_read_lp.c.

Referenced by ldbl_ILLread_lp_state_next_var().

int TRACE = 0 [static]

Definition at line 47 of file ldbl_read_lp.c.


Generated on Thu Mar 29 09:40:55 2012 for QSopt_ex by  doxygen 1.4.7