CMR  1.3.0
Loading...
Searching...
No Matches
Functions
matroid.c File Reference
#include <cmr/matroid.h>
#include "env_internal.h"
#include "seymour_internal.h"
#include "matrix_internal.h"
#include "listmatrix.h"
#include "linear_algebra_internal.h"
#include <assert.h>
#include <string.h>

Functions

static CMR_ERROR computePivots (CMR *cmr, CMR_CHRMAT *matrix, size_t numPivots, size_t *pivotRows, size_t *pivotColumns, int characteristic, CMR_SUBMAT **pviolator, CMR_CHRMAT **presult)
 Carries out numPivots pivots on matrix and stores the result in *presult.
 
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.
 
CMR_ERROR CMRchrmatTernaryPivot (CMR *cmr, CMR_CHRMAT *matrix, size_t pivotRow, size_t pivotColumn, CMR_CHRMAT **presult)
 Applies a pivot to matrix and returns the resulting matrix in *presult.
 
CMR_ERROR CMRchrmatRegularPivot (CMR *cmr, CMR_CHRMAT *matrix, size_t pivotRow, size_t pivotColumn, CMR_SUBMAT **pviolator, CMR_CHRMAT **presult)
 Applies a pivot to matrix and returns the resulting matrix in *presult.
 
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.
 
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.
 
CMR_ERROR CMRchrmatRegularPivots (CMR *cmr, CMR_CHRMAT *matrix, size_t numPivots, size_t *pivotRows, size_t *pivotColumns, CMR_SUBMAT **pviolator, CMR_CHRMAT **presult)
 Applies a sequence of pivots to matrix and returns the resulting matrix in *presult.
 
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.
 
CMR_ERROR CMRminorFree (CMR *cmr, CMR_MINOR **pminor)
 Frees the minor *pminor (if pminor is not NULL).
 
CMR_MINOR_TYPE CMRminorType (CMR_MINOR *minor)
 Returns the type of minor.
 
size_t CMRminorNumPivots (CMR_MINOR *minor)
 Returns the number of pivots needed to make a minor visible.
 
size_t * CMRminorPivotRows (CMR_MINOR *minor)
 Returns the array with pivot rows to make a minor visible.
 
size_t * CMRminorPivotColumns (CMR_MINOR *minor)
 Returns the array with pivot columns to make a minor visible.
 
CMR_SUBMATCMRminorSubmatrix (CMR_MINOR *minor)
 Returns the submatrix to take (after applying pivots) to make a minor visible.
 
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.
 
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.
 

Function Documentation

◆ computePivots()

static CMR_ERROR computePivots ( CMR cmr,
CMR_CHRMAT matrix,
size_t  numPivots,
size_t *  pivotRows,
size_t *  pivotColumns,
int  characteristic,
CMR_SUBMAT **  pviolator,
CMR_CHRMAT **  presult 
)
static

Carries out numPivots pivots on matrix and stores the result in *presult.

Calculations are done modulo characteristic. If that value is negative then the pivots must be regular, i.e., over every field. If the result would differ over fields, *presult will be NULL and, if given, *pviolator will refer to the submatrix indexed by an affected entry as well as indices of all previous pivots.

Parameters
cmrCMR environment .
matrixInput matrix.
numPivotsNumber of pivots.
pivotRowsRow indices of pivots.
pivotColumnsColumn indices of pivots.
characteristicCharacteristic of field.
pviolatorPointer for storing a violating (irregular) submatrix; may be NULL.
presultPointer for storing the resulting matrix.