CMR  1.3.0
dec.h
Go to the documentation of this file.
1 #ifndef CMR_DEC_H
2 #define CMR_DEC_H
3 
12 #include <cmr/env.h>
13 #include <cmr/element.h>
14 #include <cmr/matrix.h>
15 #include <cmr/graph.h>
16 
17 #include <stdio.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
29 struct _CMR_DEC;
30 
31 typedef struct _CMR_DEC CMR_DEC;
32 
33 typedef enum
34 {
53 
54 typedef enum
55 {
63 
64 CMR_EXPORT
66  CMR* cmr,
67  CMR_DEC** pdec
68 );
69 
74 CMR_EXPORT
75 bool CMRdecHasMatrix(
76  CMR_DEC* dec
77 );
78 
83 CMR_EXPORT
85  CMR_DEC* dec
86 );
87 
92 CMR_EXPORT
94  CMR_DEC* dec
95 );
96 
101 CMR_EXPORT
103  CMR_DEC* dec
104 );
105 
110 CMR_EXPORT
111 size_t CMRdecNumChildren(
112  CMR_DEC* dec
113 );
114 
115 /*
116  * \brief Returns a child of the decomposition node.
117  */
118 
119 CMR_EXPORT
121  CMR_DEC* dec,
122  size_t childIndex
123 );
124 
141 CMR_EXPORT
142 int CMRdecIsSum(
143  CMR_DEC* dec,
144  bool* plowerLeftHasNonzeros,
146  bool* pupperRightHasNonzeros
148 );
149 
154 CMR_EXPORT
156  CMR_DEC* dec,
157  int* prepresentationMatrix
158 );
159 
164 CMR_EXPORT
166  CMR_DEC* dec
167 );
168 
173 CMR_EXPORT
175  CMR_DEC* dec
176 );
177 
182 CMR_EXPORT
183 bool CMRdecIsGraphic(
184  CMR_DEC* dec
185 );
186 
191 CMR_EXPORT
192 bool CMRdecIsCographic(
193  CMR_DEC* dec
194 );
195 
200 CMR_EXPORT
201 bool CMRdecIsRegular(
202  CMR_DEC* dec
203 );
204 
209 CMR_EXPORT
211  CMR_DEC* dec
212 );
213 
218 CMR_EXPORT
219 bool CMRdecIsUnknown(
220  CMR_DEC* dec
221 );
222 
227 CMR_EXPORT
228 size_t CMRdecNumRows(
229  CMR_DEC* dec
230 );
231 
236 CMR_EXPORT
238  CMR_DEC* dec
239 );
240 
245 CMR_EXPORT
246 size_t* CMRdecRowsParent(
247  CMR_DEC* dec
248 );
249 
254 CMR_EXPORT
255 size_t CMRdecNumColumns(
256  CMR_DEC* dec
257 );
258 
263 CMR_EXPORT
265  CMR_DEC* dec
266 );
267 
272 CMR_EXPORT
273 size_t* CMRdecColumnsParent(
274  CMR_DEC* dec
275 );
276 
281 CMR_EXPORT
283  CMR* cmr,
284  CMR_DEC* dec,
285  FILE* stream,
286  size_t indent,
287  bool printMatrices,
288  bool printGraphs,
289  bool printReductions
290 );
291 
292 
304 CMR_EXPORT
305 char* CMRdecConsistency(
306  CMR_DEC* dec,
307  bool recurse
308 );
309 
314 CMR_EXPORT
316  CMR_DEC* dec
317 );
318 
323 CMR_EXPORT
325  CMR_DEC* dec
326 );
327 
332 CMR_EXPORT
333 size_t CMRdecGraphSizeForest(
334  CMR_DEC* dec
335 );
336 
341 CMR_EXPORT
343  CMR_DEC* dec
344 );
345 
350 CMR_EXPORT
352  CMR_DEC* dec
353 );
354 
359 CMR_EXPORT
361  CMR_DEC* dec
362 );
363 
368 CMR_EXPORT
370  CMR_DEC* dec
371 );
372 
377 CMR_EXPORT
379  CMR_DEC* dec
380 );
381 
386 CMR_EXPORT
388  CMR_DEC* dec
389 );
390 
395 CMR_EXPORT
397  CMR_DEC* dec
398 );
399 
400 
403 #ifdef __cplusplus
404 }
405 #endif
406 
407 #endif /* CMR_DEC_H */
Functionality for the row and column elements of a matrix.
int CMR_ELEMENT
Definition: element.h:20
Basic functionality of the software library.
CMR_ERROR
Type for return codes of library functions.
Definition: env.h:31
Functionality for graphs.
int CMR_GRAPH_EDGE
Reference to an edge of CMR_GRAPH.
Definition: graph.h:31
CMR_EXPORT size_t * CMRdecColumnsParent(CMR_DEC *dec)
Returns the mapping of columns to columns of parent.
Definition: dec.c:206
CMR_EXPORT CMR_GRAPH_EDGE * CMRdecCographCoforest(CMR_DEC *dec)
Returns the coforest of the cograph (if available).
Definition: dec.c:1278
CMR_EXPORT CMR_ERROR CMRdecFree(CMR *cmr, CMR_DEC **pdec)
Definition: dec.c:53
CMR_EXPORT size_t CMRdecNumChildren(CMR_DEC *dec)
Returns the number of children of the decomposition node.
Definition: dec.c:38
CMR_EXPORT size_t CMRdecGraphSizeCoforest(CMR_DEC *dec)
Returns the number of edges of the graph's coforest (if available).
Definition: dec.c:1243
CMR_DEC_TYPE
Definition: dec.h:34
CMR_EXPORT bool CMRdecIsGraphicLeaf(CMR_DEC *dec)
Returns true if and only if dec is a graphic leaf node.
Definition: dec.c:119
CMR_EXPORT CMR_GRAPH_EDGE * CMRdecCographForest(CMR_DEC *dec)
Returns the forest of the cograph (if available).
Definition: dec.c:1271
CMR_EXPORT CMR_GRAPH_EDGE * CMRdecGraphCoforest(CMR_DEC *dec)
Returns the coforest of the graph (if available).
Definition: dec.c:1236
CMR_EXPORT bool CMRdecIsRegular(CMR_DEC *dec)
Returns true if and only if dec is regular.
Definition: dec.c:164
CMR_EXPORT bool CMRdecIsUnknown(CMR_DEC *dec)
Returns true if and only if dec has yet unknown type.
Definition: dec.c:178
CMR_EXPORT size_t CMRdecNumColumns(CMR_DEC *dec)
Returns the number of columns.
Definition: dec.c:199
CMR_EXPORT CMR_ELEMENT * CMRdecRowElements(CMR_DEC *dec)
Returns the row elements.
CMR_EXPORT bool CMRdecIsGraphic(CMR_DEC *dec)
Returns true if and only if dec is graphic.
Definition: dec.c:150
CMR_EXPORT bool * CMRdecCographArcsReversed(CMR_DEC *dec)
Returns an array that indicates for the cograph's edges whether they must be reversed (if available).
Definition: dec.c:1285
CMR_EXPORT size_t CMRdecNumRows(CMR_DEC *dec)
Returns the number of rows.
Definition: dec.c:185
CMR_EXPORT CMR_DEC * CMRdecChild(CMR_DEC *dec, size_t childIndex)
Definition: dec.c:45
CMR_EXPORT bool * CMRdecGraphArcsReversed(CMR_DEC *dec)
Returns an array that indicates for the graph's edges whether they must be reversed (if available).
Definition: dec.c:1257
CMR_EXPORT bool CMRdecHasTranspose(CMR_DEC *dec)
Returns true iff the transposed matrix of the decomposition node is stored.
Definition: dec.c:17
CMR_EXPORT bool CMRdecIsSeriesParallelReduction(CMR_DEC *dec)
Returns true if and only if dec represents a series-parallel reduction.
Definition: dec.c:171
CMR_EXPORT bool CMRdecIsCographic(CMR_DEC *dec)
Returns true if and only if dec is cographic.
Definition: dec.c:157
CMR_EXPORT size_t CMRdecGraphSizeForest(CMR_DEC *dec)
Returns the number of edges of the graph's forest (if available).
Definition: dec.c:1222
CMR_EXPORT CMR_ERROR CMRdecPrint(CMR *cmr, CMR_DEC *dec, FILE *stream, size_t indent, bool printMatrices, bool printGraphs, bool printReductions)
Prints the decomposition dec to stream.
Definition: dec.c:213
CMR_DEC_FLAGS
Definition: dec.h:55
CMR_EXPORT bool CMRdecHasMatrix(CMR_DEC *dec)
Returns true iff the matrix of the decomposition node is stored.
Definition: dec.c:10
CMR_EXPORT CMR_GRAPH_EDGE * CMRdecGraphForest(CMR_DEC *dec)
Returns the forest of the graph (if available).
Definition: dec.c:1215
CMR_EXPORT char * CMRdecConsistency(CMR_DEC *dec, bool recurse)
Checks a decomposition for consistency.
Definition: dec.c:1180
CMR_EXPORT int CMRdecIsSum(CMR_DEC *dec, bool *plowerLeftHasNonzeros, bool *pupperRightHasNonzeros)
Returns k if dec is a k-sum node and 0 otherwise.
Definition: dec.c:91
CMR_EXPORT size_t * CMRdecRowsParent(CMR_DEC *dec)
Returns the mapping of rows to rows of parent.
Definition: dec.c:192
CMR_EXPORT CMR_GRAPH * CMRdecGraph(CMR_DEC *dec)
Returns the graph (if available).
Definition: dec.c:1208
CMR_EXPORT CMR_ELEMENT * CMRdecColumnElements(CMR_DEC *dec)
Returns the column elements.
CMR_EXPORT CMR_CHRMAT * CMRdecGetMatrix(CMR_DEC *dec)
Returns the matrix of the decomposition node (or NULL if it is not stored).
Definition: dec.c:24
CMR_EXPORT CMR_GRAPH * CMRdecCograph(CMR_DEC *dec)
Returns the cograph (if available).
Definition: dec.c:1264
CMR_EXPORT bool CMRdecIsCographicLeaf(CMR_DEC *dec)
Returns true if and only if dec is a cographic leaf node.
Definition: dec.c:126
CMR_EXPORT CMR_DEC_TYPE CMRdecIsSpecialLeaf(CMR_DEC *dec, int *prepresentationMatrix)
Returns the corresponding flag if dec is a special matrix node and 0 otherwise.
Definition: dec.c:133
CMR_EXPORT CMR_CHRMAT * CMRdecGetTranspose(CMR_DEC *dec)
Returns the transposed matrix of the decomposition node (or NULL if it is not stored).
Definition: dec.c:31
@ CMR_DEC_UNKNOWN
Definition: dec.h:36
@ CMR_DEC_GRAPHIC
Definition: dec.h:40
@ CMR_DEC_SPECIAL_FANO_DUAL
Definition: dec.h:47
@ CMR_DEC_ONE_SUM
Definition: dec.h:37
@ CMR_DEC_THREE_SUM
Definition: dec.h:39
@ CMR_DEC_IRREGULAR
Definition: dec.h:35
@ CMR_DEC_SPECIAL_FANO
Definition: dec.h:46
@ CMR_DEC_SPECIAL_K_5
Definition: dec.h:48
@ CMR_DEC_COGRAPHIC
Definition: dec.h:41
@ CMR_DEC_SPECIAL_K_5_DUAL
Definition: dec.h:49
@ CMR_DEC_SPECIAL_R10
Definition: dec.h:45
@ CMR_DEC_SPECIAL_K_3_3
Definition: dec.h:50
@ CMR_DEC_SERIES_PARALLEL
Definition: dec.h:43
@ CMR_DEC_TWO_SUM
Definition: dec.h:38
@ CMR_DEC_PLANAR
Definition: dec.h:42
@ CMR_DEC_SPECIAL_K_3_3_DUAL
Definition: dec.h:51
@ CMR_DEC_HAS_UPPER_RIGHT_NONZEROS
Definition: dec.h:61
@ CMR_DEC_HAS_LOWER_LEFT_NONZEROS
Definition: dec.h:60
@ CMR_DEC_MASK_REPRESENTATION
Definition: dec.h:56
@ CMR_DEC_IS_COGRAPHIC
Definition: dec.h:58
@ CMR_DEC_IS_GRAPHIC
Definition: dec.h:57
@ CMR_DEC_IS_REGULAR
Definition: dec.h:59
Functionality for sparse matrices.
Row-wise representation of sparse char matrix.
Definition: matrix.h:204
Definition: env_internal.h:45
Definition: graph.h:49
Definition: dec_internal.h:9