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

Functions

CMR_ERROR CMRequimodularParamsInit (CMR_EQUIMODULAR_PARAMS *params)
 Initializes the default parameters for recognition of equimodular matrices. More...
 
CMR_ERROR CMRequimodularStatsInit (CMR_EQUIMODULAR_STATS *stats)
 Initializes all statistics for recognition algorithm for equimodular matrices. More...
 
CMR_ERROR CMRequimodularStatsPrint (FILE *stream, CMR_EQUIMODULAR_STATS *stats, const char *prefix)
 Prints statistics for recognition algorithm for equimodular matrices. More...
 
CMR_ERROR CMRequimodularTest (CMR *cmr, CMR_INTMAT *matrix, bool *pisEquimodular, int64_t *pgcdDet, CMR_EQUIMODULAR_PARAMS *params, CMR_EQUIMODULAR_STATS *stats, double timeLimit)
 Tests a matrix \( M \) for being equimodular (for determinant gcd \( k \)). More...
 
CMR_ERROR CMRequimodularTestStrong (CMR *cmr, CMR_INTMAT *matrix, bool *pisStronglyEquimodular, int64_t *pgcdDet, CMR_EQUIMODULAR_PARAMS *params, CMR_EQUIMODULAR_STATS *stats, double timeLimit)
 Tests a matrix \( M \) for being strongly equimodular. More...
 
CMR_EXPORT CMR_ERROR CMRunimodularTest (CMR *cmr, CMR_INTMAT *matrix, bool *pisUnimodular, CMR_EQUIMODULAR_PARAMS *params, CMR_EQUIMODULAR_STATS *stats, double timeLimit)
 Tests a matrix \( M \) for being unimodular. More...
 
CMR_EXPORT CMR_ERROR CMRunimodularTestStrong (CMR *cmr, CMR_INTMAT *matrix, bool *pisStronglyUnimodular, CMR_EQUIMODULAR_PARAMS *params, CMR_EQUIMODULAR_STATS *stats, double timeLimit)
 Tests a matrix \( M \) for being strongly unimodular. More...
 

Function Documentation

◆ CMRequimodularParamsInit()

CMR_ERROR CMRequimodularParamsInit ( CMR_EQUIMODULAR_PARAMS params)

Initializes the default parameters for recognition of equimodular matrices.

These are selected for minimum running time.

Parameters
paramsPointer to parameters.

◆ CMRequimodularStatsInit()

CMR_ERROR CMRequimodularStatsInit ( CMR_EQUIMODULAR_STATS stats)

Initializes all statistics for recognition algorithm for equimodular matrices.

Parameters
statsPointer to statistics.

◆ CMRequimodularStatsPrint()

CMR_ERROR CMRequimodularStatsPrint ( FILE *  stream,
CMR_EQUIMODULAR_STATS stats,
const char *  prefix 
)

Prints statistics for recognition algorithm for equimodular matrices.

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

◆ CMRequimodularTest()

CMR_ERROR CMRequimodularTest ( CMR cmr,
CMR_INTMAT matrix,
bool *  pisEquimodular,
int64_t *  pgcdDet,
CMR_EQUIMODULAR_PARAMS params,
CMR_EQUIMODULAR_STATS stats,
double  timeLimit 
)

Tests a matrix \( M \) for being equimodular (for determinant gcd \( k \)).

Tests if matrix \( M \) is equimodular for determinant gcd \( k \) and sets *pisEquimodular accordingly. If pgcdDet is not NULL, the behavior is as follows. If *pgcdDet is positive, then it tests only for that particular value of \( k \). Otherwise, *pgcdDet is set to \( k \) if \( M \) is equimodular for determinant gcd \( k \), and to \( 0 \) if \( M \) is not equimodular.

Parameters
cmrCMR environment
matrixMatrix \( M \).
pisEquimodularPointer for storing whether \( M \) is equimodular.
pgcdDetPointer for supplying/storing the determinant gcd (may be NULL).
paramsParameters for the computation (may be NULL for defaults).
statsStatistics for the computation (may be NULL).
timeLimitTime limit to impose.

◆ CMRequimodularTestStrong()

CMR_ERROR CMRequimodularTestStrong ( CMR cmr,
CMR_INTMAT matrix,
bool *  pisStronglyEquimodular,
int64_t *  pgcdDet,
CMR_EQUIMODULAR_PARAMS params,
CMR_EQUIMODULAR_STATS stats,
double  timeLimit 
)

Tests a matrix \( M \) for being strongly equimodular.

Tests if matrix \( M \) is strongly equimodular and sets *pisStronglyEquimodular accordingly. If pgcdDet is not NULL, the behavior is as follows. If *pgcdDet is positive, then it tests only for that particular value of \( k \). Otherwise, *pgcdDet is set to \( k \) if \( M \) is strongly equimodular for determinant gcd \( k \), and to \( 0 \) if \( M \) is not strongly equimodular.

Parameters
cmrCMR environment
matrixMatrix \( M \).
pisStronglyEquimodularPointer for storing whether \( M \) is strongly equimodular.
pgcdDetPointer for supplying/storing the determinant gcd (may be NULL).
paramsParameters for the computation (may be NULL for defaults).
statsStatistics for the computation (may be NULL).
timeLimitTime limit to impose.

◆ CMRunimodularTest()

CMR_EXPORT CMR_ERROR CMRunimodularTest ( CMR cmr,
CMR_INTMAT matrix,
bool *  pisUnimodular,
CMR_EQUIMODULAR_PARAMS params,
CMR_EQUIMODULAR_STATS stats,
double  timeLimit 
)

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

Tests if matrix \( M \) is unimodular and sets *pisUnimodular accordingly.

Parameters
cmrCMR environment
matrixMatrix \( M \).
pisUnimodularPointer for storing whether \( M \) is unimodular.
paramsParameters for the computation (may be NULL for defaults).
statsStatistics for the computation (may be NULL).
timeLimitTime limit to impose.

◆ CMRunimodularTestStrong()

CMR_EXPORT CMR_ERROR CMRunimodularTestStrong ( CMR cmr,
CMR_INTMAT matrix,
bool *  pisStronglyUnimodular,
CMR_EQUIMODULAR_PARAMS params,
CMR_EQUIMODULAR_STATS stats,
double  timeLimit 
)

Tests a matrix \( M \) for being strongly unimodular.

Tests if matrix \( M \) is strongly unimodular and sets *pisStronglyUnimodular accordingly.

Parameters
cmrCMR environment
matrixMatrix \( M \).
pisStronglyUnimodularPointer for storing whether \( M \) is strongly unimodular.
paramsParameters for the computation (may be NULL for defaults).
statsStatistics for the computation (may be NULL).
timeLimitTime limit to impose.