CMR  1.3.0
Classes | Functions
regularity_nested_minor_sequence.c File Reference
#include "matroid_internal.h"
#include "regularity_internal.h"
#include "env_internal.h"
#include "densematrix.h"
#include "hashtable.h"
#include <time.h>

Classes

struct  ElementData
 Element specific data for the enumeration of 3-separations. More...
 

Functions

static CMR_ERROR dbgPrintDenseSequence (CMR *cmr, CMR_MATROID_DEC *dec)
 
static CMR_ERROR createHashVector (CMR *cmr, long long **phashVector, size_t size)
 
static CMR_ERROR initializeHashing (CMR *cmr, DenseBinaryMatrix *dense, ElementData *majorData, CMR_LISTHASHTABLE *majorHashtable, size_t numMajors, size_t *processedMinors, size_t numProcessedMinors, long long *hashVector, bool isRow)
 Initializes the hashtable majorHashtable for unprocessed rows/columns. More...
 
static CMR_ERROR updateRepresentative (CMR *cmr, DenseBinaryMatrix *dense, ElementData *majorData, CMR_LISTHASHTABLE *majorHashtable, size_t *processedMinors, size_t numProcessedMinors, size_t majorIndex, bool isRow)
 Ensures that the representative entry for row/column index is correct. More...
 
static CMR_ERROR updateHashtable (CMR *cmr, ElementData *majorData, size_t *processedMajors, size_t numProcessedMajors, CMR_LISTHASHTABLE *majorHashtable)
 
static CMR_ERROR prepareSearch (CMR *cmr, DenseBinaryMatrix *matrix, ElementData *rowData, ElementData *columnData, CMR_ELEMENT *pstartElement)
 
static CMR_ERROR searchShortestPath (CMR *cmr, DenseBinaryMatrix *dense, ElementData *rowData, ElementData *columnData, CMR_ELEMENT *preachedTarget)
 
static CMR_ERROR pivot (CMR *cmr, CMR_MATROID_DEC *dec, size_t pivotRow, size_t pivotColumn)
 Carries out a pivot in the dense matrix of dec. More...
 
static CMR_ERROR applyPivots (CMR *cmr, CMR_MATROID_DEC *dec, ElementData *rowData, ElementData *columnData, CMR_ELEMENT reachedTarget, CMR_ELEMENT *newElements)
 
static CMR_ERROR addElement (CMR *cmr, CMR_MATROID_DEC *dec, ElementData *majorData, ElementData *minorData, CMR_LISTHASHTABLE *minorHashtable, long long *hashVector, size_t numMinor, size_t *processedMajors, size_t *pnumProcessedMajors, size_t newMajor, size_t *nestedMinorsElements, bool isRow)
 
CMR_ERROR CMRregularityExtendNestedMinorSequence (CMR *cmr, DecompositionTask *task, DecompositionQueue *queue)
 Extends an incomplete sequence of nested 3-connected minors for the matrix of a decomposition node. More...
 
CMR_ERROR CMRregularityInitNestedMinorSequence (CMR *cmr, DecompositionTask *task, CMR_SUBMAT *wheelSubmatrix)
 Initializes a sequence of nested minors with one minor, for a given wheelSubmatrix. More...
 

Function Documentation

◆ addElement()

static CMR_ERROR addElement ( CMR cmr,
CMR_MATROID_DEC dec,
ElementData majorData,
ElementData minorData,
CMR_LISTHASHTABLE minorHashtable,
long long *  hashVector,
size_t  numMinor,
size_t *  processedMajors,
size_t *  pnumProcessedMajors,
size_t  newMajor,
size_t *  nestedMinorsElements,
bool  isRow 
)
static
Parameters
cmrCMR environment.
decDecomposition node.
majorDataMajor index data.
minorDataMinor index data.
minorHashtableMinor index hashtable.
hashVectorHash vector.
numMinorNumber of minor indices.
processedMajorsArray of processed major indices.
pnumProcessedMajorsPointer to number of processed major indices.
newMajorMajor index to add.
nestedMinorsElementsMapping from nested minor elements to elements of matrix.
isRowWhether major means row.

◆ applyPivots()

static CMR_ERROR applyPivots ( CMR cmr,
CMR_MATROID_DEC dec,
ElementData rowData,
ElementData columnData,
CMR_ELEMENT  reachedTarget,
CMR_ELEMENT newElements 
)
static
Parameters
cmrCMR environment.
decDecomposition node.
rowDataRow data.
columnDataColumn data.
reachedTargetReached target row/column.
newElementsArray of length 3 for storing the new elements (followed by 0s).

◆ CMRregularityExtendNestedMinorSequence()

