file reader for decompositions in the constraint based dec-file format.
This reader allows to read a file containing decompositions for constraints of the current original problem. The standard line ending for this format is '.dec'. The content of the file should obey the following format
\\ place for comments and statistics NBLOCKS 2 BLOCK 0 consA consB [...] BLOCK 1 consC consD [...] MASTERCONSS linkingcons
A block in a problem decomposition is a set of constraints that are independent from all other blocks after removing the special blocks of linking constraints denoted as MASTERCONSS.
Imagine the following example, which involves seven variables and the five constraints from the file above. The asterisks (*) indicate that the variable affects the feasibility of the constraint. In the special case of a linear optimization problem, the asterisks correspond to the nonzero entries of the constraint matrix.
x1 x2 x3 x4 x5 x6 x7 consA * * \ BLOCK 0 consB * * / consC * * \ BLOCK 1 consD * * / linkingconss * * * * * * * > MASTERCONSS
The nonzero pattern has been chosen in a way that after the removal of the last constraint 'linkingcons', the remaining problem consists of two independent parts, namely the blocks '0' and '1'.
The corresponding variable labels are inferred from the constraint labels. A variable is assigned the label
Definition in file reader_dec.c.
#include "scip/pub_dcmp.h"
#include "scip/pub_fileio.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/pub_reader.h"
#include "scip/pub_var.h"
#include "scip/reader_dec.h"
#include "scip/scip_dcmp.h"
#include "scip/scip_general.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_solve.h"
#include "scip/scip_var.h"
#include "scip/scip_mem.h"
#include "scip/type_dcmp.h"
#include <string.h>
Go to the source code of this file.
Macros | |
#define | READER_NAME "decreader" |
#define | READER_DESC "file reader for constraint decompositions" |
#define | READER_EXTENSION "dec" |
Functions | |
static SCIP_RETCODE | readDecomposition (SCIP *scip, const char *filename) |
static | SCIP_DECL_READERCOPY (readerCopyDec) |
static | SCIP_DECL_READERREAD (readerReadDec) |
SCIP_RETCODE | SCIPincludeReaderDec (SCIP *scip) |
#define READER_NAME "decreader" |
Definition at line 96 of file reader_dec.c.
#define READER_DESC "file reader for constraint decompositions" |
Definition at line 97 of file reader_dec.c.
#define READER_EXTENSION "dec" |
Definition at line 98 of file reader_dec.c.
typedef enum Dec_Section DEC_SECTION |
Definition at line 111 of file reader_dec.c.
enum Dec_Section |
Enumerator | |
---|---|
DEC_SECTION_INIT | initial section before the number of blocks is specified |
DEC_SECTION_NBLOCKS | section that contains the number of |
DEC_SECTION_BLOCK | |
DEC_SECTION_MASTER |
Definition at line 105 of file reader_dec.c.
|
static |
reads the given decomposition file
scip | SCIP data structure |
filename | name of the input file |
Definition at line 115 of file reader_dec.c.
References assert(), DEC_SECTION_BLOCK, DEC_SECTION_INIT, DEC_SECTION_MASTER, DEC_SECTION_NBLOCKS, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_CALL_TERMINATE, SCIP_DECOMP_LINKCONS, SCIP_MAXSTRLEN, SCIP_NOFILE, SCIP_OKAY, SCIP_READERROR, SCIP_STAGE_PROBLEM, SCIP_VERBLEVEL_NORMAL, SCIPaddDecomp(), SCIPallocBufferArray, SCIPcomputeDecompStats(), SCIPcomputeDecompVarsLabels(), SCIPcreateDecomp(), SCIPdebugMsg, SCIPdecompPrintStats(), SCIPdecompSetConsLabels(), SCIPerrorMessage, SCIPfclose(), SCIPfeof(), SCIPfgets(), SCIPfindCons(), SCIPfopen(), SCIPfreeBufferArray, SCIPgetBoolParam(), SCIPgetConss(), SCIPgetNConss(), SCIPgetStage(), SCIPprintSysError(), SCIPverbMessage(), SCIPwarningMessage(), and TRUE.
Referenced by SCIP_DECL_READERREAD().
|
static |
copy method for reader plugins (called when SCIP copies plugins)
Definition at line 342 of file reader_dec.c.
References assert(), NULL, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludeReaderDec(), and SCIPreaderGetName().
|
static |
problem reading method of reader
Definition at line 356 of file reader_dec.c.
References assert(), NULL, readDecomposition(), READER_NAME, result, SCIP_CALL, SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_READERROR, SCIP_STAGE_PROBLEM, SCIP_SUCCESS, SCIPerrorMessage, SCIPgetStage(), and SCIPreaderGetName().