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

Classes

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

Functions

static bool findRank1 (CMR_CHRMAT *matrix, ElementData *rowData, ElementData *columnData, size_t rowRepresentative[2][2], size_t columnRepresentative[2][2], short part)
 Checks whether the submatrix with rows assigned to part and columns assigned to the other has at least rank 1. More...
 
static bool findRank2 (CMR_CHRMAT *matrix, ElementData *rowData, ElementData *columnData, size_t rowRepresentative[2][2], size_t columnRepresentative[2][2], short part)
 Checks whether the submatrix with rows assigned to part and columns assigned to the other has at least rank 2. More...
 
static bool findRank3 (CMR_CHRMAT *matrix, ElementData *rowData, ElementData *columnData, size_t rowRepresentative[2][2], short part)
 Checks whether the submatrix with rows assigned to part and columns assigned to the other has at least rank 3. More...
 
static void determineType (CMR_CHRMAT *matrix, ElementData *rowData, ElementData *columnData, size_t rowRepresentative[2][2], size_t row, short part, bool isRow)
 Checks whether the given row can be attached to part. More...
 
static bool assignRow (CMR_CHRMAT *matrix, ElementData *rowData, ElementData *columnData, size_t columnRepresentative[2][2], CMR_ELEMENT *queue, size_t *pqueueBeyond, size_t row, short part, bool isRow)
 Assigns row to part, updating rowData and columnData. More...
 
static CMR_ERROR extendMinorSeparation (CMR *cmr, CMR_CHRMAT *matrix, CMR_CHRMAT *transpose, ElementData *rowData, ElementData *columnData, size_t *partRows[2], size_t partNumRows[2], size_t *partColumns[2], size_t partNumColumns[2], CMR_ELEMENT *queue, CMR_SEPA **pseparation)
 
CMR_ERROR CMRregularityNestedMinorSequenceSearchThreeSeparation (CMR *cmr, DecompositionTask *task, DecompositionQueue *queue)
 Searches for 3-separations along the sequence of nested minors and decomposes as a 3-sum. More...
 

Function Documentation

◆ assignRow()

static bool assignRow ( CMR_CHRMAT matrix,
ElementData rowData,
ElementData columnData,
size_t  columnRepresentative[2][2],
CMR_ELEMENT queue,
size_t *  pqueueBeyond,
size_t  row,
short  part,
bool  isRow 
)
static

Assigns row to part, updating rowData and columnData.

Returns
true if one of the unassigned columns cannot be assigned to any part.
Parameters
matrixMatrix.
rowDataRow element data.
columnDataColumn element data.
columnRepresentativeColumn representatives for each part.
queueQueue.
pqueueBeyondPointer for the end of the queue.
rowRow to be added.
partPart the row is to be added to.
isRowWhether we're actually assigning a row.

◆ CMRregularityNestedMinorSequenceSearchThreeSeparation()

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

Searches for 3-separations along the sequence of nested minors and decomposes as a 3-sum.

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

◆ determineType()

static void determineType ( CMR_CHRMAT matrix,
ElementData rowData,
ElementData columnData,
size_t  rowRepresentative[2][2],
size_t  row,
short  part,
bool  isRow 
)
static

Checks whether the given row can be attached to part.

Parameters
matrixMatrix.
rowDataRow element data.
columnDataColumn element data.
rowRepresentativeRow representatives for each part.
rowRow index to check.
partPart to which the investigated rows belong.
isRowWhether we're actually dealing with rows.

◆ extendMinorSeparation()

static CMR_ERROR extendMinorSeparation ( CMR cmr,
CMR_CHRMAT matrix,
CMR_CHRMAT transpose,
ElementData rowData,
ElementData columnData,
size_t *  partRows[2],
size_t  partNumRows[2],
size_t *  partColumns[2],
size_t  partNumColumns[2],
CMR_ELEMENT queue,
CMR_SEPA **  pseparation 
)
static
Parameters
cmrCMR environment.
matrixMatrix.
transposeTranspose of matrix.
rowDataRow element data.
columnDataColumn element data.
partRowsFor each part, an array with its already assigned rows.
partNumRowsFor each part, the number of already assigned rows.
partColumnsFor each part, an array with its already assigned columns.
partNumColumnsFor each part, the number of already assigned columns.
queueMemory for a queue of elements.
pseparationPointer for storing the 3-separation or NULL if none was found.

◆ findRank1()

static bool findRank1 ( CMR_CHRMAT matrix,
ElementData rowData,
ElementData columnData,
size_t  rowRepresentative[2][2],
size_t  columnRepresentative[2][2],
short  part 
)
static

Checks whether the submatrix with rows assigned to part and columns assigned to the other has at least rank 1.

If the rank is at least 1, the row and column of a corresponding nonzero are stored in rowRepresentative and columnRepresentative, respectively.

Parameters
matrixMatrix.
rowDataRow element data.
columnDataColumn element data.
rowRepresentativeRow representatives for each part.
columnRepresentativeColumn representatives for each part.
partPart to which the investigated rows belong.

◆ findRank2()

static bool findRank2 ( CMR_CHRMAT matrix,
ElementData rowData,
ElementData columnData,
size_t  rowRepresentative[2][2],
size_t  columnRepresentative[2][2],
short  part 
)
static

Checks whether the submatrix with rows assigned to part and columns assigned to the other has at least rank 2.

Assumes that rowRepresentative already contains the first nonzero row in that matrix. If the rank is at least 2, rowRepresentative and columnRepresentative are extended as to indicate a rank-2 submatrix.

Parameters
matrixMatrix.
rowDataRow element data.
columnDataColumn element data.
rowRepresentativeRow representatives for each part.
columnRepresentativeColumn representatives for each part.
partPart to which the investigated rows belong.

◆ findRank3()

static bool findRank3 ( CMR_CHRMAT matrix,
ElementData rowData,
ElementData columnData,
size_t  rowRepresentative[2][2],
short  part 
)
static

Checks whether the submatrix with rows assigned to part and columns assigned to the other has at least rank 3.

Assumes that rowRepresentative already contains two distinct nonzero rows in that submatrix.

Parameters
matrixMatrix.
rowDataRow element data.
columnDataColumn element data.
rowRepresentativeRow representatives for each part.
partPart to which the investigated rows belong.