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
398 size_t* firstSpecialRows,
401 size_t* firstSpecialColumns,
405 size_t* secondSpecialRows,
408 size_t* secondSpecialColumns,
412 int8_t characteristic,
473 size_t* firstRowsOrigin,
475 size_t* firstColumnsOrigin,
479 size_t* columnsToFirst,
481 size_t* firstSpecialRows,
484 size_t* firstSpecialColumns
520 size_t* secondRowsOrigin,
522 size_t* secondColumnsOrigin,
524 size_t* rowsToSecond,
526 size_t* columnsToSecond,
528 size_t* secondSpecialRows,
531 size_t* secondSpecialColumns
598 size_t* firstSpecialRows,
599 size_t* firstSpecialColumns,
600 size_t* secondSpecialRows,
601 size_t* secondSpecialColumns,
602 int8_t characteristic,
653 size_t* specialColumns,
709 size_t* specialColumns,
712 size_t* firstRowsOrigin,
714 size_t* firstColumnsOrigin,
718 size_t* columnsToFirst,
720 size_t* firstSpecialRows,
722 size_t* firstSpecialColumns
777 size_t* specialColumns,
781 size_t* secondRowsOrigin,
783 size_t* secondColumnsOrigin,
785 size_t* rowsToSecond,
787 size_t* columnsToSecond,
789 size_t* secondSpecialRows,
791 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:1033
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:1399
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:2399
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:721
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:955
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:983
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:1249
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:48
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:630
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.
Definition: separation.c:1575
CMR_EXPORT CMR_ERROR CMRsepaFree(CMR *cmr, CMR_SEPA **psepa)
Frees a separation.
Definition: separation.c:32
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:3351
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:2064
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:14
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:3223
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:1949
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:655
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:3209
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:674
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:2223
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:925
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