CMR  1.3.0
Classes | Macros | Functions
seymour.c File Reference
#include <cmr/seymour.h>
#include "env_internal.h"
#include "seymour_internal.h"
#include "matrix_internal.h"
#include "listmatrix.h"
#include <assert.h>
#include <string.h>
#include <time.h>

Classes

struct  ClonePair
 Pair of a given Seymour decomposition node and its clone. More...
 

Macros

#define MIN_IF_EXISTS(currentValue, child, childValue)
 

Functions

CMR_ERROR CMRseymourParamsInit (CMR_SEYMOUR_PARAMS *params)
 Initializes the default parameters for regularity testing. More...
 
CMR_ERROR CMRseymourStatsInit (CMR_SEYMOUR_STATS *stats)
 Initializes all statistics for Seymour decomposition computations. More...
 
CMR_ERROR CMRseymourStatsPrint (FILE *stream, CMR_SEYMOUR_STATS *stats, const char *prefix)
 Prints statistics for Seymour decomposition computations. More...
 
bool CMRseymourIsTernary (CMR_SEYMOUR_NODE *node)
 Returns true iff the decomposition is over \( \mathbb{F}_3 \). More...
 
bool CMRseymourThreeSumDistributedRanks (CMR_SEYMOUR_NODE *node)
 Returns true iff the 3-sum decomposition node has \( 3 \)-separation with two rank-1 matrices. More...
 
bool CMRseymourThreeSumConcentratedRank (CMR_SEYMOUR_NODE *node)
 Returns true iff the 3-sum decomposition node has \( 3 \)-separation with one rank-2 matrix. More...
 
CMR_CHRMATCMRseymourGetMatrix (CMR_SEYMOUR_NODE *node)
 Returns the matrix of the decomposition node dec (or NULL if it is not stored). More...
 
bool CMRseymourHasTranspose (CMR_SEYMOUR_NODE *node)
 Returns true iff the transposed matrix of the decomposition node dec is stored. More...
 
CMR_CHRMATCMRseymourGetTranspose (CMR_SEYMOUR_NODE *node)
 Returns the transposed matrix of the decomposition node dec (or NULL if it is not stored). More...
 
size_t CMRseymourNumChildren (CMR_SEYMOUR_NODE *node)
 Returns the number of children of the decomposition node dec. More...
 
CMR_SEYMOUR_NODECMRseymourChild (CMR_SEYMOUR_NODE *node, size_t childIndex)
 Returns a child of the decomposition node dec. More...
 
CMR_SEYMOUR_NODE_TYPE CMRseymourType (CMR_SEYMOUR_NODE *node)
 Returns the type of a decomposition node dec. More...
 
int8_t CMRseymourGraphicness (CMR_SEYMOUR_NODE *node)
 Indicates graphicness/being network. More...
 
int8_t CMRseymourCographicness (CMR_SEYMOUR_NODE *node)
 Indicates cographicness/being conetwork. More...
 
int8_t CMRseymourRegularity (CMR_SEYMOUR_NODE *node)
 Indicates regularity/total unimodularity. More...
 
size_t CMRseymourNumRows (CMR_SEYMOUR_NODE *node)
 Returns the number of rows. More...
 
CMR_ELEMENTCMRseymourChildRowsToParent (CMR_SEYMOUR_NODE *node, size_t childIndex)
 Returns the mapping of rows of child childIndex to this node's elements. More...
 
CMR_ELEMENTCMRseymourChildColumnsToParent (CMR_SEYMOUR_NODE *node, size_t childIndex)
 Returns the mapping of columns of child childIndex to this node's elements. More...
 
size_t CMRseymourNumColumns (CMR_SEYMOUR_NODE *node)
 Returns the number of columns. More...
 
CMR_GRAPHCMRseymourGraph (CMR_SEYMOUR_NODE *node)
 Returns the graph (if available). More...
 
CMR_GRAPH_EDGECMRseymourGraphForest (CMR_SEYMOUR_NODE *node)
 Returns the forest of the graph (if available). More...
 
size_t CMRseymourGraphSizeForest (CMR_SEYMOUR_NODE *node)
 Returns the number of edges of the graph's forest (if available). More...
 
CMR_GRAPH_EDGECMRseymourGraphCoforest (CMR_SEYMOUR_NODE *node)
 Returns the coforest of the graph (if available). More...
 
