Detailed Description
linear ordering file reader
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 <ctype.h>
#include "cons_lop.h"
#include "reader_lop.h"
#include <scip/pub_fileio.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" |
#define | READER_STRLEN 65536 |
Functions | |
static SCIP_RETCODE | getNextNumber (SCIP_FILE *file, char *buffer, char **s, SCIP_Real *value) |
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 43 of file reader_lop.c.
Referenced by SCIPincludeReaderLOP().
◆ READER_DESC
#define READER_DESC "file reader for linear ordering problems" |
Definition at line 44 of file reader_lop.c.
Referenced by SCIPincludeReaderLOP().
◆ READER_EXTENSION
#define READER_EXTENSION "lop" |
Definition at line 45 of file reader_lop.c.
Referenced by SCIPincludeReaderLOP().
◆ READER_STRLEN
#define READER_STRLEN 65536 |
Definition at line 47 of file reader_lop.c.
Referenced by getNextNumber(), and LOPreadFile().
Function Documentation
◆ getNextNumber()
|
static |
Get next number from file
- Parameters
-
file file to read from buffer buffer to store lines in s pointer to string pointer value pointer to store the read value
Definition at line 53 of file reader_lop.c.
References NULL, READER_STRLEN, SCIP_INVALID, SCIP_OKAY, SCIP_READERROR, SCIPerrorMessage, and SCIPfgets().
Referenced by LOPreadFile().
◆ LOPreadFile()
|
static |
read weight matrix from file (in LOLIB format)
Format: comment line n = # of elements weight matrix (n times n double matrix)
- Parameters
-
scip SCIP data structure filename name of file to read n pointer to store the number of elements on exit W pointer to store the weight matrix on exit
Definition at line 115 of file reader_lop.c.
References getNextNumber(), NULL, READER_STRLEN, SCIP_CALL, SCIP_INVALID, SCIP_NOFILE, SCIP_OKAY, SCIP_READERROR, SCIP_Real, SCIPallocBlockMemoryArray, SCIPerrorMessage, SCIPfclose(), SCIPfeof(), SCIPfgets(), SCIPfopen(), and SCIPprintSysError().
Referenced by SCIP_DECL_READERREAD().
◆ getProblemName()
|
static |
get problem name
Returns NULL on error
- Parameters
-
filename input filename probname output problemname maxSize maximum size of probname
Definition at line 202 of file reader_lop.c.
References SCIP_ERROR, and SCIP_OKAY.
Referenced by SCIP_DECL_READERREAD().
◆ SCIP_DECL_READERREAD()
|
static |
problem reading method of reader
Definition at line 254 of file reader_lop.c.
References FALSE, getProblemName(), LOPreadFile(), NULL, SCIP_CALL, SCIP_DIDNOTRUN, SCIP_MAXSTRLEN, SCIP_OBJSENSE_MAXIMIZE, SCIP_OKAY, SCIP_Real, SCIP_SUCCESS, SCIP_VARTYPE_BINARY, SCIPaddCons(), SCIPaddVar(), SCIPallocBlockMemoryArray, SCIPcreateConsLOP(), SCIPcreateProbBasic(), SCIPcreateVar(), SCIPfreeBlockMemoryArray, SCIPinfoMessage(), SCIPprintOrigProblem(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPsetObjsense(), SCIPsnprintf(), and TRUE.
◆ SCIPincludeReaderLOP()
SCIP_RETCODE SCIPincludeReaderLOP | ( | SCIP * | scip | ) |
includes the linear ordering file reader in SCIP
- Parameters
-
scip SCIP data structure
Definition at line 348 of file reader_lop.c.
References NULL, READER_DESC, READER_EXTENSION, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludeReaderBasic(), and SCIPsetReaderRead().
Referenced by main().