Detailed Description
detector for staircase structures via ROC algorithms
This detector is based on Jayakumar, Maliyakal D., and Ranga V. Ramasesh. A clustering heuristic to detect staircase structures in large scale linear programming models. European journal of operational research 76.1 (1994): 229-239.
Definition in file dec_stairheur.cpp.
#include <cassert>#include <cstring>#include <algorithm>#include <vector>#include <iostream>#include "gcg/dec_stairheur.h"#include "gcg/cons_decomp.h"#include "gcg/struct_decomp.h"#include "gcg/pub_decomp.h"#include "gcg/scip_misc.h"#include "scip/pub_misc.h"#include "scip/struct_var.h"#include "gcg/gcg.h"#include "gcg/class_partialdecomp.h"#include "gcg/class_detprobdata.h"#include "scip/clock.h"Go to the source code of this file.
Data Structures | |
| struct | IndexMap |
| struct | GCG_DetectorData |
Macros | |
| #define | DEC_NAME "stairheur" |
| #define | DEC_DESC "detects staircase matrices via matrix reordering" |
| #define | DEC_PRIORITY 1200 |
| #define | DEC_FREQCALLROUND 1 |
| #define | DEC_MAXCALLROUND INT_MAX |
| #define | DEC_MINCALLROUND 0 |
| #define | DEC_FREQCALLROUNDORIGINAL 1 |
| #define | DEC_MAXCALLROUNDORIGINAL INT_MAX |
| #define | DEC_MINCALLROUNDORIGINAL 0 |
| #define | DEC_DECCHAR 's' |
| #define | DEC_ENABLED FALSE |
| #define | DEC_ENABLEDFINISHING FALSE |
| #define | DEC_ENABLEDPOSTPROCESSING FALSE |
| #define | DEC_SKIP FALSE |
| #define | DEC_USEFULRECALL FALSE |
| #define | DEFAULT_NCONSSPERBLOCK 32 |
| #define | DEFAULT_MAXBLOCKS 20 |
| #define | DEFAULT_MINBLOCKS 2 |
| #define | DEFAULT_DESIREDBLOCKS 0 |
| #define | DEFAULT_DYNAMICBLOCKING FALSE |
| #define | DEFAULT_STATICBLOCKING TRUE |
| #define | DEFAULT_BLOCKINGASSOONASPOSSIBLE FALSE |
| #define | DEFAULT_MULTIPLEDECOMPS TRUE |
| #define | DEFAULT_MAXITERATIONSROC 1000000 |
| #define | detectorExitStairheur NULL |
| #define | detectorFinishPartialdecStairheur NULL |
| #define | detectorPostprocessPartialdecStairheur NULL |
Typedefs | |
| typedef struct IndexMap | INDEXMAP |
Functions | |
| void | printnested (vector< vector< int > > l) |
| void | printvector (vector< int > l) |
| static vector< int > | SCIPvectorCreateInt (int from, int to) |
| static void | SCIPvectorRearrange (vector< vector< int > > &l, vector< int > order) |
| static SCIP_RETCODE | indexmapCreate (SCIP *scip, INDEXMAP **indexmap, int nconss, int nvars) |
| static void | indexmapFree (SCIP *scip, INDEXMAP **indexmap) |
| static SCIP_RETCODE | indexmapInit (INDEXMAP *indexmap, gcg::PARTIALDECOMP *partialdec, int *hashmapindices) |
| static SCIP_RETCODE | initData (SCIP *scip, gcg::PARTIALDECOMP *partialdec, GCG_DETECTORDATA *detectordata) |
| static SCIP_RETCODE | freeData (SCIP *scip, GCG_DETECTORDATA *detectordata) |
| static SCIP_RETCODE | createRowindexList (SCIP *scip, gcg::PARTIALDECOMP *partialdec, gcg::DETPROBDATA *detprobdata, GCG_DETECTORDATA *detectordata, SCIP_HASHMAP *indexcons, SCIP_HASHMAP *varindex, vector< vector< int > > &rowindices) |
| static SCIP_RETCODE | createColumnindexList (SCIP *scip, gcg::PARTIALDECOMP *partialdec, vector< vector< int > > &rowindices, vector< vector< int > > &columnindices) |
| static vector< int > | rowOrdering (SCIP *scip, vector< vector< int > > &columnindices, int nrows) |
| static SCIP_RETCODE | formIndexArray (int *begin, int *end, vector< vector< int > > &indices) |
| static SCIP_Bool | arraysAreEqual (int *new_array, int *old_array, int num_elements) |
| static SCIP_RETCODE | rankOrderClusteringIteration (SCIP *scip, gcg::PARTIALDECOMP *partialdec, gcg::DETPROBDATA *detprobdata, GCG_DETECTORDATA *detectordata, INDEXMAP *inputmap, INDEXMAP *outputmap) |
| static SCIP_RETCODE | rankOrderClustering (SCIP *scip, gcg::PARTIALDECOMP *partialdec, gcg::DETPROBDATA *detprobdata, GCG_DETECTORDATA *detectordata, int max_iterations, int *iterations) |
| static SCIP_RETCODE | rowsWithConstriction (SCIP *scip, gcg::PARTIALDECOMP *partialdec, GCG_DETECTORDATA *detectordata) |
| static SCIP_RETCODE | assignConsToBlock (SCIP *scip, gcg::PARTIALDECOMP *partialdec, GCG_DETECTORDATA *detectordata, int block, int first_cons, int last_cons) |
| static int | getMaxColIndex (GCG_DETECTORDATA *detectordata, int from_row, int to_row) |
| static int | getMinColIndex (GCG_DETECTORDATA *detectordata, int row) |
| static SCIP_Bool | isValidBlocking (GCG_DETECTORDATA *detectordata, int prev_block_first_row, int prev_block_last_row, int block_at_row) |
| static vector< int >::iterator | findBlockingCandidate (vector< int >::iterator it_constrictions, vector< int > *it_vector, int min_block_size, int prev_block_last_row) |
| static vector< int >::iterator | nextRowToBlockAt (GCG_DETECTORDATA *detectordata, vector< int >::iterator it_constrictions, vector< int > *it_vector, int min_block_size, int prev_block_first_row, int prev_block_last_row) |
| static int | calculateNdecompositions (GCG_DETECTORDATA *detectordata) |
| static void | checkParameterConsistency (SCIP *scip, GCG_DETECTORDATA *detectordata, SCIP_RESULT *result) |
| static SCIP_RETCODE | blockingDynamic (SCIP *scip, gcg::PARTIALDECOMP *partialdec, GCG_DETECTORDATA *detectordata, int tau, int nvars) |
| static SCIP_RETCODE | blockingStatic (SCIP *scip, gcg::PARTIALDECOMP *partialdec, GCG_DETECTORDATA *detectordata) |
| static SCIP_RETCODE | blockingAsSoonAsPossible (SCIP *scip, GCG_DETECTORDATA *detectordata, int desired_blocks, int nvars) |
| static SCIP_RETCODE | resetDetectordata (SCIP *scip, GCG_DETECTORDATA *detectordata) |
| static SCIP_RETCODE | blocking (SCIP *scip, GCG_DETECTORDATA *detectordata, gcg::PARTIALDECOMP *partialdec, PARTIALDEC_DETECTION_DATA *detectiondata, SCIP_Real time, int maxndecs, SCIP_RESULT *result) |
| static | GCG_DECL_FREEDETECTOR (detectorFreeStairheur) |
| static | GCG_DECL_INITDETECTOR (detectorInitStairheur) |
| static | GCG_DECL_PROPAGATEPARTIALDEC (detectorPropagatePartialdecStairheur) |
| static | GCG_DECL_SETPARAMFAST (setParamAggressiveStairheur) |
| static | GCG_DECL_SETPARAMFAST (setParamDefaultStairheur) |
| static | GCG_DECL_SETPARAMFAST (setParamFastStairheur) |
| SCIP_RETCODE | GCGincludeDetectorStairheur (GCG *gcg) |
Macro Definition Documentation
◆ DEC_NAME
| #define DEC_NAME "stairheur" |
name of the detector
Definition at line 60 of file dec_stairheur.cpp.
◆ DEC_DESC
| #define DEC_DESC "detects staircase matrices via matrix reordering" |
detector description
Definition at line 61 of file dec_stairheur.cpp.
◆ DEC_PRIORITY
| #define DEC_PRIORITY 1200 |
priority of the detector
Definition at line 62 of file dec_stairheur.cpp.
◆ DEC_FREQCALLROUND
| #define DEC_FREQCALLROUND 1 |
frequency the detector gets called in detection loop ,ie it is called in round r if and only if minCallRound <= r <= maxCallRound AND (r - minCallRound) mod freqCallRound == 0
Definition at line 63 of file dec_stairheur.cpp.
◆ DEC_MAXCALLROUND
| #define DEC_MAXCALLROUND INT_MAX |
last round the detector gets called
Definition at line 64 of file dec_stairheur.cpp.
◆ DEC_MINCALLROUND
| #define DEC_MINCALLROUND 0 |
first round the detector gets called
Definition at line 65 of file dec_stairheur.cpp.
◆ DEC_FREQCALLROUNDORIGINAL
| #define DEC_FREQCALLROUNDORIGINAL 1 |
frequency the detector gets called in detection loop while detecting the original problem
Definition at line 66 of file dec_stairheur.cpp.
◆ DEC_MAXCALLROUNDORIGINAL
| #define DEC_MAXCALLROUNDORIGINAL INT_MAX |
last round the detector gets called while detecting the original problem
Definition at line 67 of file dec_stairheur.cpp.
◆ DEC_MINCALLROUNDORIGINAL
| #define DEC_MINCALLROUNDORIGINAL 0 |
first round the detector gets called while detecting the original problem
Definition at line 68 of file dec_stairheur.cpp.
◆ DEC_DECCHAR
| #define DEC_DECCHAR 's' |
display character of detector
Definition at line 69 of file dec_stairheur.cpp.
◆ DEC_ENABLED
| #define DEC_ENABLED FALSE |
should detector be called by default
Definition at line 70 of file dec_stairheur.cpp.
◆ DEC_ENABLEDFINISHING
| #define DEC_ENABLEDFINISHING FALSE |
should the finishing be enabled
Definition at line 71 of file dec_stairheur.cpp.
◆ DEC_ENABLEDPOSTPROCESSING
| #define DEC_ENABLEDPOSTPROCESSING FALSE |
should the postprocessing be enabled
Definition at line 72 of file dec_stairheur.cpp.
◆ DEC_SKIP
| #define DEC_SKIP FALSE |
should detector be skipped if others found detections
Definition at line 73 of file dec_stairheur.cpp.
◆ DEC_USEFULRECALL
| #define DEC_USEFULRECALL FALSE |
is it useful to call this detector on a descendant of the propagated partialdec
Definition at line 74 of file dec_stairheur.cpp.
◆ DEFAULT_NCONSSPERBLOCK
| #define DEFAULT_NCONSSPERBLOCK 32 |
number of constraints per block (static blocking only)
Definition at line 77 of file dec_stairheur.cpp.
◆ DEFAULT_MAXBLOCKS
| #define DEFAULT_MAXBLOCKS 20 |
value for the maximum number of blocks to be considered
Definition at line 78 of file dec_stairheur.cpp.
◆ DEFAULT_MINBLOCKS
| #define DEFAULT_MINBLOCKS 2 |
value for the minimum number of blocks to be considered
Definition at line 79 of file dec_stairheur.cpp.
◆ DEFAULT_DESIREDBLOCKS
| #define DEFAULT_DESIREDBLOCKS 0 |
value for the desired number of blocks (for all blocking types). Set to zero for self determination of block number
Definition at line 80 of file dec_stairheur.cpp.
◆ DEFAULT_DYNAMICBLOCKING
| #define DEFAULT_DYNAMICBLOCKING FALSE |
Enable blocking type 'dynamic'
Definition at line 81 of file dec_stairheur.cpp.
◆ DEFAULT_STATICBLOCKING
| #define DEFAULT_STATICBLOCKING TRUE |
Enable blocking type 'static'
Definition at line 82 of file dec_stairheur.cpp.
◆ DEFAULT_BLOCKINGASSOONASPOSSIBLE
| #define DEFAULT_BLOCKINGASSOONASPOSSIBLE FALSE |
Enable blocking type 'as soon as possible'
Definition at line 83 of file dec_stairheur.cpp.
◆ DEFAULT_MULTIPLEDECOMPS
| #define DEFAULT_MULTIPLEDECOMPS TRUE |
Enables multiple decompositions for all enabled blocking types. Ranging from minblocks to maxblocks'
Definition at line 84 of file dec_stairheur.cpp.
◆ DEFAULT_MAXITERATIONSROC
| #define DEFAULT_MAXITERATIONSROC 1000000 |
The maximum of iterations of the ROC-algorithm. -1 for no iteration limit
Definition at line 85 of file dec_stairheur.cpp.
◆ detectorExitStairheur
| #define detectorExitStairheur NULL |
Definition at line 1794 of file dec_stairheur.cpp.
◆ detectorFinishPartialdecStairheur
| #define detectorFinishPartialdecStairheur NULL |
Definition at line 1795 of file dec_stairheur.cpp.
◆ detectorPostprocessPartialdecStairheur
| #define detectorPostprocessPartialdecStairheur NULL |
Definition at line 1796 of file dec_stairheur.cpp.
Typedef Documentation
◆ INDEXMAP
Definition at line 110 of file dec_stairheur.cpp.
Function Documentation
◆ printnested()
| void printnested | ( | vector< vector< int > > | l | ) |
Definition at line 148 of file dec_stairheur.cpp.
References SCIPdebugPrintf.
◆ printvector()
| void printvector | ( | vector< int > | l | ) |
Definition at line 167 of file dec_stairheur.cpp.
References SCIPdebugPrintf.
◆ SCIPvectorCreateInt()
|
static |
TODO: currently, all vars from the first column where a linking var appears until the end of the block are considered as linking vars, although there might be empty columns. This could be changed so that these empty columns are considered as subscipvars and not linking vars.
In some cases a block can consist of linking vars exclusively. This makes no real sense.
For some instances the assertion regarding the consistency of the arrays ibegin and jbegin fails creates a list with integers running from 'from' to 'to'.
- Parameters
-
from Start index to End index
Definition at line 190 of file dec_stairheur.cpp.
Referenced by rowOrdering().
◆ SCIPvectorRearrange()
|
static |
rearranges elements of vector according to the ordering of order.
example: vector = (a b c d); order = (3 2 4 1) after calling SCIPvectorRearrange(vector, order): vector = (c b d a) both vectors must have the same size order must have elements from 1 to vector->size
Definition at line 212 of file dec_stairheur.cpp.
Referenced by rankOrderClusteringIteration().
◆ indexmapCreate()
|
static |
allocates memory for an indexmap.
- Parameters
-
scip SCIP data structure indexmap address of the pointer which shall store the index map nconss number of constraints nvars number of variables
Definition at line 231 of file dec_stairheur.cpp.
References IndexMap::consindex, IndexMap::indexcons, IndexMap::indexvar, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocMemory, SCIPblkmem(), SCIPhashmapCreate(), and IndexMap::varindex.
Referenced by initData(), and rankOrderClustering().
◆ indexmapFree()
deallocates memory of indexmap.
- Parameters
-
scip SCIP data structure indexmap index map
Definition at line 256 of file dec_stairheur.cpp.
References SCIPfreeMemory, and SCIPhashmapFree().
Referenced by freeData(), and rankOrderClustering().
◆ indexmapInit()
|
static |
initialization method for the indexmap for partialdecs
- Parameters
-
indexmap index map partialdec partial decomposition to create indexmap for hashmapindices indices of variables and constraints
Definition at line 271 of file dec_stairheur.cpp.
References IndexMap::consindex, gcg::PARTIALDECOMP::getNOpenconss(), gcg::PARTIALDECOMP::getNOpenvars(), gcg::PARTIALDECOMP::getOpenconss(), gcg::PARTIALDECOMP::getOpenvars(), IndexMap::indexcons, IndexMap::indexvar, SCIP_CALL, SCIP_OKAY, SCIPhashmapExists(), SCIPhashmapInsert(), and IndexMap::varindex.
Referenced by GCG_DECL_PROPAGATEPARTIALDEC(), and rankOrderClustering().
◆ initData()
|
static |
initialization method of detector data for partialdecs
- Parameters
-
scip SCIP data structure partialdec partial decomposition to use for initialization detectordata detector data structure
Definition at line 487 of file dec_stairheur.cpp.
References GCG_DetectorData::blockedAfterrow, gcg::PARTIALDECOMP::getNOpenconss(), gcg::PARTIALDECOMP::getNOpenvars(), GCG_DetectorData::hashmapindices, GCG_DetectorData::ibegin, GCG_DetectorData::iend, GCG_DetectorData::indexmap, indexmapCreate(), GCG_DetectorData::jbegin, GCG_DetectorData::jend, GCG_DetectorData::jmax, GCG_DetectorData::jmin, MAX, GCG_DetectorData::maxblocks, MIN, GCG_DetectorData::minblocks, GCG_DetectorData::minV, NULL, GCG_DetectorData::rowsWithConstrictions, SCIP_CALL, SCIP_OKAY, SCIPallocMemoryArray, GCG_DetectorData::usermaxblocks, GCG_DetectorData::userminblocks, and GCG_DetectorData::width.
Referenced by GCG_DECL_PROPAGATEPARTIALDEC().
◆ freeData()
|
static |
deinitialization method of detector data (called after detection has been finished)
- Parameters
-
scip SCIP data structure detectordata detector data structure
Definition at line 529 of file dec_stairheur.cpp.
References GCG_DetectorData::blockedAfterrow, GCG_DetectorData::constoblock, GCG_DetectorData::hashmapindices, GCG_DetectorData::ibegin, GCG_DetectorData::iend, GCG_DetectorData::indexmap, indexmapFree(), GCG_DetectorData::jbegin, GCG_DetectorData::jend, GCG_DetectorData::jmax, GCG_DetectorData::jmin, GCG_DetectorData::minV, NULL, GCG_DetectorData::rowsWithConstrictions, SCIP_OKAY, SCIPfreeMemoryArray, SCIPhashmapFree(), and GCG_DetectorData::width.
Referenced by GCG_DECL_PROPAGATEPARTIALDEC().
◆ createRowindexList()
|
static |
creates a nested vector with the indices of the nonzero entries of each row.
example: constraint matrix:
1 1 0 1 0
0 1 1 0 0
0 0 0 0 1
resulting vector: ( (1 2 4) (2 3) (5) )
- Parameters
-
scip SCIP data structure partialdec partial decomposition to use for matrix detprobdata detection process information and data detectordata detector data data structure indexcons hashmap index -> constraint varindex hashmap variable -> index rowindices vector to store the row indices vector
Definition at line 582 of file dec_stairheur.cpp.
References gcg::PARTIALDECOMP::getNOpenconss(), gcg::DETPROBDATA::getNVarsForCons(), gcg::DETPROBDATA::getVarsForCons(), GCG_DetectorData::hashmapindices, gcg::PARTIALDECOMP::isVarOpenvar(), NULL, SCIP_CALL, SCIP_OKAY, SCIPallocClearBufferArray, SCIPfreeBufferArray, and SCIPhashmapGetImage().
Referenced by GCG_DECL_PROPAGATEPARTIALDEC(), rankOrderClustering(), and rankOrderClusteringIteration().
◆ createColumnindexList()
|
static |
creates a nested vector with the indices of the nonzero entries of each column.
example:
constraint matrix:
1 1 0 1 0
0 1 1 0 0
0 0 0 0 1
resulting vector: ( (1) (1 2) (2) (1) (3) )
- Parameters
-
scip SCIP data structure partialdec partial decomposition to create column index for rowindices A vector with the row indices (achieved from calling rowindices_vector() ) columnindices vector to store the column indices vector
Definition at line 658 of file dec_stairheur.cpp.
References gcg::PARTIALDECOMP::getNOpenvars(), and SCIP_OKAY.
Referenced by GCG_DECL_PROPAGATEPARTIALDEC(), rankOrderClustering(), and rankOrderClusteringIteration().
◆ rowOrdering()
|
static |
does the row ordering of the ROC2 algorithm.
It also works for the column ordering. In this case the terms row<->column have to be exchanged.
- Returns
- A vector with the new row order. E.g. (2 3 1) means the second row comes first now, and so on.
- Parameters
-
scip SCIP data structure columnindices A vector of the nonzero entries in each column nrows The number of rows of the constraint matrix (=number of relevant constraints)
Definition at line 699 of file dec_stairheur.cpp.
References SCIPvectorCreateInt().
Referenced by rankOrderClusteringIteration().
◆ formIndexArray()
|
static |
stores the first and last entry of the i-th column(row) in begin[i] and end[i] respectively.
- Parameters
-
begin Array to store the first nonzero entry of the i-th column (row) end Array to store the last nonzero entry of the i-th column (row) indices columnindices vector (rowindices vector)
Definition at line 738 of file dec_stairheur.cpp.
References NULL, and SCIP_OKAY.
Referenced by GCG_DECL_PROPAGATEPARTIALDEC(), and rankOrderClustering().
◆ arraysAreEqual()
|
static |
returns FALSE if at least one entry of new_array and old_array are different.
- Parameters
-
new_array new array old_array old array num_elements length of arrays
Definition at line 768 of file dec_stairheur.cpp.
References FALSE, SCIP_Bool, and TRUE.
Referenced by rankOrderClustering().
◆ rankOrderClusteringIteration()
|
static |
permutes the order of rows and columns in inputmap and stores the result in outputmap.
One call of this function is equivalent to one iteration of the ROC2-algortihm.
- Parameters
-
scip SCIP data structure partialdec partial decomposition to use for permutation detprobdata detection process information and data detectordata detector data data structure inputmap indexmap for input outputmap indexmap for output
Definition at line 791 of file dec_stairheur.cpp.
References IndexMap::consindex, createColumnindexList(), createRowindexList(), gcg::PARTIALDECOMP::getNOpenconss(), gcg::PARTIALDECOMP::getNOpenvars(), GCG_DetectorData::hashmapindices, IndexMap::indexcons, IndexMap::indexvar, NULL, rowOrdering(), SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPhashmapExists(), SCIPhashmapGetImage(), SCIPhashmapSetImage(), SCIPvectorRearrange(), and IndexMap::varindex.
Referenced by rankOrderClustering().
◆ rankOrderClustering()
|
static |
- Parameters
-
scip SCIP data structure partialdec partial decomposition to use for clustering detprobdata detection process information and data detectordata detector data structure max_iterations number of maximal iterations iterations number of performed iterations
Definition at line 871 of file dec_stairheur.cpp.
References arraysAreEqual(), createColumnindexList(), createRowindexList(), formIndexArray(), gcg::PARTIALDECOMP::getNOpenconss(), gcg::PARTIALDECOMP::getNOpenvars(), GCG_DetectorData::hashmapindices, GCG_DetectorData::ibegin, GCG_DetectorData::iend, IndexMap::indexcons, GCG_DetectorData::indexmap, indexmapCreate(), indexmapFree(), indexmapInit(), GCG_DetectorData::jbegin, GCG_DetectorData::jend, NULL, rankOrderClusteringIteration(), SCIP_CALL, SCIP_OKAY, SCIPallocMemoryArray, SCIPdebugMessage, SCIPfreeMemoryArray, and IndexMap::varindex.
Referenced by GCG_DECL_PROPAGATEPARTIALDEC().
◆ rowsWithConstriction()
|
static |
finds rows with local minima regarding the number of linking variables and stores them in detectordata->rowsWithConstrictions
- Parameters
-
scip SCIP data structure partialdec partial decomposition to use detectordata detector data structure
Definition at line 961 of file dec_stairheur.cpp.
References gcg::PARTIALDECOMP::getNOpenconss(), GCG_DetectorData::minV, GCG_DetectorData::rowsWithConstrictions, and SCIP_OKAY.
Referenced by blocking().
◆ assignConsToBlock()
|
static |
assigns constraints in the interval [first_cons, last_cons] to 'block'. (for partialdecs)
- Parameters
-
scip SCIP data structure partialdec partial decomposition to use detectordata detector data structure block id of block first_cons index of first constraint to assign last_cons index of last constraint to assign
Definition at line 984 of file dec_stairheur.cpp.
References GCG_DetectorData::blockedAfterrow, GCG_DetectorData::constoblock, GCG_DetectorData::hashmapindices, IndexMap::indexcons, GCG_DetectorData::indexmap, SCIP_CALL, SCIP_OKAY, SCIPhashmapExists(), SCIPhashmapGetImage(), and SCIPhashmapInsert().
Referenced by blockingDynamic(), and blockingStatic().
◆ getMaxColIndex()
|
static |
returns the largest column index of a nonzero entry between rows [from_row, to_row]
- Parameters
-
detectordata detector data structure from_row index of starting row to check to_row index of last row to check
Definition at line 1010 of file dec_stairheur.cpp.
References GCG_DetectorData::iend.
Referenced by blockingDynamic(), and isValidBlocking().
◆ getMinColIndex()
|
static |
returns the column index of the first nonzero entry in 'row'. Rows start counting at 1, not 0.
- Parameters
-
detectordata detector data structure row index of row
Definition at line 1022 of file dec_stairheur.cpp.
References GCG_DetectorData::ibegin.
Referenced by blockingDynamic(), and isValidBlocking().
◆ isValidBlocking()
|
static |
determines if a blocking at 'block_at_row' is a valid blocking
- Returns
- TRUE if blocking is valid, else FALSE
- Parameters
-
detectordata detector data structure prev_block_first_row first row of the previous block prev_block_last_row last row of the previous block block_at_row the row for which you want to determine if the blocking is valid
Definition at line 1035 of file dec_stairheur.cpp.
References FALSE, getMaxColIndex(), getMinColIndex(), SCIP_Bool, and TRUE.
Referenced by nextRowToBlockAt().
◆ findBlockingCandidate()
|
static |
this functions looks for rows to block at, which creates block of size min_block_size or bigger
- Returns
- Iterator pointing to a node which contains a suitable row for blocking; If the iterator points after the last element, no candidate was found
- Parameters
-
it_constrictions Iterator pointing to a vector of constraints (detectordata->rowsWithConstrictions) it_vector minimum number of rows to be in a block min_block_size the last row of the preceding block prev_block_last_row the last row of the preceding block
Definition at line 1060 of file dec_stairheur.cpp.
Referenced by nextRowToBlockAt().
◆ nextRowToBlockAt()
|
static |
this functions determines the next row to block at
- Returns
- Iterator pointing to a node which contains a suitable row for blocking; If the iterator points after the last element, no row was found
- Parameters
-
detectordata detector data structure it_constrictions Iterator pointing to a vector of constraints (detectordata->rowsWithConstrictions) it_vector vector of constrictions min_block_size minimum number of rows to be in a block prev_block_first_row the first row of the preceding block prev_block_last_row the last row of the preceding block
Definition at line 1089 of file dec_stairheur.cpp.
References findBlockingCandidate(), and isValidBlocking().
Referenced by blockingDynamic().
◆ calculateNdecompositions()
|
static |
calculate the number of decompositions in order to allocate decomps array
- Parameters
-
detectordata detector data structure
Definition at line 1134 of file dec_stairheur.cpp.
References GCG_DetectorData::blockingassoonaspossible, GCG_DetectorData::dynamicblocking, GCG_DetectorData::maxblocks, GCG_DetectorData::minblocks, GCG_DetectorData::multipledecomps, and GCG_DetectorData::staticblocking.
Referenced by GCG_DECL_PROPAGATEPARTIALDEC().
◆ checkParameterConsistency()
|
static |
check the consistency of the parameters
- Parameters
-
scip SCIP data structure detectordata detector data structure result pointer to store result
Definition at line 1171 of file dec_stairheur.cpp.
References GCG_DetectorData::blockingassoonaspossible, GCG_DetectorData::dynamicblocking, GCG_DetectorData::maxblocks, GCG_DetectorData::minblocks, GCG_DetectorData::multipledecomps, SCIP_DIDNOTRUN, SCIPwarningMessage(), and GCG_DetectorData::staticblocking.
Referenced by GCG_DECL_PROPAGATEPARTIALDEC().
◆ blockingDynamic()
|
static |
tries to dynamically divide the problem into subproblems (blocks)
- Parameters
-
scip SCIP data structure partialdec partial decomposition to use detectordata detector data data structure tau desired number of blocks nvars number of variables in the problem
Definition at line 1198 of file dec_stairheur.cpp.
References assignConsToBlock(), GCG_DetectorData::blockedAfterrow, GCG_DetectorData::blocks, getMaxColIndex(), getMinColIndex(), gcg::PARTIALDECOMP::getNOpenconss(), GCG_DetectorData::maxblocks, nextRowToBlockAt(), GCG_DetectorData::rowsWithConstrictions, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPgetNConss(), and SCIPround().
Referenced by blocking().
◆ blockingStatic()
|
static |
creates blocks with the same number of rows (for partialdecs)
- Parameters
-
scip SCIP data structure partialdec partial decomposition to create block in detectordata detector data data structure
Definition at line 1274 of file dec_stairheur.cpp.
References assignConsToBlock(), GCG_DetectorData::blockedAfterrow, GCG_DetectorData::blocks, gcg::PARTIALDECOMP::getNOpenconss(), GCG_DetectorData::nconssperblock, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIPgetNConss().
Referenced by blocking().
◆ blockingAsSoonAsPossible()
|
static |
- Parameters
-
scip SCIP data structure detectordata detector data data structure desired_blocks desired number of blocks nvars number of variables in the problem
Definition at line 1332 of file dec_stairheur.cpp.
References GCG_DetectorData::blocks, and SCIP_OKAY.
Referenced by blocking().
◆ resetDetectordata()
|
static |
resets detectordata such that it can be used for the next decomposition
- Parameters
-
scip SCIP data structure detectordata detector data structure
Definition at line 1348 of file dec_stairheur.cpp.
References GCG_DetectorData::constoblock, NULL, SCIP_CALL, SCIP_OKAY, SCIPblkmem(), SCIPgetNConss(), SCIPhashmapCreate(), and SCIPhashmapRemoveAll().
Referenced by blocking().
◆ blocking()
|
static |
- Parameters
-
scip SCIP data structure detectordata detector data structure partialdec partialdec to propagate detectiondata detection data time previous time maxndecs capacity of detectiondata->newpartialdecs result pointer to store result
Definition at line 1365 of file dec_stairheur.cpp.
References gcg::PARTIALDECOMP::addClockTime(), gcg::PARTIALDECOMP::addDetectorChainInfo(), gcg::PARTIALDECOMP::assignCurrentStairlinking(), gcg::PARTIALDECOMP::assignPartialdecFromConstoblock(), GCG_DetectorData::blockingassoonaspossible, blockingAsSoonAsPossible(), blockingDynamic(), blockingStatic(), GCG_DetectorData::blocks, GCG_DetectorData::constoblock, GCG_DetectorData::desiredblocks, GCG_DetectorData::dynamicblocking, FALSE, gcg::PARTIALDECOMP::getNOpenconss(), gcg::PARTIALDECOMP::getNOpenvars(), GCG_DetectorData::maxblocks, GCG_DetectorData::minblocks, GCG_DetectorData::multipledecomps, GCG_DetectorData::nconssperblock, Partialdec_Detection_Data::newpartialdecs, Partialdec_Detection_Data::nnewpartialdecs, NULL, resetDetectordata(), rowsWithConstriction(), SCIP_CALL, SCIP_CALL_ABORT, SCIP_DIDNOTFIND, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIPcreateClock(), SCIPdebugMessage, SCIPfreeClock(), SCIPgetClockTime(), SCIPhashmapFree(), SCIPresetClock(), SCIPround(), SCIPsnprintf(), SCIPstartClock(), SCIPstopClock(), GCG_DetectorData::staticblocking, and GCG_DetectorData::width.
Referenced by GCG_DECL_PROPAGATEPARTIALDEC().
◆ GCG_DECL_FREEDETECTOR()
|
static |
destructor of detector to free user data (called when GCG is exiting)
Definition at line 1624 of file dec_stairheur.cpp.
References GCG_DetectorData::constoblock, DEC_NAME, GCGdetectorGetData(), GCGdetectorGetName(), GCGgetOrigprob(), NULL, SCIP_OKAY, SCIPfreeMemory, and SCIPhashmapFree().
◆ GCG_DECL_INITDETECTOR()
|
static |
detector initialization method (called after problem was transformed)
Definition at line 1645 of file dec_stairheur.cpp.
References GCG_DetectorData::blockedAfterrow, GCG_DetectorData::constoblock, GCGdetectorGetData(), GCG_DetectorData::hashmapindices, GCG_DetectorData::ibegin, GCG_DetectorData::iend, GCG_DetectorData::indexmap, GCG_DetectorData::jbegin, GCG_DetectorData::jend, GCG_DetectorData::jmax, GCG_DetectorData::jmin, GCG_DetectorData::minV, NULL, GCG_DetectorData::rowsWithConstrictions, SCIP_OKAY, and GCG_DetectorData::width.
◆ GCG_DECL_PROPAGATEPARTIALDEC()
|
static |
Definition at line 1670 of file dec_stairheur.cpp.
References blocking(), calculateNdecompositions(), checkParameterConsistency(), createColumnindexList(), createRowindexList(), formIndexArray(), freeData(), GCGdetectorGetData(), GCGgetOrigprob(), gcg::PARTIALDECOMP::getNOpenconss(), gcg::PARTIALDECOMP::getNOpenvars(), GCG_DetectorData::hashmapindices, GCG_DetectorData::ibegin, GCG_DetectorData::iend, IndexMap::indexcons, GCG_DetectorData::indexmap, indexmapInit(), initData(), GCG_DetectorData::jbegin, GCG_DetectorData::jend, GCG_DetectorData::jmax, GCG_DetectorData::jmin, MAX, GCG_DetectorData::maxiterationsROC, GCG_DetectorData::minV, NULL, rankOrderClustering(), gcg::PARTIALDECOMP::refineToMaster(), SCIP_CALL, SCIP_CALL_ABORT, SCIP_OKAY, SCIP_Real, SCIP_SUCCESS, SCIP_VERBLEVEL_NORMAL, SCIPallocMemoryArray, SCIPcreateClock(), SCIPdebugMessage, SCIPfreeClock(), SCIPgetClockTime(), SCIPreallocMemoryArray, SCIPstartClock(), SCIPstopClock(), SCIPverbMessage(), SCIPwarningMessage(), IndexMap::varindex, and GCG_DetectorData::width.
◆ GCG_DECL_SETPARAMFAST() [1/3]
|
static |
Definition at line 1800 of file dec_stairheur.cpp.
References FALSE, GCGdetectorGetName(), GCGgetOrigprob(), SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPsetBoolParam(), SCIPsnprintf(), and TRUE.
◆ GCG_DECL_SETPARAMFAST() [2/3]
|
static |
Definition at line 1817 of file dec_stairheur.cpp.
References DEC_ENABLED, DEC_ENABLEDFINISHING, GCGdetectorGetName(), GCGgetOrigprob(), SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPsetBoolParam(), and SCIPsnprintf().
◆ GCG_DECL_SETPARAMFAST() [3/3]
|
static |
Definition at line 1834 of file dec_stairheur.cpp.
References FALSE, GCGdetectorGetName(), GCGgetOrigprob(), SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPsetBoolParam(), and SCIPsnprintf().
◆ GCGincludeDetectorStairheur()
| SCIP_RETCODE GCGincludeDetectorStairheur | ( | GCG * | gcg | ) |
creates the stairheur detector and includes it in SCIP
- Parameters
-
gcg GCG data structure
Definition at line 1853 of file dec_stairheur.cpp.
References GCG_DetectorData::blockingassoonaspossible, GCG_DetectorData::constoblock, DEC_DECCHAR, DEC_DESC, DEC_ENABLED, DEC_ENABLEDFINISHING, DEC_ENABLEDPOSTPROCESSING, DEC_FREQCALLROUND, DEC_FREQCALLROUNDORIGINAL, DEC_MAXCALLROUND, DEC_MAXCALLROUNDORIGINAL, DEC_MINCALLROUND, DEC_MINCALLROUNDORIGINAL, DEC_NAME, DEC_PRIORITY, DEC_SKIP, DEC_USEFULRECALL, DEFAULT_BLOCKINGASSOONASPOSSIBLE, DEFAULT_DESIREDBLOCKS, DEFAULT_DYNAMICBLOCKING, DEFAULT_MAXBLOCKS, DEFAULT_MAXITERATIONSROC, DEFAULT_MINBLOCKS, DEFAULT_MULTIPLEDECOMPS, DEFAULT_NCONSSPERBLOCK, DEFAULT_STATICBLOCKING, GCG_DetectorData::desiredblocks, detectorExitStairheur, detectorFinishPartialdecStairheur, detectorPostprocessPartialdecStairheur, GCG_DetectorData::dynamicblocking, FALSE, GCGgetOrigprob(), GCGincludeDetector(), GCG_DetectorData::maxiterationsROC, GCG_DetectorData::multipledecomps, GCG_DetectorData::nconssperblock, NULL, SCIP_CALL, SCIP_OKAY, SCIPaddBoolParam(), SCIPaddIntParam(), SCIPallocMemory, GCG_DetectorData::staticblocking, GCG_DetectorData::usermaxblocks, and GCG_DetectorData::userminblocks.
Referenced by GCGincludeGcgPlugins().