size_t CMRseymourGraphSizeCoforest (CMR_SEYMOUR_NODE *node)
 Returns the number of edges of the graph's coforest (if available). More...
 
bool * CMRseymourGraphArcsReversed (CMR_SEYMOUR_NODE *node)
 Returns an array that indicates for the graph's edges whether they must be reversed (if available). More...
 
CMR_GRAPHCMRseymourCograph (CMR_SEYMOUR_NODE *node)
 Returns the cograph (if available). More...
 
size_t CMRseymourCographSizeForest (CMR_SEYMOUR_NODE *node)
 Returns the number of edges of the cograph's forest (if available). More...
 
CMR_GRAPH_EDGECMRseymourCographForest (CMR_SEYMOUR_NODE *node)
 Returns the forest of the cograph (if available). More...
 
size_t CMRseymourCographSizeCoforest (CMR_SEYMOUR_NODE *node)
 Returns the number of edges of the cograph's coforest (if available). More...
 
CMR_GRAPH_EDGECMRseymourCographCoforest (CMR_SEYMOUR_NODE *node)
 Returns the coforest of the cograph (if available). More...
 
bool * CMRseymourCographArcsReversed (CMR_SEYMOUR_NODE *node)
 Returns an array that indicates for the cograph's edges whether they must be reversed (if available). More...
 
size_t CMRseymourNumPivots (CMR_SEYMOUR_NODE *node)
 Returns the number of pivots (if available). More...
 
size_t * CMRseymourPivotRows (CMR_SEYMOUR_NODE *node)
 Returns the array with the pivot rows (if available). More...
 
size_t * CMRseymourPivotColumns (CMR_SEYMOUR_NODE *node)
 Returns the array with the pivot columns (if available). More...
 
size_t CMRseymourGetUsed (CMR_SEYMOUR_NODE *node)
 Returns node's reference counter. More...
 
CMR_ERROR CMRseymourPrintChild (CMR *cmr, CMR_SEYMOUR_NODE *child, CMR_SEYMOUR_NODE *parent, size_t childIndex, FILE *stream, size_t indent, bool printChildren, bool printParentElements, bool printMatrices, bool printGraphs, bool printReductions, bool printPivots)
 Prints the decomposition child to stream. More...
 
CMR_ERROR CMRseymourPrint (CMR *cmr, CMR_SEYMOUR_NODE *node, FILE *stream, bool printChildren, bool printParentElements, bool printMatrices, bool printGraphs, bool printReductions, bool printPivots)
 Prints the decomposition dec to stream. More...
 
CMR_ERROR CMRseymourCapture (CMR *cmr, CMR_SEYMOUR_NODE *node)
 Increases the reference counter by 1. More...
 
CMR_ERROR CMRseymourRelease (CMR *cmr, CMR_SEYMOUR_NODE **pnode)
 Releases a decomposition node, freeing it if this was the last reference. More...
 
static CMR_ERROR createNode (CMR *cmr, CMR_SEYMOUR_NODE **pnode, bool isTernary, CMR_SEYMOUR_NODE_TYPE type, size_t numRows, size_t numColumns)
 
CMR_ERROR CMRseymourCloneUnknown (CMR *cmr, CMR_SEYMOUR_NODE *node, CMR_SEYMOUR_NODE **pclone)
 Clones a decomposition node node into *pclone which represents the same matrix but has type CMR_SEYMOUR_NODE_TYPE_UNKNOWN type and no child nodes. More...
 
static CMR_ERROR updateRowsColumnsToParent (CMR *cmr, CMR_SEYMOUR_NODE *parent, size_t childIndex, size_t *parentRows, size_t *parentColumns)
 Allocates and sets childRowsToParent and childColumnsToParent of the child of parent indicated by childIndex. More...
 
static CMR_ERROR updateRowsColumnsToChild (CMR_SEYMOUR_NODE *parent, size_t childIndex, size_t *parentRows, size_t firstRow, size_t beyondRow, size_t *parentColumns, size_t firstColumn, size_t beyondColumn)
 Updates rowsToChild and columnsToChild of the parent. More...
 
static CMR_ERROR updateChildMatrix (CMR *cmr, CMR_SEYMOUR_NODE *parent, size_t childIndex)
 Updates matrix of dec from parent using rowsParent and columnsParent arrays. More...
 
