Scippy

SCIP

Solving Constraint Integer Programs

reader_lop.c File Reference

Detailed Description

linear ordering file reader

Author
Marc Pfetsch

This file implements the reader/parser used to read linear ordering problems. For more details see How to add file readers. The data should be given in LOLIB format, see LOLIB.

Definition in file reader_lop.c.

#include <assert.h>
#include <string.h>
#include "cons_lop.h"
#include "reader_lop.h"

Go to the source code of this file.

Macros

#define READER_NAME   "lopreader"
 
#define READER_DESC   "file reader for linear ordering problems"
 
#define READER_EXTENSION   "lop"
 

Functions

static SCIP_RETCODE LOPreadFile (SCIP *scip, const char *filename, int *n, SCIP_Real ***W)
 
static SCIP_RETCODE getProblemName (const char *filename, char *probname, int maxSize)
 
Callback methods
static SCIP_DECL_READERREAD (LOPreaderRead)
 
Interface methods
SCIP_RETCODE SCIPincludeReaderLOP (SCIP *scip)
 

Macro Definition Documentation

◆ READER_NAME

#define READER_NAME   "lopreader"

Definition at line 32 of file reader_lop.c.

Referenced by SCIPincludeReaderLOP().

◆ READER_DESC

#define READER_DESC   "file reader for linear ordering problems"

Definition at line 33 of file reader_lop.c.

Referenced by SCIPincludeReaderLOP().

◆ READER_EXTENSION

#define READER_EXTENSION   "lop"

Definition at line 34 of file reader_lop.c.

Referenced by SCIPincludeReaderLOP().

Function Documentation

◆ LOPreadFile()

static SCIP_RETCODE LOPreadFile ( SCIP scip,
const char *  filename,
int *  n,
SCIP_Real ***  W 
)
static

read weight matrix from file (in LOLIB format)

Format: comment line n = # of elements weight matrix (n times n double matrix)

Parameters
scipSCIP data structure
filenamename of file to read
npointer to store the number of elements on exit
Wpointer to store the weight matrix on exit

Definition at line 47 of file reader_lop.c.

References SCIP_CALL, SCIP_MAXSTRLEN, SCIP_NOFILE, SCIP_OKAY, SCIP_READERROR, SCIP_Real, SCIPallocBlockMemoryArray, SCIPerrorMessage, and SCIPprintSysError().

Referenced by SCIP_DECL_READERREAD().

◆ getProblemName()

static SCIP_RETCODE getProblemName ( const char *  filename,
char *  probname,
int  maxSize 
)
static

get problem name

Returns NULL on error

Parameters
filenameinput filename
probnameoutput problemname
maxSizemaximum size of probname

Definition at line 117 of file reader_lop.c.

References SCIP_ERROR, and SCIP_OKAY.

Referenced by SCIP_DECL_READERREAD().

◆ SCIP_DECL_READERREAD()

◆ SCIPincludeReaderLOP()

SCIP_RETCODE SCIPincludeReaderLOP ( SCIP scip)

includes the linear ordering file reader in SCIP

Parameters
scipSCIP data structure

Definition at line 263 of file reader_lop.c.

References READER_DESC, READER_EXTENSION, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludeReaderBasic(), and SCIPsetReaderRead().

Referenced by main().