1 #ifndef CMR_SEPARATION_H
2 #define CMR_SEPARATION_H
91 size_t* pnumRowsTopLeft,
92 size_t* pnumColumnsTopLeft,
93 size_t* pnumRowsBottomRight,
94 size_t* pnumColumnsBottomRight
142 size_t reprRows[2][3],
143 size_t reprColumns[2][3]
155 size_t* columnsToPart,
156 size_t* pnumPartRows,
157 size_t* pnumPartColumns
264 size_t* firstSpecialRows,
265 size_t* firstSpecialColumns,
266 size_t* secondSpecialRows,
267 size_t* secondSpecialColumns,
268 int8_t characteristic,
300 size_t* firstRowsOrigin,
302 size_t* firstColumnsOrigin,
306 size_t* columnsToFirst,
308 size_t* firstSpecialRows,
310 size_t* firstSpecialColumns
343 size_t* secondRowsOrigin,
345 size_t* secondColumnsOrigin,
347 size_t* rowsToSecond,
349 size_t* columnsToSecond,
351 size_t* secondSpecialRows,
353 size_t* secondSpecialColumns
399 size_t* firstSpecialRows,
402 size_t* firstSpecialColumns,
406 size_t* secondSpecialRows,
409 size_t* secondSpecialColumns,
413 int8_t characteristic,
474 size_t* firstRowsOrigin,
476 size_t* firstColumnsOrigin,
480 size_t* columnsToFirst,
482 size_t* firstSpecialRows,
485 size_t* firstSpecialColumns
521 size_t* secondRowsOrigin,
523 size_t* secondColumnsOrigin,
525 size_t* rowsToSecond,
527 size_t* columnsToSecond,
529 size_t* secondSpecialRows,
532 size_t* secondSpecialColumns
599 size_t* firstSpecialRows,
600 size_t* firstSpecialColumns,
601 size_t* secondSpecialRows,
602 size_t* secondSpecialColumns,
603 int8_t characteristic,
654 size_t* specialColumns,
710 size_t* specialColumns,
713 size_t* firstRowsOrigin,
715 size_t* firstColumnsOrigin,
719 size_t* columnsToFirst,
721 size_t* firstSpecialRows,
723 size_t* firstSpecialColumns
778 size_t* specialColumns,
782 size_t* secondRowsOrigin,
784 size_t* secondColumnsOrigin,
786 size_t* rowsToSecond,
788 size_t* columnsToSecond,
790 size_t* secondSpecialRows,
792 size_t* secondSpecialColumns
Functionality for the row and column elements of a matrix.
Basic functionality of the software library.
CMR_ERROR
Type for return codes of library functions.
Definition: env.h:32
Functionality for sparse matrices.
CMR_EXPORT CMR_ERROR CMRtwoSumCompose(CMR *cmr, CMR_CHRMAT *first, CMR_CHRMAT *second, size_t *firstSpecialRows, size_t *firstSpecialColumns, size_t *secondSpecialRows, size_t *secondSpecialColumns, int8_t characteristic, CMR_CHRMAT **presult)
Composes the 2-sum of the two matrices first and second with connecting elements firstMarker and seco...
Definition: separation.c:1032
CMR_EXPORT CMR_ERROR CMRtwoSumDecomposeSecond(CMR *cmr, CMR_CHRMAT *matrix, CMR_SEPA *sepa, CMR_CHRMAT **psecond, size_t *secondRowsOrigin, size_t *secondColumnsOrigin, size_t *rowsToSecond, size_t *columnsToSecond, size_t *secondSpecialRows, size_t *secondSpecialColumns)
Decomposes matrix as a 2-sum according to the 2-separation sepa, computing the second component.
Definition: separation.c:1398
CMR_EXPORT CMR_ERROR CMRthreeSumTruemperCompose(CMR *cmr, CMR_CHRMAT *first, CMR_CHRMAT *second, size_t *firstSpecialRows, size_t *firstSpecialColumns, size_t *secondSpecialRows, size_t *secondSpecialColumns, int8_t characteristic, CMR_CHRMAT **presult)
Constructs the Truemper 3-sum of the two matrices first and second at connecting rows firstSpecialRow...
Definition: separation.c:2386
CMR_EXPORT CMR_ERROR CMRsepaGetProjection(CMR_SEPA *sepa, size_t part, size_t *rowsToPart, size_t *columnsToPart, size_t *pnumPartRows, size_t *pnumPartColumns)
Creates mappings from rows/columns to those of part; also maps up to 3 representative rows/columns.
Definition: separation.c:720
CMR_EXPORT CMR_ERROR CMRsepaCheckTernarySubmatrix(CMR *cmr, CMR_SEPA *sepa, CMR_CHRMAT *matrix, CMR_SUBMAT *submatrix, bool *pisTernary, CMR_SUBMAT **pviolator)
Checks for a submatrix of a given matrix whether the binary k-separation is also a ternary one.
Definition: separation.c:954
CMR_EXPORT CMR_ERROR CMRoneSumCompose(CMR *cmr, size_t numMatrices, CMR_CHRMAT **matrices, CMR_CHRMAT **presult)
Composes the 1-sum of the several matrices.
Definition: separation.c:982
CMR_SEPA_TYPE
Definition: separation.h:42
@ CMR_SEPA_TYPE_TWO
Definition: separation.h:43
@ CMR_SEPA_TYPE_THREE_DISTRIBUTED_RANKS
Definition: separation.h:45
@ CMR_SEPA_TYPE_THREE_CONCENTRATED_RANK
Definition: separation.h:47
CMR_EXPORT CMR_ERROR CMRtwoSumDecomposeFirst(CMR *cmr, CMR_CHRMAT *matrix, CMR_SEPA *sepa, CMR_CHRMAT **pfirst, size_t *firstRowsOrigin, size_t *firstColumnsOrigin, size_t *rowsToFirst, size_t *columnsToFirst, size_t *firstSpecialRows, size_t *firstSpecialColumns)
Decomposes matrix as a 2-sum according to the 2-separation sepa, computing the first component.
Definition: separation.c:1248
CMR_EXPORT CMR_ERROR CMRsepaComputeSizes(CMR_SEPA *sepa, size_t *pnumRowsTopLeft, size_t *pnumColumnsTopLeft, size_t *pnumRowsBottomRight, size_t *pnumColumnsBottomRight)
Computes the sizes of the top-left and bottom-right parts.
Definition: separation.c:47
CMR_EXPORT CMR_ERROR CMRsepaFindBinaryRepresentatives(CMR *cmr, CMR_SEPA *sepa, CMR_CHRMAT *matrix, CMR_CHRMAT *transpose, bool *pswapped, CMR_SUBMAT **pviolator)
Scans the support of matrix to compute all representative rows/columns for sepa and sets the type.
Definition: separation.c:629
CMR_EXPORT CMR_ERROR CMRthreeSumSeymourCompose(CMR *cmr, CMR_CHRMAT *first, CMR_CHRMAT *second, size_t *firstSpecialRows, size_t *firstSpecialColumns, size_t *secondSpecialRows, size_t *secondSpecialColumns, int8_t characteristic, CMR_CHRMAT **presult)
Constructs the Seymour 3-sum of the two matrices first and second via firstMarker1,...
Definition: separation.c:1574
CMR_EXPORT CMR_ERROR CMRsepaFree(CMR *cmr, CMR_SEPA **psepa)
Frees a separation.
Definition: separation.c:31
CMR_SEPA_FLAGS
Definition: separation.h:24
@ CMR_SEPA_SECOND
Definition: separation.h:27
@ CMR_SEPA_MASK_EXTRA
Definition: separation.h:37
@ CMR_SEPA_FIRST
Definition: separation.h:25
@ CMR_SEPA_FLAG_RANK2
Definition: separation.h:31
@ CMR_SEPA_FLAG_RANK1
Definition: separation.h:29
@ CMR_SEPA_MASK_CHILD
Definition: separation.h:35
CMR_EXPORT CMR_ERROR CMRthreeSumTruemperDecomposeSecond(CMR *cmr, CMR_CHRMAT *matrix, CMR_SEPA *sepa, size_t *specialRows, size_t *specialColumns, char gamma, CMR_CHRMAT **psecond, size_t *secondRowsOrigin, size_t *secondColumnsOrigin, size_t *rowsToSecond, size_t *columnsToSecond, size_t *secondSpecialRows, size_t *secondSpecialColumns)
Decomposes matrix as a Truemper 3-sum according to the 3-separation sepa, computing the second compon...
Definition: separation.c:3277
CMR_EXPORT CMR_ERROR CMRthreeSumSeymourDecomposeFirst(CMR *cmr, CMR_CHRMAT *matrix, CMR_SEPA *sepa, char epsilon, CMR_CHRMAT **pfirst, size_t *firstRowsOrigin, size_t *firstColumnsOrigin, size_t *rowsToFirst, size_t *columnsToFirst, size_t *firstSpecialRows, size_t *firstSpecialColumns)
Decomposes matrix as a Seymour 3-sum according to the 3-separation sepa, computing the first componen...
Definition: separation.c:2051
CMR_EXPORT CMR_ERROR CMRsepaCreate(CMR *cmr, size_t numRows, size_t numColumns, CMR_SEPA **psepa)
Creates a 2- or 3-separation.
Definition: separation.c:13
CMR_EXPORT CMR_ERROR CMRthreeSumTruemperDecomposeFirst(CMR *cmr, CMR_CHRMAT *matrix, CMR_SEPA *sepa, size_t *specialRows, size_t *specialColumns, char beta, CMR_CHRMAT **pfirst, size_t *firstRowsOrigin, size_t *firstColumnsOrigin, size_t *rowsToFirst, size_t *columnsToFirst, size_t *firstSpecialRows, size_t *firstSpecialColumns)
Decomposes matrix as a Truemper 3-sum according to the 3-separation sepa, computing the first compone...
Definition: separation.c:3149
CMR_EXPORT CMR_ERROR CMRthreeSumSeymourDecomposeEpsilon(CMR *cmr, CMR_CHRMAT *matrix, CMR_CHRMAT *transpose, CMR_SEPA *sepa, char *pepsilon)
Decomposes matrix as a Seymour 3-sum according to the 3-separation sepa, computing .
Definition: separation.c:1936
CMR_EXPORT CMR_ERROR CMRsepaFindBinaryRepresentativesSubmatrix(CMR *cmr, CMR_SEPA *sepa, CMR_CHRMAT *matrix, CMR_CHRMAT *transpose, CMR_SUBMAT *submatrix, bool *pswapped, CMR_SUBMAT **pviolator)
Scans the support of submatrix of matrix to compute all representative rows/columns for sepa and sets...
Definition: separation.c:654
CMR_EXPORT CMR_ERROR CMRthreeSumTruemperDecomposeConnecting(CMR *cmr, CMR_CHRMAT *matrix, CMR_CHRMAT *transpose, CMR_SEPA *sepa, size_t *specialRows, size_t *specialColumns, char *pgamma, char *pbeta)
Decomposes matrix as a Truemper 3-sum according to the 3-separation sepa, computing the connecing mat...
Definition: separation.c:3135
CMR_EXPORT CMR_ERROR CMRsepaGetRepresentatives(CMR_SEPA *sepa, size_t reprRows[2][3], size_t reprColumns[2][3])
Returns representative rows/columns of the low-rank submatrices.
Definition: separation.c:673
CMR_EXPORT CMR_ERROR CMRthreeSumSeymourDecomposeSecond(CMR *cmr, CMR_CHRMAT *matrix, CMR_SEPA *sepa, char epsilon, CMR_CHRMAT **psecond, size_t *secondRowsOrigin, size_t *secondColumnsOrigin, size_t *rowsToSecond, size_t *columnsToSecond, size_t *secondSpecialRows, size_t *secondSpecialColumns)
Decomposes matrix as a Seymour 3-sum according to the 3-separation sepa, computing the second compone...
Definition: separation.c:2210
CMR_EXPORT CMR_ERROR CMRsepaCheckTernary(CMR *cmr, CMR_SEPA *sepa, CMR_CHRMAT *matrix, bool *pisTernary, CMR_SUBMAT **pviolator)
Checks for a given matrix whether the binary k-separation is also a ternary one.
Definition: separation.c:924
Row-wise representation of sparse char matrix.
Definition: matrix.h:220
Definition: env_internal.h:45
Definition: separation.h:52
int * columnsFlags
Array with each column's flags; logical OR of CMR_SEPA_TYPE.
Definition: separation.h:56
size_t numRows
Number of rows of the matrix.
Definition: separation.h:53
int * rowsFlags
Array with each row's flags; logical OR of CMR_SEPA_TYPE.
Definition: separation.h:55
size_t numColumns
Number of columns of the matrix.
Definition: separation.h:54
CMR_SEPA_TYPE type
Type of separation.
Definition: separation.h:57
Row and column indices for a submatrix.
Definition: matrix.h:28