CMR_ERROR CMRseymourCreate (CMR *cmr, CMR_SEYMOUR_NODE **pnode, bool isTernary, CMR_CHRMAT *matrix)
 Creates an unknown decomposition node as a root. More...
 
CMR_ERROR CMRseymourAddMinor (CMR *cmr, CMR_SEYMOUR_NODE *node, CMR_MINOR *minor)
 Adds a minor to a Seymour decomposition node. More...
 
size_t CMRseymourNumMinors (CMR_SEYMOUR_NODE *node)
 Returns the number of minors of the decomposition node. More...
 
CMR_MINORCMRseymourMinor (CMR_SEYMOUR_NODE *node, size_t minorIndex)
 Returns a minor of the decomposition node. More...
 
CMR_ERROR CMRseymourSetNumChildren (CMR *cmr, CMR_SEYMOUR_NODE *node, size_t numChildren)
 Sets the number of children and allocates memory accordingly. More...
 
CMR_ERROR CMRseymourCreateChildFromMatrices (CMR *cmr, CMR_SEYMOUR_NODE *parent, size_t childIndex, CMR_CHRMAT *matrix, CMR_CHRMAT *transpose, CMR_ELEMENT *rowsToParent, CMR_ELEMENT *columnsToParent)
 Creates a decomposition node as a child. More...
 
CMR_ERROR CMRseymourUpdateOneSum (CMR *cmr, CMR_SEYMOUR_NODE *node, size_t numChildren)
 Initialize an existing unknown decomposition node as a 1-sum with numChildren children. More...
 
CMR_ERROR CMRseymourUpdateViolator (CMR *cmr, CMR_SEYMOUR_NODE *node, CMR_SUBMAT *violator)
 Initialize an existing unknown decomposition node to be irregular with a violator submatrix. More...
 
CMR_ERROR CMRseymourUpdateSeriesParallel (CMR *cmr, CMR_SEYMOUR_NODE *node, CMR_SUBMAT *reducedSubmatrix)
 Updates an existing unknown Seymour decomposition node to be a series-parallel node. More...
 
CMR_ERROR CMRseymourUpdateTwoSum (CMR *cmr, CMR_SEYMOUR_NODE *node, CMR_SEPA *separation)
 Initialize an existing unknown decomposition node as a 2-separation node according to the given separation. More...
 
CMR_ERROR CMRseymourUpdatePivots (CMR *cmr, CMR_SEYMOUR_NODE *node, size_t numPivots, size_t *pivotRows, size_t *pivotColumns, CMR_CHRMAT *matrix, CMR_CHRMAT *transpose)
 Initialize an existing unknown decomposition node as a pivot node according to the given arrays of pivots. More...
 
CMR_ERROR CMRseymourUpdateThreeSumInit (CMR *cmr, CMR_SEYMOUR_NODE *node)
 Initialize an existing unknown decomposition node as a 3-sum node. More...
 
CMR_ERROR CMRseymourUpdateThreeSumCreateWideFirstChild (CMR *cmr, CMR_SEYMOUR_NODE *node, size_t *rowsToChild, size_t *columnsToChild, size_t numChildBaseRows, size_t numChildBaseColumns, size_t extraRow, size_t extraColumn1, size_t extraColumn2, int8_t extraEntry)
 Creates wide first child of an initialized 3-sum node. More...
 
CMR_ERROR CMRseymourUpdateThreeSumCreateWideSecondChild (CMR *cmr, CMR_SEYMOUR_NODE *node, size_t *rowsToChild, size_t *columnsToChild, size_t numChildBaseRows, size_t numChildBaseColumns, size_t extraRow, size_t extraColumn1, size_t extraColumn2, int8_t extraEntry)
 Creates wide second child of an initialized 3-sum node. More...
 
CMR_ERROR CMRseymourUpdateThreeSumCreateMixedFirstChild (CMR *cmr, CMR_SEYMOUR_NODE *node, size_t *rowsToChild, size_t *columnsToChild, size_t numChildBaseRows, size_t numChildBaseColumns, size_t extraRow1, size_t extraRow2, int8_t extraEntry)
 Creates mixed first child of an initialized 3-sum node. More...
 
