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 <assert.h>
#include <string.h>
#include "scip/reader_cnf.h"
#include "scip/cons_linear.h"
#include "scip/cons_logicor.h"
#include "scip/cons_setppc.h"
#include "scip/pub_misc.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 37 of file reader_cnf.c.
Referenced by SCIP_DECL_READERCOPY(), SCIP_DECL_READERREAD(), and SCIPincludeReaderCnf().
#define READER_DESC "file reader for SAT problems in conjunctive normal form" |
Definition at line 38 of file reader_cnf.c.
Referenced by SCIPincludeReaderCnf().
#define READER_EXTENSION "cnf" |
Definition at line 39 of file reader_cnf.c.
Referenced by SCIPincludeReaderCnf().
#define MAXLINELEN 65536 |
Definition at line 41 of file reader_cnf.c.
Referenced by readCnf().
|
static |
scip | SCIP data structure |
linecount | line number of error |
errormsg | error message |
Definition at line 49 of file reader_cnf.c.
References SCIPerrorMessage.
Referenced by readCnf(), and readCnfLine().
|
static |
scip | SCIP data structure |
linecount | line number of error |
warningmsg | warning message |
Definition at line 59 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 70 of file reader_cnf.c.
References readError(), SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_READERROR, SCIPfgets(), and SCIPsnprintf().
Referenced by readCnf().
|
static |
scip | SCIP data structure |
file | input file |
Definition at line 127 of file reader_cnf.c.
References FALSE, MAXLINELEN, 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(), and TRUE.
Referenced by SCIP_DECL_READERREAD().
|
static |
copy method for reader plugins (called when SCIP copies plugins)
Definition at line 360 of file reader_cnf.c.
References READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludeReaderCnf(), and SCIPreaderGetName().
|
static |
problem reading method of reader
Definition at line 375 of file reader_cnf.c.
References readCnf(), READER_NAME, SCIP_CALL, SCIP_NOFILE, SCIP_SUCCESS, SCIPcreateProb(), SCIPerrorMessage, SCIPfclose(), SCIPfopen(), SCIPprintSysError(), and SCIPreaderGetName().