CMR  1.3.0
Classes | Functions
ctu.h File Reference

Recognition of complement totally unimodular matrices. More...

#include <cmr/env.h>
#include <cmr/matrix.h>
#include <cmr/tu.h>

Go to the source code of this file.

Classes

struct  CMR_CTU_PARAMS
 
struct  CMR_CTU_STATISTICS
 Statistics for recognition algorithm for totally unimodular matrices. More...
 

Functions

CMR_EXPORT CMR_ERROR CMRctuParamsInit (CMR_CTU_PARAMS *params)
 Initializes the default parameters for recognition of complement totally unimodular matrices. More...
 
CMR_EXPORT CMR_ERROR CMRstatsComplementTotalUnimodularityInit (CMR_CTU_STATISTICS *stats)
 Initializes all statistics for recognition algorithm for complement totally unimodular matrices. More...
 
CMR_EXPORT CMR_ERROR CMRstatsComplementTotalUnimodularityPrint (FILE *stream, CMR_CTU_STATISTICS *stats, const char *prefix)
 Prints statistics for recognition algorithm for complement totally unimodular matrices. More...
 
CMR_EXPORT CMR_ERROR CMRctuComplementRowColumn (CMR *cmr, CMR_CHRMAT *matrix, size_t complementRow, size_t complementColumn, CMR_CHRMAT **presult)
 Carries out a row- and column-complement operations on the binary matrix. More...
 
CMR_EXPORT CMR_ERROR CMRctuTest (CMR *cmr, CMR_CHRMAT *matrix, bool *pisComplementTotallyUnimodular, size_t *pcomplementRow, size_t *pcomplementColumn, CMR_CTU_PARAMS *params, CMR_CTU_STATISTICS *stats, double timeLimit)
 Tests a matrix \( M \) for being complement totally unimodular. More...
 

Detailed Description

Recognition of complement totally unimodular matrices.

Author
Matthias Walter and Klaus Truemper

Function Documentation

◆ CMRctuComplementRowColumn()

CMR_EXPORT CMR_ERROR CMRctuComplementRowColumn ( CMR cmr,
CMR_CHRMAT matrix,
size_t  complementRow,
size_t  complementColumn,
CMR_CHRMAT **  presult 
)

Carries out a row- and column-complement operations on the binary matrix.

Parameters
cmrCMR environment
matrixInput matrix.
complementRowRow to be complemented (SIZE_MAX for no row complement).
complementColumnColumn to be complemented (SIZE_MAX for no column complement).
presultResulting matrix.

◆ CMRctuParamsInit()

CMR_EXPORT CMR_ERROR CMRctuParamsInit ( CMR_CTU_PARAMS params)

Initializes the default parameters for recognition of complement totally unimodular matrices.

These are selected for minimum running time.

Parameters
paramsPointer to parameters.

◆ CMRctuTest()

CMR_EXPORT CMR_ERROR CMRctuTest ( CMR cmr,
CMR_CHRMAT matrix,
bool *  pisComplementTotallyUnimodular,
size_t *  pcomplementRow,
size_t *  pcomplementColumn,
CMR_CTU_PARAMS params,
CMR_CTU_STATISTICS stats,
double  timeLimit 
)

Tests a matrix \( M \) for being complement totally unimodular.

Tests if matrix \( M \) is complement totally unimodular and sets *pisComplementTotallyUnimodular accordingly.

If \( M \) is not complement totally unimodular and pcomplementRow != NULL and pcomplementColumn != NULL, then *pcomplementRow and *pcomplementColumn will indicate the row and column that need to be complemented for obtaining a matrix that is not totally unimodular. If no row/column needs to be complemented, then the respective variables are set to SIZE_MAX.

Parameters
cmrCMR environment
matrixMatrix \( M \).
pisComplementTotallyUnimodularPointer for storing whether \( M \) is complement totally unimodular.
pcomplementRowPointer for storing the row to be complemented (may be NULL).
pcomplementColumnPointer for storing the column to be complemented (may be NULL).
paramsParameters for the computation (may be NULL for defaults).
statsStatistics for the computation (may be NULL).
timeLimitTime limit to impose.

◆ CMRstatsComplementTotalUnimodularityInit()

CMR_EXPORT CMR_ERROR CMRstatsComplementTotalUnimodularityInit ( CMR_CTU_STATISTICS stats)

Initializes all statistics for recognition algorithm for complement totally unimodular matrices.

Parameters
statsPointer to statistics.

◆ CMRstatsComplementTotalUnimodularityPrint()

CMR_EXPORT CMR_ERROR CMRstatsComplementTotalUnimodularityPrint ( FILE *  stream,
CMR_CTU_STATISTICS stats,
const char *  prefix 
)

Prints statistics for recognition algorithm for complement totally unimodular matrices.

Parameters
streamFile stream to print to.
statsPointer to statistics.
prefixPrefix string to prepend to each printed line (may be NULL).