CMR_ERROR CMRseymourUpdateThreeSumCreateMixedSecondChild (CMR *cmr, CMR_SEYMOUR_NODE *node, size_t *rowsToChild, size_t *columnsToChild, size_t numChildBaseRows, size_t numChildBaseColumns, size_t extraColumn1, size_t extraColumn2, int8_t extraEntry)
 Creates mixed second child of an initialized 3-sum node. More...
 
CMR_ERROR CMRseymourSetAttributes (CMR_SEYMOUR_NODE *node)
 Set regularity and (co)graphicness attributes of a decomposition tree. More...
 
static CMR_ERROR cloneRecursively (CMR *cmr, CMR_SEYMOUR_NODE *node, CMR_SEYMOUR_NODE **pclone, CMR_LISTHASHTABLE *nodesToClonesHashtable, ClonePair **pclonePairs, size_t *pmemClonePairs, size_t *pnumClonePairs)
 Clones node to *pclone, updates cloning data structures and calls itself recursively. More...
 
CMR_ERROR CMRseymourCloneSubtrees (CMR *cmr, size_t numSubtrees, CMR_SEYMOUR_NODE **subtreeRoots, CMR_SEYMOUR_NODE **clonedSubtrees)
 Clones the union of subtrees of a Seymour decomposition, returning the copies. More...
 
CMR_ERROR CMRregularityTaskCreateRoot (CMR *cmr, CMR_SEYMOUR_NODE *dec, DecompositionTask **ptask, CMR_SEYMOUR_PARAMS *params, CMR_SEYMOUR_STATS *stats, clock_t startClock, double timeLimit)
 Creates a decomposition task for the root of the decomposition. More...
 
CMR_ERROR CMRregularityTaskFree (CMR *cmr, DecompositionTask **ptask)
 Frees a decomposition task. More...
 
CMR_ERROR CMRregularityQueueCreate (CMR *cmr, DecompositionQueue **pqueue)
 Initializes a decomposition queue. More...
 
CMR_ERROR CMRregularityQueueFree (CMR *cmr, DecompositionQueue **pqueue)
 Frees the decomposition queue. More...
 
bool CMRregularityQueueEmpty (DecompositionQueue *queue)
 Returns whether a queue is empty. More...
 
DecompositionTaskCMRregularityQueueRemove (DecompositionQueue *queue)
 Removes a task from a decomposition queue. More...
 
void CMRregularityQueueAdd (DecompositionQueue *queue, DecompositionTask *task)
 Adds a task to a decomposition queue. More...
 
static CMR_ERROR CMRregularityTaskRun (CMR *cmr, DecompositionTask *task, DecompositionQueue *queue)
 Runs a task for processing the associated decomposition node. More...
 
CMR_ERROR CMRseymourDecompose (CMR *cmr, CMR_CHRMAT *matrix, bool ternary, CMR_SEYMOUR_NODE **proot, CMR_SEYMOUR_PARAMS *params, CMR_SEYMOUR_STATS *stats, double timeLimit)
 Tests ternary or binary linear matroid for regularity. More...
 
CMR_ERROR CMRregularityCompleteDecomposition (CMR *cmr, CMR_SEYMOUR_NODE *subtree, CMR_SEYMOUR_PARAMS *params, CMR_SEYMOUR_STATS *stats, double timeLimit)
 Replaces the subtree of a matroid decomposition tree by a new one. More...
 
CMR_ERROR CMRregularityRefineDecomposition (CMR *cmr, size_t numNodes, CMR_SEYMOUR_NODE **nodes, CMR_SEYMOUR_PARAMS *params, CMR_SEYMOUR_STATS *stats, double timeLimit)
 Replaces the subtrees of several nodes of a matroid decomposition tree by new ones. More...
 

Macro Definition Documentation

◆ MIN_IF_EXISTS

#define MIN_IF_EXISTS (   currentValue,
  child,
  childValue 
)
Value:
( (child != NULL) \
? ( ((childValue) < (currentValue)) ? (childValue) : (currentValue) ) \
: ( (0 < (currentValue)) ? 0 : (currentValue) ) \
)

Function Documentation

◆ cloneRecursively()

static CMR_ERROR cloneRecursively ( CMR cmr,
CMR_SEYMOUR_NODE node,
CMR_SEYMOUR_NODE **  pclone,
CMR_LISTHASHTABLE nodesToClonesHashtable,
ClonePair **  pclonePairs,
size_t *  pmemClonePairs,
size_t *  pnumClonePairs 
)
static

