Scippy

SCIP

Solving Constraint Integer Programs

reader_cnf.c File Reference

Detailed Description

CNF file reader.

Author
Thorsten Koch
Tobias Achterberg

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 46 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 47 of file reader_cnf.c.

Referenced by SCIPincludeReaderCnf().

◆ READER_EXTENSION

#define READER_EXTENSION   "cnf"

Definition at line 48 of file reader_cnf.c.

Referenced by SCIPincludeReaderCnf().

◆ MAXLINELEN

#define MAXLINELEN   65536

Definition at line 50 of file reader_cnf.c.

Referenced by readCnf().

Function Documentation

◆ readError()

static void readError ( SCIP scip,
int  linecount,
const char *  errormsg 
)
static
Parameters
scipSCIP data structure
linecountline number of error
errormsgerror message

Definition at line 58 of file reader_cnf.c.

References SCIPerrorMessage.

Referenced by readCnf(), and readCnfLine().

◆ readWarning()

static void readWarning ( SCIP scip,
int  linecount,
const char *  warningmsg 
)
static
Parameters
scipSCIP data structure
linecountline number of error
warningmsgwarning message

Definition at line 68 of file reader_cnf.c.

References SCIPwarningMessage().

Referenced by readCnf().

◆ readCnfLine()

static SCIP_RETCODE readCnfLine ( SCIP scip,
SCIP_FILE file,
char *  buffer,
int  size,
int *  linecount 
)
static

reads the next non-empty non-comment line of a cnf file

Parameters
scipSCIP data structure
fileinput file
bufferbuffer for storing the input line
sizesize of the buffer
linecountpointer to the line number counter

Definition at line 79 of file reader_cnf.c.

References NULL, readError(), SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_READERROR, SCIPfgets(), and SCIPsnprintf().

Referenced by readCnf().

◆ readCnf()

◆ SCIP_DECL_READERCOPY()

static SCIP_DECL_READERCOPY ( readerCopyCnf  )
static

copy method for reader plugins (called when SCIP copies plugins)

Definition at line 369 of file reader_cnf.c.

References NULL, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludeReaderCnf(), and SCIPreaderGetName().

◆ SCIP_DECL_READERREAD()

static SCIP_DECL_READERREAD ( readerReadCnf  )
static