CMR  1.3.0
tu.h
Go to the documentation of this file.
1 #ifndef CMR_TU_H
2 #define CMR_TU_H
3 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 #include <cmr/env.h>
17 #include <cmr/regular.h>
18 #include <cmr/matrix.h>
19 #include <cmr/camion.h>
20 
21 typedef enum
22 {
27 
28 typedef struct
29 {
31  bool directCamion;
34 
41 CMR_EXPORT
43  CMR_TU_PARAMS* params
44 );
45 
50 typedef struct
51 {
56  double enumerationTime;
60  double partitionTime;
62 } CMR_TU_STATS;
63 
68 CMR_EXPORT
70  CMR_TU_STATS* stats
71 );
72 
77 CMR_EXPORT
79  FILE* stream,
80  CMR_TU_STATS* stats,
81  const char* prefix
82 );
83 
96 CMR_EXPORT
98  CMR* cmr,
99  CMR_CHRMAT* matrix,
100  bool* pisTotallyUnimodular,
101  CMR_MATROID_DEC** pdec,
102  CMR_SUBMAT** psubmatrix,
103  CMR_TU_PARAMS* params,
104  CMR_TU_STATS* stats,
105  double timeLimit
106 );
107 
117 CMR_EXPORT
119  CMR* cmr,
120  CMR_MATROID_DEC* dec,
121  CMR_TU_PARAMS* params,
122  CMR_TU_STATS* stats,
123  double timeLimit
124 );
125 
126 #ifdef __cplusplus
127 }
128 #endif
129 
130 #endif /* CMR_TU_H */
Testing whether a matrix is Camion-signed.
Basic functionality of the software library.
CMR_ERROR
Type for return codes of library functions.
Definition: env.h:32
Functionality for sparse matrices.
Recognition of regular matrices.
Row-wise representation of sparse char matrix.
Definition: matrix.h:204
Definition: env_internal.h:45
Definition: regular.h:55
Statistics for regular matroid recognition algorithm.
Definition: regular.h:121
Row and column indices for a submatrix.
Definition: matrix.h:28
Definition: tu.h:29
CMR_REGULAR_PARAMS regular
Parameters for regularity test.
Definition: tu.h:32
bool directCamion
Whether to directly test signing of matrix (default: false).
Definition: tu.h:31
CMR_TU_ALGORITHM algorithm
Algorithm to use.
Definition: tu.h:30
Statistics for recognition algorithm for totally unimodular matrices.
Definition: tu.h:51
uint32_t enumerationColumnSubsets
Definition: tu.h:55
CMR_REGULAR_STATS decomposition
Definition: tu.h:52
double partitionTime
Definition: tu.h:60
uint32_t partitionRowSubsets
Definition: tu.h:58
double enumerationTime
Definition: tu.h:56
uint32_t enumerationRowSubsets
Definition: tu.h:54
uint32_t partitionColumnSubsets
Definition: tu.h:59
Definition: matroid_internal.h:16
CMR_EXPORT CMR_ERROR CMRtuParamsInit(CMR_TU_PARAMS *params)
Initializes the default parameters for recognition of totally unimodular matrices.
Definition: tu.c:15
CMR_EXPORT CMR_ERROR CMRtuCompleteDecomposition(CMR *cmr, CMR_MATROID_DEC *dec, CMR_TU_PARAMS *params, CMR_TU_STATS *stats, double timeLimit)
Completes a subtree of an existing decomposition tree.
Definition: tu.c:693
CMR_TU_ALGORITHM
Definition: tu.h:22
@ CMR_TU_ALGORITHM_PARTITION
Enumeration algorithm based on criterion of Ghouila-Houri.
Definition: tu.h:25
@ CMR_TU_ALGORITHM_EULERIAN
Enumeration algorithm based on Eulerian submatrices.
Definition: tu.h:24
@ CMR_TU_ALGORITHM_DECOMPOSITION
Algorithm based on Seymour's decomposition of regular matroids.
Definition: tu.h:23
CMR_EXPORT CMR_ERROR CMRtuStatsInit(CMR_TU_STATS *stats)
Initializes all statistics for recognition algorithm for totally unimodular matrices.
Definition: tu.c:26
CMR_EXPORT CMR_ERROR CMRtuStatsPrint(FILE *stream, CMR_TU_STATS *stats, const char *prefix)
Prints statistics for recognition algorithm for totally unimodular matrices.
Definition: tu.c:43
CMR_EXPORT CMR_ERROR CMRtuTest(CMR *cmr, CMR_CHRMAT *matrix, bool *pisTotallyUnimodular, CMR_MATROID_DEC **pdec, CMR_SUBMAT **psubmatrix, CMR_TU_PARAMS *params, CMR_TU_STATS *stats, double timeLimit)
Tests a matrix for being totally unimodular.
Definition: tu.c:617