Clones node to *pclone, updates cloning data structures and calls itself recursively.

Inserts it into nodesToClonesHashtable, and updates the array *pclonePairs with the cloned pairs.

Parameters
cmrCMR environment.
nodeSeymour decomposition node.
pclonePointer for storing the cloned Seymour decomposition node.
nodesToClonesHashtableHashtable for the mapping from nodes to cloned nodes.
pclonePairsPointer to array of cloned pairs.
pmemClonePairsAllocated size of *pclonePairs.
pnumClonePairsLength of *pclonePairs.

◆ CMRregularityCompleteDecomposition()

CMR_ERROR CMRregularityCompleteDecomposition ( CMR cmr,
CMR_SEYMOUR_NODE subtree,
CMR_SEYMOUR_PARAMS params,
CMR_SEYMOUR_STATS stats,
double  timeLimit 
)

Replaces the subtree of a matroid decomposition tree by a new one.

Parameters
cmrCMR environment.
subtreeDecomposition node of the subtree root.
paramsParameters for the computation.
statsStatistics for the computation (may be NULL).
timeLimitTime limit to impose.

◆ CMRregularityQueueAdd()

void CMRregularityQueueAdd ( DecompositionQueue queue,
DecompositionTask task 
)

Adds a task to a decomposition queue.

Parameters
queueQueue.
taskTask.

◆ CMRregularityQueueCreate()

CMR_ERROR CMRregularityQueueCreate ( CMR cmr,
DecompositionQueue **  pqueue 
)

Initializes a decomposition queue.

Parameters
cmrCMR environment.
pqueuePointer for storing the queue.

◆ CMRregularityQueueEmpty()

bool CMRregularityQueueEmpty ( DecompositionQueue queue)

Returns whether a queue is empty.

Parameters
queueQueue.

◆ CMRregularityQueueFree()

CMR_ERROR CMRregularityQueueFree ( CMR cmr,
DecompositionQueue **  pqueue 
)

Frees the decomposition queue.

Parameters
cmrCMR environment.
pqueuePointer to queue.

◆ CMRregularityQueueRemove()

DecompositionTask* CMRregularityQueueRemove ( DecompositionQueue queue)

Removes a task from a decomposition queue.

Parameters
queueQueue.

◆ CMRregularityRefineDecomposition()

CMR_ERROR CMRregularityRefineDecomposition ( CMR cmr,
size_t  numNodes,
CMR_SEYMOUR_NODE **  nodes,
CMR_SEYMOUR_PARAMS params,
CMR_SEYMOUR_STATS stats,
double  timeLimit 
)

Replaces the subtrees of several nodes of a matroid decomposition tree by new ones.

Parameters
cmrCMR environment.
numNodesNumber of nodes to refine.
nodesArray of decomposition nodes to refine.
paramsParameters for the computation.
statsStatistics for the computation (may be NULL).
timeLimitTime limit to impose.

◆ CMRregularityTaskCreateRoot()

CMR_ERROR CMRregularityTaskCreateRoot ( CMR cmr,
CMR_SEYMOUR_NODE dec,
DecompositionTask **  ptask,
CMR_SEYMOUR_PARAMS params,
CMR_SEYMOUR_STATS stats,
clock_t  startClock,
double  timeLimit 
)

Creates a decomposition task for the root of the decomposition.

Parameters
cmrCMR environment.
decDecomposition node.
ptaskPointer for storing the new task.
paramsParameters for the computation.
statsStatistics for the computation (may be NULL).
startClockClock for the start time.
timeLimitTime limit to impose.

◆ CMRregularityTaskFree()

CMR_ERROR CMRregularityTaskFree ( CMR cmr,
DecompositionTask **  ptask 
)

Frees a decomposition task.

Parameters
cmrCMR environment.
ptaskPointer to task.

◆ CMRregularityTaskRun()

static CMR_ERROR CMRregularityTaskRun ( CMR cmr,
DecompositionTask task,
DecompositionQueue queue 
)
static

Runs a task for processing the associated decomposition node.

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

◆ CMRseymourAddMinor()

CMR_ERROR CMRseymourAddMinor ( CMR cmr,
CMR_SEYMOUR_NODE node,
CMR_MINOR minor 
)

