Solving Constraint Integer Programs

reader_cyc.c File Reference

Detailed Description

file reader for cycle clustering instances

Leon Eifler

This file implements the reader for the cycle clustering problem. The data is read from a matrix, entries separated by whitespace. The first line in the file has to be of the form "# p nstates ncluster", where nstates is the size of the matrix and ncluster is the number of clusters that should be used. The file has to have the ending ".cyc" to be recognized by the reader.

Definition in file reader_cyc.c.

#include "reader_cyc.h"
#include <assert.h>
#include <string.h>
#include <ctype.h>
#include "probdata_cyc.h"

Go to the source code of this file.


#define READER_NAME   "cycreader"
#define READER_DESC   "file reader for a .cyc-file with a transition matrix for a cycle clustering problem"
#define READER_EXTENSION   "cyc"
#define COL_MAX_LINELEN   10000


static SCIP_Real getNextNumber (char **s)
static SCIP_RETCODE readCyc (SCIP *scip, const char *filename)
static SCIP_DECL_READERCOPY (readerCopyCyc)
static SCIP_DECL_READERREAD (readerReadCyc)
SCIP_RETCODE SCIPincludeReaderCyc (SCIP *scip)

Macro Definition Documentation


#define READER_NAME   "cycreader"

Definition at line 34 of file reader_cyc.c.

Referenced by SCIP_DECL_READERCOPY(), SCIP_DECL_READERREAD(), and SCIPincludeReaderCyc().


#define READER_DESC   "file reader for a .cyc-file with a transition matrix for a cycle clustering problem"

Definition at line 35 of file reader_cyc.c.

Referenced by SCIPincludeReaderCyc().


#define READER_EXTENSION   "cyc"

Definition at line 36 of file reader_cyc.c.

Referenced by SCIPincludeReaderCyc().


#define COL_MAX_LINELEN   10000

Definition at line 38 of file reader_cyc.c.

Referenced by readCyc().

Function Documentation

◆ getNextNumber()

static SCIP_Real getNextNumber ( char **  s)

get next number from string s

spointer to the pointer of the current position in the string

Definition at line 47 of file reader_cyc.c.

References SCIP_Real.

Referenced by readCyc().

◆ readCyc()

static SCIP_RETCODE readCyc ( SCIP scip,
const char *  filename 

read LP in Cyc File Format. That means first line is "p edges nbins ncluster". Then a matrix with whitespace-separated entries of size nbins x nbins

scipSCIP data structure
filenamename of the input file

Definition at line 70 of file reader_cyc.c.

References COL_MAX_LINELEN, getNextNumber(), NULL, SCIP_CALL, SCIP_NOFILE, SCIP_OKAY, SCIP_READERROR, SCIP_Real, SCIPallocMemoryArray, SCIPcreateProbCyc(), SCIPerrorMessage, SCIPfclose(), SCIPfeof(), SCIPfgets(), SCIPfopen(), SCIPfreeMemoryArray, and SCIPinfoMessage().



static SCIP_DECL_READERCOPY ( readerCopyCyc  )

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

Definition at line 179 of file reader_cyc.c.

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


static SCIP_DECL_READERREAD ( readerReadCyc  )

problem reading method of reader

Definition at line 190 of file reader_cyc.c.

References NULL, readCyc(), READER_NAME, SCIP_CALL, SCIP_OKAY, SCIP_SUCCESS, and SCIPreaderGetName().

◆ SCIPincludeReaderCyc()

SCIP_RETCODE SCIPincludeReaderCyc ( SCIP scip)

includes the cyc file reader in SCIP

scipSCIP data structure

Definition at line 209 of file reader_cyc.c.

References FALSE, NULL, READER_DESC, READER_EXTENSION, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPaddBoolParam(), SCIPaddCharParam(), SCIPaddRealParam(), SCIPincludeReaderBasic(), SCIPsetReaderCopy(), SCIPsetReaderRead(), and TRUE.

Referenced by SCIPincludeCycPlugins().