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
143 size_t reprRows[2][3],
144 size_t reprColumns[2][3]
156 size_t* columnsToPart,
157 size_t* pnumPartRows,
158 size_t* pnumPartColumns
254 int8_t characteristic,
309 int8_t characteristic,
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:32
Functionality for sparse matrices.
CMR_EXPORT CMR_ERROR CMRoneSum(CMR *cmr, CMR_CHRMAT *first, CMR_CHRMAT *second, CMR_CHRMAT **presult)
Constructs the 1-sum of the two matrices first and second.
Definition: separation.c:981
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:719
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:953
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 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:45
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:627
CMR_EXPORT CMR_ERROR CMRtwoSum(CMR *cmr, CMR_CHRMAT *first, CMR_CHRMAT *second, CMR_ELEMENT firstMarker, CMR_ELEMENT secondMarker, int8_t characteristic, CMR_CHRMAT **presult)
Constructs the 2-sum of the two matrices first and second via firstMarker and secondMarker.
Definition: separation.c:1013
CMR_EXPORT CMR_ERROR CMRsepaGetRepresentatives(CMR *cmr, 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:671
CMR_EXPORT CMR_ERROR CMRsepaFree(CMR *cmr, CMR_SEPA **psepa)
Frees a separation.
Definition: separation.c:29
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 CMRthreeSum(CMR *cmr, CMR_CHRMAT *first, CMR_CHRMAT *second, CMR_ELEMENT firstMarker1, CMR_ELEMENT secondMarker1, CMR_ELEMENT firstMarker2, CMR_ELEMENT secondMarker2, int8_t characteristic, CMR_CHRMAT **presult)
Constructs the 3-sum of the two matrices first and second via firstMarker1, firstMarker2,...
Definition: separation.c:1225
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:11
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:652
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:923
Row-wise representation of sparse char matrix.
Definition: matrix.h:204
Definition: env_internal.h:45
Definition: separation.h:52
CMR_SEPA_FLAGS * rowsFlags
Array with each row's flags.
Definition: separation.h:55
size_t numRows
Number of rows of the matrix.
Definition: separation.h:53
CMR_SEPA_FLAGS * columnsFlags
Array with each column's flags.
Definition: separation.h:56
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