CMR  1.3.0
Classes | Enumerations | Functions
Matroid decomposition

Classes

struct  CMR_MINOR
 A minor of a matroid. More...
 

Enumerations

enum  CMR_MINOR_TYPE {
  CMR_MINOR_TYPE_DETERMINANT = -2 , CMR_MINOR_TYPE_ENTRY = -1 , CMR_MINOR_TYPE_CUSTOM = 0 , CMR_MINOR_TYPE_U24 = 1 ,
  CMR_MINOR_TYPE_FANO = 2 , CMR_MINOR_TYPE_FANO_DUAL = 3 , CMR_MINOR_TYPE_K5 = 4 , CMR_MINOR_TYPE_K5_DUAL = 5 ,
  CMR_MINOR_TYPE_K33 = 6 , CMR_MINOR_TYPE_K33_DUAL = 7
}
 

Functions

CMR_EXPORT CMR_ERROR CMRchrmatBinaryPivot (CMR *cmr, CMR_CHRMAT *matrix, size_t pivotRow, size_t pivotColumn, CMR_CHRMAT **presult)
 Apply a pivot to matrix and returns the resulting matrix in *presult. More...
 
CMR_EXPORT CMR_ERROR CMRchrmatTernaryPivot (CMR *cmr, CMR_CHRMAT *matrix, size_t pivotRow, size_t pivotColumn, CMR_CHRMAT **presult)
 Applies a sequence of pivots to matrix and returns the resulting matrix in *presult. More...
 
CMR_EXPORT CMR_ERROR CMRchrmatBinaryPivots (CMR *cmr, CMR_CHRMAT *matrix, size_t numPivots, size_t *pivotRows, size_t *pivotColumns, CMR_CHRMAT **presult)
 Applies a sequence of pivots to matrix and returns the resulting matrix in *presult. More...
 
CMR_EXPORT CMR_ERROR CMRchrmatTernaryPivots (CMR *cmr, CMR_CHRMAT *matrix, size_t numPivots, size_t *pivotRows, size_t *pivotColumns, CMR_CHRMAT **presult)
 Applies a sequence of pivots to matrix and returns the resulting matrix in *presult. More...
 
CMR_EXPORT CMR_ERROR CMRminorCreate (CMR *cmr, CMR_MINOR **pminor, size_t numPivots, CMR_SUBMAT *submatrix, CMR_MINOR_TYPE type)
 Creates a minor, allocating space for numPivots pivots and a remaining submatrix. More...
 
CMR_EXPORT CMR_ERROR CMRminorFree (CMR *cmr, CMR_MINOR **pminor)
 Frees the minor *pminor (if pminor is not NULL). More...
 
CMR_EXPORT CMR_MINOR_TYPE CMRminorType (CMR_MINOR *minor)
 Returns the type of minor. More...
 
CMR_EXPORT size_t CMRminorNumPivots (CMR_MINOR *minor)
 Returns the number of pivots needed to make a minor visible. More...
 
CMR_EXPORT size_t * CMRminorPivotRows (CMR_MINOR *minor)
 Returns the array with pivot rows to make a minor visible. More...
 
CMR_EXPORT size_t * CMRminorPivotColumns (CMR_MINOR *minor)
 Returns the array with pivot columns to make a minor visible. More...
 
CMR_EXPORT CMR_SUBMATCMRminorSubmatrix (CMR_MINOR *minor)
 Returns the submatrix to take (after applying pivots) to make a minor visible. More...
 
CMR_EXPORT CMR_ERROR CMRminorPrint (CMR *cmr, CMR_MINOR *minor, size_t numRows, size_t numColumns, FILE *stream)
 Writes the minor minor to stream by means of lists of row and column indices as well as pivot entries. More...
 
CMR_EXPORT CMR_ERROR CMRminorWriteToFile (CMR *cmr, CMR_MINOR *minor, size_t numRows, size_t numColumns, const char *fileName)
 Writes the minor minor to the file fileName by means of lists of row and column indices as well as pivot entries. More...
 

Detailed Description

Enumeration Type Documentation

◆ CMR_MINOR_TYPE

Enumerator
CMR_MINOR_TYPE_DETERMINANT 

A submatrix \( M \) with \( |\det(M)| = 2 \).

CMR_MINOR_TYPE_ENTRY 

A submatrix \( M \) of size 1-by-1 exhibiting a bad entry.

CMR_MINOR_TYPE_CUSTOM 

A custom minor.

CMR_MINOR_TYPE_U24 

A minor representing \( U^2_4 \).

CMR_MINOR_TYPE_FANO 

A minor representing \( F_7 \).

CMR_MINOR_TYPE_FANO_DUAL 

A minor representing \( F_7^\star \).

CMR_MINOR_TYPE_K5 

A minor representing \( M(K_5) \).

CMR_MINOR_TYPE_K5_DUAL 

A minor representing \( M(K_5)^\star \).

CMR_MINOR_TYPE_K33 

A minor representing \( M(K_{3,3}) \).

CMR_MINOR_TYPE_K33_DUAL 

A minor representing \( M(K_{3,3})^\star \).

Function Documentation

◆ CMRchrmatBinaryPivot()

