CNF file reader.
The DIMACS CNF (conjunctive normal form) is a file format used for example for SAT problems. For a detailed description of this format see http://people.sc.fsu.edu/~jburkardt/data/cnf/cnf.html .
Definition in file reader_cnf.c.
#include "blockmemshell/memory.h"#include "scip/cons_linear.h"#include "scip/cons_logicor.h"#include "scip/cons_setppc.h"#include "scip/pub_fileio.h"#include "scip/pub_message.h"#include "scip/pub_misc.h"#include "scip/pub_reader.h"#include "scip/reader_cnf.h"#include "scip/scip_cons.h"#include "scip/scip_mem.h"#include "scip/scip_message.h"#include "scip/scip_numerics.h"#include "scip/scip_param.h"#include "scip/scip_prob.h"#include "scip/scip_reader.h"#include "scip/scip_var.h"#include <string.h>Go to the source code of this file.
Macros | |
| #define | READER_NAME "cnfreader" |
| #define | READER_DESC "file reader for SAT problems in conjunctive normal form" |
| #define | READER_EXTENSION "cnf" |
| #define | MAXLINELEN 65536 |
Functions | |
| static void | readError (SCIP *scip, int linecount, const char *errormsg) |
| static void | readWarning (SCIP *scip, int linecount, const char *warningmsg) |
| static SCIP_RETCODE | readCnfLine (SCIP *scip, SCIP_FILE *file, char *buffer, int size, int *linecount) |
| static SCIP_RETCODE | readCnf (SCIP *scip, SCIP_FILE *file) |
| static | SCIP_DECL_READERCOPY (readerCopyCnf) |
| static | SCIP_DECL_READERREAD (readerReadCnf) |
| SCIP_RETCODE | SCIPincludeReaderCnf (SCIP *scip) |
| #define READER_NAME "cnfreader" |
Definition at line 56 of file reader_cnf.c.
| #define READER_DESC "file reader for SAT problems in conjunctive normal form" |
Definition at line 57 of file reader_cnf.c.
| #define READER_EXTENSION "cnf" |
Definition at line 58 of file reader_cnf.c.
| #define MAXLINELEN 65536 |
Definition at line 60 of file reader_cnf.c.
Referenced by readCnf().
|
static |
Definition at line 68 of file reader_cnf.c.
References assert(), NULL, and SCIPerrorMessage.
Referenced by readCnf(), and readCnfLine().
|
static |
Definition at line 79 of file reader_cnf.c.
References SCIPwarningMessage().
Referenced by readCnf().
|
static |
reads the next non-empty non-comment line of a cnf file
| scip | SCIP data structure |
| file | input file |
| buffer | buffer for storing the input line |
| size | size of the buffer |
| linecount | pointer to the line number counter |
Definition at line 90 of file reader_cnf.c.
References assert(), NULL, readError(), SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_READERROR, SCIPfgets(), and SCIPsnprintf().
Referenced by readCnf().
|
static |
Definition at line 147 of file reader_cnf.c.
References ABS, assert(), FALSE, i, MAXLINELEN, NULL, nvars, readCnfLine(), readError(), readWarning(), SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OBJSENSE_MAXIMIZE, SCIP_OKAY, SCIP_READERROR, SCIP_Real, SCIP_VARTYPE_BINARY, SCIPaddCons(), SCIPaddVar(), SCIPallocBufferArray, SCIPchgVarObj(), SCIPcreateConsLinear(), SCIPcreateConsLogicor(), SCIPcreateConsSetcover(), SCIPcreateVar(), SCIPfindConshdlr(), SCIPfreeBufferArray, SCIPgetBoolParam(), SCIPgetNegatedVar(), SCIPinfinity(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPsetObjsense(), SCIPsnprintf(), SCIPstrtok(), SCIPwarningMessage(), TRUE, and vars.
Referenced by SCIP_DECL_READERREAD().
|
static |
copy method for reader plugins (called when SCIP copies plugins)
Definition at line 381 of file reader_cnf.c.
References assert(), NULL, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludeReaderCnf(), and SCIPreaderGetName().
|
static |
problem reading method of reader
Definition at line 396 of file reader_cnf.c.
References assert(), NULL, readCnf(), READER_NAME, result, SCIP_DIDNOTRUN, SCIP_NOFILE, SCIP_OKAY, SCIP_SUCCESS, SCIPcreateProb(), SCIPerrorMessage, SCIPfclose(), SCIPfopen(), SCIPprintSysError(), and SCIPreaderGetName().