Detailed Description
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) |
Macro Definition Documentation
◆ READER_NAME
#define READER_NAME "cnfreader" |
Definition at line 56 of file reader_cnf.c.
Referenced by SCIP_DECL_READERCOPY(), SCIP_DECL_READERREAD(), and SCIPincludeReaderCnf().
◆ READER_DESC
#define READER_DESC "file reader for SAT problems in conjunctive normal form" |
Definition at line 57 of file reader_cnf.c.
Referenced by SCIPincludeReaderCnf().
◆ READER_EXTENSION
#define READER_EXTENSION "cnf" |
Definition at line 58 of file reader_cnf.c.
Referenced by SCIPincludeReaderCnf().
◆ MAXLINELEN
#define MAXLINELEN 65536 |
Definition at line 60 of file reader_cnf.c.
Referenced by readCnf().
Function Documentation
◆ readError()
|
static |
- Parameters
-
scip SCIP data structure linecount line number of error errormsg error message
Definition at line 68 of file reader_cnf.c.
References NULL, and SCIPerrorMessage.
Referenced by readCnf(), and readCnfLine().
◆ readWarning()
|
static |
- Parameters
-
scip SCIP data structure linecount line number of error warningmsg warning message
Definition at line 79 of file reader_cnf.c.
References SCIPwarningMessage().
Referenced by readCnf().
◆ readCnfLine()
|
static |
reads the next non-empty non-comment line of a cnf file
- Parameters
-
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 NULL, readError(), SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_READERROR, SCIPfgets(), and SCIPsnprintf().
Referenced by readCnf().
◆ readCnf()
|
static |
- Parameters
-
scip SCIP data structure file input file
Definition at line 147 of file reader_cnf.c.
References FALSE, MAXLINELEN, NULL, 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().
◆ SCIP_DECL_READERCOPY()
|
static |
copy method for reader plugins (called when SCIP copies plugins)
Definition at line 381 of file reader_cnf.c.
References NULL, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludeReaderCnf(), and SCIPreaderGetName().
◆ SCIP_DECL_READERREAD()
|
static |
problem reading method of reader
Definition at line 396 of file reader_cnf.c.
References NULL, readCnf(), READER_NAME, SCIP_NOFILE, SCIP_OKAY, SCIP_SUCCESS, SCIPcreateProb(), SCIPerrorMessage, SCIPfclose(), SCIPfopen(), SCIPprintSysError(), and SCIPreaderGetName().