CMR  1.3.0
Functions
ctu.c File Reference
#include <cmr/ctu.h>
#include <cmr/tu.h>
#include "env_internal.h"
#include <assert.h>
#include <stdint.h>
#include <time.h>
#include <float.h>

Functions

CMR_ERROR CMRctuParamsInit (CMR_CTU_PARAMS *params)
 Initializes the default parameters for recognition of complement totally unimodular matrices. More...
 
CMR_ERROR CMRstatsComplementTotalUnimodularityInit (CMR_CTU_STATISTICS *stats)
 Initializes all statistics for recognition algorithm for complement totally unimodular matrices. More...
 
CMR_ERROR CMRstatsComplementTotalUnimodularityPrint (FILE *stream, CMR_CTU_STATISTICS *stats, const char *prefix)
 Prints statistics for recognition algorithm for complement totally unimodular matrices. More...
 
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_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...
 

Function Documentation

◆ CMRctuComplementRowColumn()

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_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_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_ERROR CMRstatsComplementTotalUnimodularityInit ( CMR_CTU_STATISTICS stats)

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

Parameters
statsPointer to statistics.

◆ CMRstatsComplementTotalUnimodularityPrint()

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).