Adds a minor to a Seymour decomposition node.

Does not copy the minor.

Parameters
cmrCMR environment.
nodeSeymour decomposition node.
minorMinor to be added.

◆ CMRseymourCreateChildFromMatrices()

CMR_ERROR CMRseymourCreateChildFromMatrices ( CMR cmr,
CMR_SEYMOUR_NODE parent,
size_t  childIndex,
CMR_CHRMAT matrix,
CMR_CHRMAT transpose,
CMR_ELEMENT rowsToParent,
CMR_ELEMENT columnsToParent 
)

Creates a decomposition node as a child.

Copies matrix and transpose into the node.

Parameters
cmrCMR environment.
parentSeymour decomposition parent node.
childIndexChild index of parent.
matrixThe matrix corresponding to this node.
transposeThe transpose matrix corresponding to this node.
rowsToParentArray for mapping rows to elements of parent.
columnsToParentArray for mapping columns to elements of parent.

◆ CMRseymourDecompose()

CMR_ERROR CMRseymourDecompose ( CMR cmr,
CMR_CHRMAT matrix,
bool  ternary,
CMR_SEYMOUR_NODE **  proot,
CMR_SEYMOUR_PARAMS params,
CMR_SEYMOUR_STATS stats,
double  timeLimit 
)

Tests ternary or binary linear matroid for regularity.

If pdec is not NULL, *pdec will be a (partial) decomposition tree.

If pminor is not NULL and matrix is not regular, then an \( F_7 \) or \( F_7^\star \) minor or a submatrix with non-ternary determinant is searched. This causes additional computational effort!

Parameters
cmrCMR environment.
matrixInput matrix.
ternaryWhether the matrix shall be considered ternary.
prootPointer for storing the root of the Seymour decomposition.
paramsParameters for the computation.
statsStatistics for the computation (may be NULL).
timeLimitTime limit to impose.

◆ CMRseymourPrintChild()

CMR_ERROR CMRseymourPrintChild ( CMR cmr,
CMR_SEYMOUR_NODE child,
CMR_SEYMOUR_NODE parent,
size_t  childIndex,
FILE *  stream,
size_t  indent,
bool  printChildren,
bool  printParentElements,
bool  printMatrices,
bool  printGraphs,
bool  printReductions,
bool  printPivots 
)

Prints the decomposition child to stream.

Parameters
cmrCMR environment.
childSeymour decomposition child node.
parentSeymour decomposition parent node.
childIndexIndex of child as a child of parent.
streamStream to write to.
indentIndentation of this node.
printChildrenWhether to recurse.
printParentElementsWhether to print mapping of rows/columns to parent elements (if parent is not NULL).
printMatricesWhether to print matrices.
printGraphsWhether to print graphs.
printReductionsWhether to print series-parallel reductions.
printPivotsWhether to print pivots.

◆ CMRseymourSetAttributes()

CMR_ERROR CMRseymourSetAttributes ( CMR_SEYMOUR_NODE node)

Set regularity and (co)graphicness attributes of a decomposition tree.

Parameters
nodeSeymour decomposition node.

◆ CMRseymourSetNumChildren()

CMR_ERROR CMRseymourSetNumChildren ( CMR cmr,
CMR_SEYMOUR_NODE node,
size_t  numChildren 
)

Sets the number of children and allocates memory accordingly.

Parameters
cmrCMR environment.
nodeSeymour decomposition node.
numChildrenNumber of children.

◆ CMRseymourUpdateOneSum()

CMR_ERROR CMRseymourUpdateOneSum ( CMR cmr,
CMR_SEYMOUR_NODE node,
size_t  numChildren 
)

Initialize an existing unknown decomposition node as a 1-sum with numChildren children.

Parameters
cmrCMR environment.
nodeSeymour decomposition node.
numChildrenNumber of child nodes.

◆ CMRseymourUpdatePivots()

CMR_ERROR CMRseymourUpdatePivots ( CMR cmr,
CMR_SEYMOUR_NODE node,
size_t  numPivots,
size_t *  pivotRows,
size_t *  pivotColumns,
CMR_CHRMAT matrix,
CMR_CHRMAT transpose 
)

Initialize an existing unknown decomposition node as a pivot node according to the given arrays of pivots.

