CMR  1.3.0
Loading...
Searching...
No Matches
matroid.h
Go to the documentation of this file.
1#ifndef CMR_MATROID_H
2#define CMR_MATROID_H
3
12#include <cmr/env.h>
13#include <cmr/matrix.h>
14#include <cmr/graph.h>
15
16#include <stdio.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
34CMR_EXPORT
36 CMR* cmr,
37 CMR_CHRMAT* matrix,
38 size_t pivotRow,
39 size_t pivotColumn,
40 CMR_CHRMAT** presult
41);
42
49CMR_EXPORT
51 CMR* cmr,
52 CMR_CHRMAT* matrix,
53 size_t pivotRow,
54 size_t pivotColumn,
55 CMR_CHRMAT** presult
56);
57
58
66CMR_EXPORT
68 CMR* cmr,
69 CMR_CHRMAT* matrix,
70 size_t pivotRow,
71 size_t pivotColumn,
72 CMR_SUBMAT** pviolator,
73 CMR_CHRMAT** presult
74);
75
82CMR_EXPORT
84 CMR* cmr,
85 CMR_CHRMAT* matrix,
86 size_t numPivots,
87 size_t* pivotRows,
88 size_t* pivotColumns,
89 CMR_CHRMAT** presult
90);
91
98CMR_EXPORT
100 CMR* cmr,
101 CMR_CHRMAT* matrix,
102 size_t numPivots,
103 size_t* pivotRows,
104 size_t* pivotColumns,
105 CMR_CHRMAT** presult
106);
107
115CMR_EXPORT
117 CMR* cmr,
118 CMR_CHRMAT* matrix,
119 size_t numPivots,
120 size_t* pivotRows,
121 size_t* pivotColumns,
122 CMR_SUBMAT** pviolator,
123 CMR_CHRMAT** presult
124);
125
149
164
171CMR_EXPORT
173 CMR* cmr,
174 CMR_MINOR** pminor,
175 size_t numPivots,
176 CMR_SUBMAT* submatrix,
177 CMR_MINOR_TYPE type
178);
179
184CMR_EXPORT
186 CMR* cmr,
187 CMR_MINOR** pminor
188);
189
194CMR_EXPORT
196 CMR_MINOR* minor
197);
198
203CMR_EXPORT
204size_t CMRminorNumPivots(
205 CMR_MINOR* minor
206);
207
212CMR_EXPORT
213size_t* CMRminorPivotRows(
214 CMR_MINOR* minor
215);
216
221CMR_EXPORT
223 CMR_MINOR* minor
224);
225
230CMR_EXPORT
232 CMR_MINOR* minor
233);
234
239CMR_EXPORT
241 CMR* cmr,
242 CMR_MINOR* minor,
243 size_t numRows,
244 size_t numColumns,
245 FILE* stream
246);
247
253CMR_EXPORT
255 CMR* cmr,
256 CMR_MINOR* minor,
257 size_t numRows,
258 size_t numColumns,
259 const char* fileName
260);
261
262
265#ifdef __cplusplus
266}
267#endif
268
269#endif /* CMR_MATROID_H */
Basic functionality of the software library.
CMR_ERROR
Type for return codes of library functions.
Definition env.h:32
Functionality for graphs.
CMR_EXPORT CMR_ERROR CMRminorCreate(CMR *cmr, CMR_MINOR **pminor, size_t numPivots, CMR_SUBMAT *submatrix, CMR_MINOR_TYPE type)
Creates a minor, allocating space for numPivots pivots and a remaining submatrix.
Definition matroid.c:382
CMR_EXPORT CMR_ERROR CMRchrmatTernaryPivot(CMR *cmr, CMR_CHRMAT *matrix, size_t pivotRow, size_t pivotColumn, CMR_CHRMAT **presult)
Applies a pivot to matrix and returns the resulting matrix in *presult.
Definition matroid.c:316
CMR_EXPORT CMR_ERROR CMRchrmatBinaryPivots(CMR *cmr, CMR_CHRMAT *matrix, size_t numPivots, size_t *pivotRows, size_t *pivotColumns, CMR_CHRMAT **presult)
Applies a sequence of pivots to matrix and returns the resulting matrix in *presult.
Definition matroid.c:339
CMR_EXPORT CMR_ERROR CMRchrmatRegularPivot(CMR *cmr, CMR_CHRMAT *matrix, size_t pivotRow, size_t pivotColumn, CMR_SUBMAT **pviolator, CMR_CHRMAT **presult)
Applies a pivot to matrix and returns the resulting matrix in *presult.
Definition matroid.c:327
CMR_EXPORT CMR_ERROR CMRchrmatTernaryPivots(CMR *cmr, CMR_CHRMAT *matrix, size_t numPivots, size_t *pivotRows, size_t *pivotColumns, CMR_CHRMAT **presult)
Applies a sequence of pivots to matrix and returns the resulting matrix in *presult.
Definition matroid.c:353
CMR_EXPORT CMR_SUBMAT * CMRminorSubmatrix(CMR_MINOR *minor)
Returns the submatrix to take (after applying pivots) to make a minor visible.
Definition matroid.c:449
CMR_EXPORT CMR_ERROR CMRchrmatBinaryPivot(CMR *cmr, CMR_CHRMAT *matrix, size_t pivotRow, size_t pivotColumn, CMR_CHRMAT **presult)
Apply a pivot to matrix and returns the resulting matrix in *presult.
Definition matroid.c:305
CMR_EXPORT CMR_ERROR CMRminorPrint(CMR *cmr, CMR_MINOR *minor, size_t numRows, size_t numColumns, FILE *stream)
Writes the minor minor to stream by means of lists of row and column indices as well as pivot entries...
Definition matroid.c:456
CMR_EXPORT CMR_ERROR CMRminorWriteToFile(CMR *cmr, CMR_MINOR *minor, size_t numRows, size_t numColumns, const char *fileName)
Writes the minor minor to the file fileName by means of lists of row and column indices as well as pi...
Definition matroid.c:468
CMR_EXPORT size_t CMRminorNumPivots(CMR_MINOR *minor)
Returns the number of pivots needed to make a minor visible.
Definition matroid.c:428
CMR_EXPORT CMR_ERROR CMRchrmatRegularPivots(CMR *cmr, CMR_CHRMAT *matrix, size_t numPivots, size_t *pivotRows, size_t *pivotColumns, CMR_SUBMAT **pviolator, CMR_CHRMAT **presult)
Applies a sequence of pivots to matrix and returns the resulting matrix in *presult.
Definition matroid.c:367
CMR_EXPORT CMR_ERROR CMRminorFree(CMR *cmr, CMR_MINOR **pminor)
Frees the minor *pminor (if pminor is not NULL).
Definition matroid.c:404
CMR_EXPORT CMR_MINOR_TYPE CMRminorType(CMR_MINOR *minor)
Returns the type of minor.
Definition matroid.c:421
CMR_EXPORT size_t * CMRminorPivotColumns(CMR_MINOR *minor)
Returns the array with pivot columns to make a minor visible.
Definition matroid.c:442
CMR_EXPORT size_t * CMRminorPivotRows(CMR_MINOR *minor)
Returns the array with pivot rows to make a minor visible.
Definition matroid.c:435
CMR_MINOR_TYPE
Definition matroid.h:127
@ CMR_MINOR_TYPE_U24
Definition matroid.h:134
@ CMR_MINOR_TYPE_K5_DUAL
Definition matroid.h:142
@ CMR_MINOR_TYPE_ENTRY
Definition matroid.h:130
@ CMR_MINOR_TYPE_FANO_DUAL
Definition matroid.h:138
@ CMR_MINOR_TYPE_K5
Definition matroid.h:140
@ CMR_MINOR_TYPE_K33
Definition matroid.h:144
@ CMR_MINOR_TYPE_DETERMINANT
Definition matroid.h:128
@ CMR_MINOR_TYPE_K33_DUAL
Definition matroid.h:146
@ CMR_MINOR_TYPE_CUSTOM
Definition matroid.h:132
@ CMR_MINOR_TYPE_FANO
Definition matroid.h:136
Functionality for sparse matrices.
Row-wise representation of sparse char matrix.
Definition matrix.h:235
Definition env_internal.h:45
A minor of a matroid.
Definition matroid.h:157
size_t * pivotColumns
Definition matroid.h:160
size_t numPivots
Definition matroid.h:158
CMR_SUBMAT * remainingSubmatrix
Definition matroid.h:161
size_t * pivotRows
Definition matroid.h:159
CMR_MINOR_TYPE type
Definition matroid.h:162
Row and column indices for a submatrix.
Definition matrix.h:28