diff options
author | Pasha <pasha@member.fsf.org> | 2023-01-27 00:54:07 +0000 |
---|---|---|
committer | Pasha <pasha@member.fsf.org> | 2023-01-27 00:54:07 +0000 |
commit | ef800d4ffafdbde7d7a172ad73bd984b1695c138 (patch) | |
tree | 920cc189130f1e98f252283fce94851443641a6d /glpk-5.0/src/misc/dimacs.h | |
parent | ec4ae3c2b5cb0e83fb667f14f832ea94f68ef075 (diff) | |
download | oneapi-ef800d4ffafdbde7d7a172ad73bd984b1695c138.tar.gz oneapi-ef800d4ffafdbde7d7a172ad73bd984b1695c138.tar.bz2 |
Diffstat (limited to 'glpk-5.0/src/misc/dimacs.h')
-rw-r--r-- | glpk-5.0/src/misc/dimacs.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/glpk-5.0/src/misc/dimacs.h b/glpk-5.0/src/misc/dimacs.h new file mode 100644 index 0000000..2c86b28 --- /dev/null +++ b/glpk-5.0/src/misc/dimacs.h @@ -0,0 +1,79 @@ +/* dimacs.h (reading data in DIMACS format) */ + +/*********************************************************************** +* This code is part of GLPK (GNU Linear Programming Kit). +* Copyright (C) 2009-2015 Free Software Foundation, Inc. +* Written by Andrew Makhorin <mao@gnu.org>. +* +* GLPK is free software: you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* GLPK is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +* License for more details. +* +* You should have received a copy of the GNU General Public License +* along with GLPK. If not, see <http://www.gnu.org/licenses/>. +***********************************************************************/ + +#ifndef DIMACS_H +#define DIMACS_H + +#include "env.h" + +typedef struct DMX DMX; + +struct DMX +{ /* DIMACS data reader */ + jmp_buf jump; + /* label for go to in case of error */ + const char *fname; + /* name of input text file */ + glp_file *fp; + /* stream assigned to input text file */ + int count; + /* line count */ + int c; + /* current character */ + char field[255+1]; + /* data field */ + int empty; + /* warning 'empty line ignored' was printed */ + int nonint; + /* warning 'non-integer data detected' was printed */ +}; + +#define dmx_error _glp_dmx_error +void dmx_error(DMX *csa, const char *fmt, ...); +/* print error message and terminate processing */ + +#define dmx_warning _glp_dmx_warning +void dmx_warning(DMX *csa, const char *fmt, ...); +/* print warning message and continue processing */ + +#define dmx_read_char _glp_dmx_read_char +void dmx_read_char(DMX *csa); +/* read character from input text file */ + +#define dmx_read_designator _glp_dmx_read_designator +void dmx_read_designator(DMX *csa); +/* read one-character line designator */ + +#define dmx_read_field _glp_dmx_read_field +void dmx_read_field(DMX *csa); +/* read data field */ + +#define dmx_end_of_line _glp_dmx_end_of_line +void dmx_end_of_line(DMX *csa); +/* skip white-space characters until end of line */ + +#define dmx_check_int _glp_dmx_check_int +void dmx_check_int(DMX *csa, double num); +/* print a warning if non-integer data are detected */ + +#endif + +/* eof */ |