CMR_ERROR CMRregularityExtendNestedMinorSequence ( CMR cmr,
DecompositionTask task,
DecompositionQueue queue 
)

Extends an incomplete sequence of nested 3-connected minors for the matrix of a decomposition node.

In case the matrix is not 3-connected, a 2-separation is applied to dec and the function terminates, filling the relevant variables of dec.

Parameters
cmrCMR environment.
taskTask to be processed; already removed from the list of unprocessed tasks.
queueQueue of unprocessed nodes.

◆ CMRregularityInitNestedMinorSequence()

CMR_ERROR CMRregularityInitNestedMinorSequence ( CMR cmr,
DecompositionTask task,
CMR_SUBMAT wheelSubmatrix 
)

Initializes a sequence of nested minors with one minor, for a given wheelSubmatrix.

Parameters
cmrCMR environment.
taskTask to be processed; already removed from the list of unprocessed tasks.
wheelSubmatrixWheel submatrix of task->dec.

◆ createHashVector()

static CMR_ERROR createHashVector ( CMR cmr,
long long **  phashVector,
size_t  size 
)
static
Parameters
cmrCMR environment.
phashVectorPointer for storing the hash vector.
sizeSize of hash vector.

◆ dbgPrintDenseSequence()

static CMR_ERROR dbgPrintDenseSequence ( CMR cmr,
CMR_MATROID_DEC dec 
)
static
Parameters
cmrCMR environment.
decDecomposition node whose dense matrix to print.

◆ initializeHashing()

static CMR_ERROR initializeHashing ( CMR cmr,
DenseBinaryMatrix dense,
ElementData majorData,
CMR_LISTHASHTABLE majorHashtable,
size_t  numMajors,
size_t *  processedMinors,
size_t  numProcessedMinors,
long long *  hashVector,
bool  isRow 
)
static

Initializes the hashtable majorHashtable for unprocessed rows/columns.

Initializes the hashtable majorHashtable for row/column vectors of unprocessed rows/columns with respect to those columns/rows that were already processed.

Parameters
cmrCMR environment.
denseMatrix.
majorDataMajor index data.
majorHashtableMajor index hashtable.
numMajorsNumber of major indices.
processedMinorsArray with processed minor indices.
numProcessedMinorsNumber of processed minor indices.
hashVectorHash vector.
isRowWhether major means row.

◆ pivot()

static CMR_ERROR pivot ( CMR cmr,
CMR_MATROID_DEC dec,
size_t  pivotRow,
size_t  pivotColumn 
)
static

Carries out a pivot in the dense matrix of dec.

Also swaps the element entries of dec->denseRowsOriginal and dec->denseColumnsOriginal.

Parameters
cmrCMR environment.
decdecomposition node.
pivotRowPivot row.
pivotColumnPivot column.

◆ prepareSearch()

static CMR_ERROR prepareSearch ( CMR cmr,
DenseBinaryMatrix matrix,
ElementData rowData,
ElementData columnData,
CMR_ELEMENT pstartElement 
)
static
Parameters
cmrCMR environment.
matrixNested matrix.
rowDataRow data.
columnDataColumn data.
pstartElementPointer for storing an element for starting the search.

◆ searchShortestPath()

static CMR_ERROR searchShortestPath ( CMR cmr,
DenseBinaryMatrix dense,
ElementData rowData,
ElementData columnData,
CMR_ELEMENT preachedTarget 
)
static
Parameters
cmrCMR environment.
denseRemaining matrix.
rowDataRow data.
columnDataColumn data.
preachedTargetPointer for storing the reached target row/column.

◆ updateHashtable()

static CMR_ERROR updateHashtable ( CMR cmr,
ElementData majorData,
size_t *  processedMajors,
size_t  numProcessedMajors,
CMR_LISTHASHTABLE majorHashtable 
)
static
Parameters
cmrCMR environment.
majorDataMajor index data.
processedMajorsArray of processed major indices.
numProcessedMajorsNumber of processed major indices.
majorHashtableMajor index hashtable.

◆ updateRepresentative()

static CMR_ERROR updateRepresentative ( CMR cmr,
DenseBinaryMatrix dense,
ElementData majorData,
CMR_LISTHASHTABLE majorHashtable,
size_t *  processedMinors,
size_t  numProcessedMinors,
size_t  majorIndex,
bool  isRow 
)
static

Ensures that the representative entry for row/column index is correct.

Checks the respective hashtable.

Parameters
cmrCMR environment.
denseMatrix.
majorDataMajor index data.
majorHashtableMajor index hashtable.
processedMinorsArray of processed minor indices.
numProcessedMinorsNumber of processed minor indices.
majorIndexMajor index to update.
isRowWhether major means rows.