CMR  1.3.0
balanced.h
Go to the documentation of this file.
1 #ifndef CMR_BALANCED_H
2 #define CMR_BALANCED_H
3 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 #include <cmr/env.h>
17 #include <cmr/matrix.h>
18 #include <cmr/series_parallel.h>
19 
20 #include <inttypes.h>
21 
22 typedef enum
23 {
28 
29 typedef struct
30 {
34 
39 CMR_EXPORT
41  CMR_BALANCED_PARAMS* params
42 );
43 
48 typedef struct
49 {
50  uint32_t totalCount;
51  double totalTime;
56 
61 CMR_EXPORT
63  CMR_BALANCED_STATS* stats
64 );
65 
70 CMR_EXPORT
72  FILE* stream,
73  CMR_BALANCED_STATS* stats,
74  const char* prefix
75 );
76 
87 CMR_EXPORT
89  CMR* cmr,
90  CMR_CHRMAT* matrix,
91  bool* pisBalanced,
92  CMR_SUBMAT** psubmatrix,
93  CMR_BALANCED_PARAMS* params,
94  CMR_BALANCED_STATS* stats,
95  double timeLimit
96 );
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 
102 #endif /* CMR_BALANCED_H */
CMR_EXPORT CMR_ERROR CMRbalancedStatsInit(CMR_BALANCED_STATS *stats)
Initializes all statistics for recognition algorithm for balanced matrices.
Definition: balanced.c:29
CMR_BALANCED_ALGORITHM
Definition: balanced.h:23
@ CMR_BALANCED_ALGORITHM_GRAPH
Polynomial-time algorithm based on graphs.
Definition: balanced.h:26
@ CMR_BALANCED_ALGORITHM_SUBMATRIX
Exponential-time enumeration algorithm based on submatrices.
Definition: balanced.h:25
@ CMR_BALANCED_ALGORITHM_AUTO
Automatically select a fast algorithm.
Definition: balanced.h:24
CMR_EXPORT CMR_ERROR CMRbalancedTest(CMR *cmr, CMR_CHRMAT *matrix, bool *pisBalanced, CMR_SUBMAT **psubmatrix, CMR_BALANCED_PARAMS *params, CMR_BALANCED_STATS *stats, double timeLimit)
Tests a matrix for being balanced.
Definition: balanced.c:629
CMR_EXPORT CMR_ERROR CMRbalancedParamsInit(CMR_BALANCED_PARAMS *params)
Initializes the default parameters for recognition of balanced matrices.
Definition: balanced.c:19
CMR_EXPORT CMR_ERROR CMRbalancedStatsPrint(FILE *stream, CMR_BALANCED_STATS *stats, const char *prefix)
Prints statistics for recognition algorithm for balanced matrices.
Definition: balanced.c:42
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 series-parallel matrices.
Definition: balanced.h:30
CMR_BALANCED_ALGORITHM algorithm
Algorithm to use.
Definition: balanced.h:31
bool seriesParallel
Whether to carry out series-parallel operations as preprocessing.
Definition: balanced.h:32
Statistics for recognition algorithm for balanced matrices.
Definition: balanced.h:49
size_t enumeratedRowSubsets
Definition: balanced.h:53
CMR_SP_STATISTICS seriesParallel
Definition: balanced.h:52
size_t enumeratedColumnSubsets
Definition: balanced.h:54
uint32_t totalCount
Definition: balanced.h:50
double totalTime
Definition: balanced.h:51
Row-wise representation of sparse char matrix.
Definition: matrix.h:220
Definition: env_internal.h:45
Statistics for series-parallel recognition algorithm.
Definition: series_parallel.h:25
Row and column indices for a submatrix.
Definition: matrix.h:28