The unique child node will be of type CMR_SEYMOUR_NODE_TYPE_UNKNOWN.

Parameters
cmrCMR environment.
nodeSeymour decomposition node.
numPivotsNumber of pivots.
pivotRowsArray with pivot rows.
pivotColumnsArray with pivot columns.
matrixNew matrix.
transposeTranspose of matrix.

◆ CMRseymourUpdateSeriesParallel()

CMR_ERROR CMRseymourUpdateSeriesParallel ( CMR cmr,
CMR_SEYMOUR_NODE node,
CMR_SUBMAT reducedSubmatrix 
)

Updates an existing unknown Seymour decomposition node to be a series-parallel node.

Parameters
cmrCMR environment.
nodeSeymour decomposition node.
reducedSubmatrixSP-reduced submatrix.

◆ CMRseymourUpdateThreeSumCreateMixedFirstChild()

CMR_ERROR CMRseymourUpdateThreeSumCreateMixedFirstChild ( CMR cmr,
CMR_SEYMOUR_NODE node,
size_t *  rowsToChild,
size_t *  columnsToChild,
size_t  numChildBaseRows,
size_t  numChildBaseColumns,
size_t  extraRow1,
size_t  extraRow2,
int8_t  extraEntry 
)

Creates mixed first child of an initialized 3-sum node.

A nonzero extraEntry indicates the bottom-right nonzero entry.

Parameters
cmrCMR environment.
nodeSeymour decomposition node (initialized with CMRseymourUpdateThreeSumInit).
rowsToChildArray mapping rows to child rows.
columnsToChildArray mapping columns to child columns.
numChildBaseRowsNumber of base rows of this child.
numChildBaseColumnsNumber of base rows of this child.
extraRow1Index of the first extra row.
extraRow2Index of the second extra row.
extraEntrySign of the extra entry.

◆ CMRseymourUpdateThreeSumCreateMixedSecondChild()

CMR_ERROR CMRseymourUpdateThreeSumCreateMixedSecondChild ( CMR cmr,
CMR_SEYMOUR_NODE node,
size_t *  rowsToChild,
size_t *  columnsToChild,
size_t  numChildBaseRows,
size_t  numChildBaseColumns,
size_t  extraColumn1,
size_t  extraColumn2,
int8_t  extraEntry 
)

Creates mixed second child of an initialized 3-sum node.

A nonzero extraEntry indicates the top-left nonzero entry.

Parameters
cmrCMR environment.
nodeSeymour decomposition node (initialized with CMRseymourUpdateThreeSumInit).
rowsToChildArray mapping rows to child rows.
columnsToChildArray mapping columns to child columns.
numChildBaseRowsNumber of base rows of this child.
numChildBaseColumnsNumber of base rows of this child.
extraColumn1Index of the first extra column.
extraColumn2Index of the second extra column.
extraEntrySign of the extra entry.

◆ CMRseymourUpdateThreeSumCreateWideFirstChild()

CMR_ERROR CMRseymourUpdateThreeSumCreateWideFirstChild ( CMR cmr,
CMR_SEYMOUR_NODE node,
size_t *  rowsToChild,
size_t *  columnsToChild,
size_t  numChildBaseRows,
size_t  numChildBaseColumns,
size_t  extraRow,
size_t  extraColumn1,
size_t  extraColumn2,
int8_t  extraEntry 
)

Creates wide first child of an initialized 3-sum node.

A nonzero extraEntry indicates the bottom-right nonzero entry.

Parameters
cmrCMR environment.
nodeSeymour decomposition node (initialized with CMRseymourUpdateThreeSumInit).
rowsToChildArray mapping rows to child rows.
columnsToChildArray mapping columns to child columns.
numChildBaseRowsNumber of base rows of this child.
numChildBaseColumnsNumber of base rows of this child.
extraRowIndex of the extra row.
extraColumn1Index of 1st extra column.
extraColumn2Index of 2nd extra column, parallel to extraColumn1; equality is allowed.
extraEntrySign of the extra entry.

◆ CMRseymourUpdateThreeSumCreateWideSecondChild()

CMR_ERROR CMRseymourUpdateThreeSumCreateWideSecondChild ( CMR cmr,
CMR_SEYMOUR_NODE node,
size_t *  rowsToChild,
size_t *  columnsToChild,
size_t  numChildBaseRows,
size_t  numChildBaseColumns,
size_t  extraRow,
size_t  extraColumn1,
size_t  extraColumn2,
int8_t  extraEntry 
)