CMR_EXPORT CMR_ERROR CMRchrmatBinaryPivot ( CMR cmr,
CMR_CHRMAT matrix,
size_t  pivotRow,
size_t  pivotColumn,
CMR_CHRMAT **  presult 
)

Apply a pivot to matrix and returns the resulting matrix in *presult.

Calculations are done over the binary field.

Parameters
cmrCMR environment.
matrixMatrix to work with.
pivotRowRow of the pivot.
pivotColumnColumn of the pivot.
presultPointer for storing the resulting matrix.

◆ CMRchrmatBinaryPivots()

CMR_EXPORT CMR_ERROR CMRchrmatBinaryPivots ( CMR cmr,
CMR_CHRMAT matrix,
size_t  numPivots,
size_t *  pivotRows,
size_t *  pivotColumns,
CMR_CHRMAT **  presult 
)

Applies a sequence of pivots to matrix and returns the resulting matrix in *presult.

Calculations are done over the binary field.

Parameters
cmrCMR environment.
matrixMatrix to work with.
numPivotsNumber of pivots to carry out.
pivotRowsArray with rows of the pivots.
pivotColumnsArray with columns of the pivots.
presultPointer for storing the resulting matrix.

◆ CMRchrmatTernaryPivot()

CMR_EXPORT CMR_ERROR CMRchrmatTernaryPivot ( CMR cmr,
CMR_CHRMAT matrix,
size_t  pivotRow,
size_t  pivotColumn,
CMR_CHRMAT **  presult 
)

Applies a sequence of pivots to matrix and returns the resulting matrix in *presult.

Calculations are done over the ternary field.

Parameters
cmrCMR environment.
matrixMatrix to work with.
pivotRowRow of the pivot.
pivotColumnColumn of the pivot.
presultPointer for storing the resulting matrix.

◆ CMRchrmatTernaryPivots()

CMR_EXPORT CMR_ERROR CMRchrmatTernaryPivots ( CMR cmr,
CMR_CHRMAT matrix,
size_t  numPivots,
size_t *  pivotRows,
size_t *  pivotColumns,
CMR_CHRMAT **  presult 
)

Applies a sequence of pivots to matrix and returns the resulting matrix in *presult.

Calculations are done over the ternary field.

Parameters
cmrCMR environment.
matrixMatrix to work with.
numPivotsNumber of pivots to carry out.
pivotRowsArray with rows of the pivots.
pivotColumnsArray with columns of the pivots.
presultPointer for storing the resulting matrix.

◆ CMRminorCreate()

CMR_EXPORT CMR_ERROR CMRminorCreate ( CMR cmr,
CMR_MINOR **  pminor,
size_t  numPivots,
CMR_SUBMAT submatrix,
CMR_MINOR_TYPE  type 
)

Creates a minor, allocating space for numPivots pivots and a remaining submatrix.

Parameters
cmrCMR environment.
pminorPointer for storing the minor.
numPivotsNumber of pivots.
submatrixSubmatrix (may be NULL; is not copied).
typeType of minor.

◆ CMRminorFree()

CMR_EXPORT CMR_ERROR CMRminorFree ( CMR cmr,
CMR_MINOR **  pminor 
)

Frees the minor *pminor (if pminor is not NULL).

Parameters
cmrCMR environment.
pminorPointer to the minor (may be NULL).

◆ CMRminorNumPivots()

CMR_EXPORT size_t CMRminorNumPivots ( CMR_MINOR minor)

Returns the number of pivots needed to make a minor visible.

Parameters
minorMinor.

◆ CMRminorPivotColumns()

CMR_EXPORT size_t* CMRminorPivotColumns ( CMR_MINOR minor)

Returns the array with pivot columns to make a minor visible.

Parameters
minorMinor.

◆ CMRminorPivotRows()

CMR_EXPORT size_t* CMRminorPivotRows ( CMR_MINOR minor)

Returns the array with pivot rows to make a minor visible.

Parameters
minorMinor.

◆ CMRminorPrint()

CMR_EXPORT CMR_ERROR CMRminorPrint ( CMR cmr,
CMR_MINOR minor,
size_t  numRows,
size_t  numColumns,
FILE *  stream 
)

Writes the minor minor to stream by means of lists of row and column indices as well as pivot entries.

Parameters
cmrCMR environment.
minorMinor to write.
numRowsNumber of rows of original matrix.
numColumnsNumber of columns of original matrix.
streamFile stream to save minor to..

◆ CMRminorSubmatrix()

CMR_EXPORT CMR_SUBMAT* CMRminorSubmatrix ( CMR_MINOR minor)

Returns the submatrix to take (after applying pivots) to make a minor visible.

Parameters
minorMinor.

◆ CMRminorType()

CMR_EXPORT CMR_MINOR_TYPE CMRminorType ( CMR_MINOR minor)

Returns the type of minor.

Parameters
minorMinor.

◆ CMRminorWriteToFile()

CMR_EXPORT CMR_ERROR CMRminorWriteToFile ( CMR cmr,
CMR_MINOR minor,
size_t  numRows,
size_t  numColumns,
const char *  fileName 
)

Writes the minor minor to the file fileName by means of lists of row and column indices as well as pivot entries.

Parameters
cmrCMR environment.
minorMinor to write.
numRowsNumber of rows of original matrix.
numColumnsNumber of columns of original matrix.
fileNameFile name to save minor to; NULL indicates stdout.