Creates wide second child of an initialized 3-sum node.

A nonzero extraEntry indicates the bottom-right nonzero entry.

Parameters
cmrCMR environment.
nodeSeymour decomposition node (initialized with CMRseymourUpdateThreeSumInit).
rowsToChildArray mapping rows to child rows.
columnsToChildArray mapping columns to child columns.
numChildBaseRowsNumber of base rows of this child.
numChildBaseColumnsNumber of base rows of this child.
extraRowIndex of the extra row.
extraColumn1Index of 1st extra column.
extraColumn2Index of 2nd extra column, parallel to extraColumn1; equality is allowed.
extraEntrySign of the extra entry, if known.

◆ CMRseymourUpdateThreeSumInit()

CMR_ERROR CMRseymourUpdateThreeSumInit ( CMR cmr,
CMR_SEYMOUR_NODE node 
)

Initialize an existing unknown decomposition node as a 3-sum node.

The two child nodes remain uninitialized.

Parameters
cmrCMR environment.
nodeSeymour decomposition node.

◆ CMRseymourUpdateTwoSum()

CMR_ERROR CMRseymourUpdateTwoSum ( CMR cmr,
CMR_SEYMOUR_NODE node,
CMR_SEPA separation 
)

Initialize an existing unknown decomposition node as a 2-separation node according to the given separation.

The two child nodes will be of type CMR_SEYMOUR_NODE_TYPE_UNKNOWN.

Parameters
cmrCMR environment.
nodeSeymour decomposition node.
separation2-separation.

◆ CMRseymourUpdateViolator()

CMR_ERROR CMRseymourUpdateViolator ( CMR cmr,
CMR_SEYMOUR_NODE node,
CMR_SUBMAT violator 
)

Initialize an existing unknown decomposition node to be irregular with a violator submatrix.

Parameters
cmrCMR environment.
nodeSeymour decomposition node.
violatorSubmatrix. Is not copied.

◆ createNode()

static CMR_ERROR createNode ( CMR cmr,
CMR_SEYMOUR_NODE **  pnode,
bool  isTernary,
CMR_SEYMOUR_NODE_TYPE  type,
size_t  numRows,
size_t  numColumns 
)
static
Parameters
cmrCMR environment.
pnodePointer for storing the new Seymour decomposition node.
isTernaryWhether the node is ternary.
typeType of the new node.
numRowsNumber of rows.
numColumnsNumber of columns.

◆ updateChildMatrix()

static CMR_ERROR updateChildMatrix ( CMR cmr,
CMR_SEYMOUR_NODE parent,
size_t  childIndex 
)
static

Updates matrix of dec from parent using rowsParent and columnsParent arrays.

Parameters
cmrCMR environment.
parentParent node in Seymour decomposition.
childIndexIndex of child to update.

◆ updateRowsColumnsToChild()

static CMR_ERROR updateRowsColumnsToChild ( CMR_SEYMOUR_NODE parent,
size_t  childIndex,
size_t *  parentRows,
size_t  firstRow,
size_t  beyondRow,
size_t *  parentColumns,
size_t  firstColumn,
size_t  beyondColumn 
)
static

Updates rowsToChild and columnsToChild of the parent.

Parameters
parentSeymour decomposition node of parent.
childIndexAn index of a child of parent.
parentRowsArray indicating parent row of each row of the child.
firstRowFirst index of parentRows to consider.
beyondRowBeyond index of parentRows to consider.
parentColumnsArray indicating parent column of each column of the child.
firstColumnFirst index of parentColumns to consider.
beyondColumnBeyond index of parentColumns to consider.

◆ updateRowsColumnsToParent()

static CMR_ERROR updateRowsColumnsToParent ( CMR cmr,
CMR_SEYMOUR_NODE parent,
size_t  childIndex,
size_t *  parentRows,
size_t *  parentColumns 
)
static

Allocates and sets childRowsToParent and childColumnsToParent of the child of parent indicated by childIndex.

Parameters
cmrCMR environment.
parentSeymour decomposition parent node.
childIndexChild index.
parentRowsArray indicating parent row of each row of the child.
parentColumnsArray indicating parent column of each column of the child.