136 size_t* pnumMatrixRows,
137 size_t* pnumMatrixColumns,
294 size_t newNumNonzeros
305 size_t newNumNonzeros
316 size_t newNumNonzeros
575 const char* fileName,
576 const char* stdinName,
590 const char* fileName,
591 const char* stdinName,
605 const char* fileName,
606 const char* stdinName,
659 const char* fileName,
660 const char* stdinName,
674 const char* fileName,
675 const char* stdinName,
689 const char* fileName,
690 const char* stdinName,
Basic functionality of the software library.
CMR_ERROR
Type for return codes of library functions.
Definition: env.h:32
CMR_EXPORT CMR_ERROR CMRchrmatToInt(CMR *cmr, CMR_CHRMAT *matrix, CMR_INTMAT **presult)
Converts a char matrix to an int matrix.
Definition: matrix.c:2667
CMR_EXPORT CMR_ERROR CMRchrmatCreateFromDenseFile(CMR *cmr, const char *fileName, const char *stdinName, CMR_CHRMAT **presult)
Reads a char matrix from a file name fileName in dense format.
Definition: matrix.c:1725
CMR_EXPORT CMR_ERROR CMRdblmatSupport(CMR *cmr, CMR_DBLMAT *matrix, double epsilon, CMR_CHRMAT **presult)
Creates the (binary) support matrix of a double matrix as a char matrix with absolute error tolerance...
Definition: matrix.c:2484
CMR_EXPORT CMR_ERROR CMRintmatSupport(CMR *cmr, CMR_INTMAT *matrix, CMR_CHRMAT **presult)
Creates the (binary) support matrix of an int matrix as a char matrix.
Definition: matrix.c:2516
CMR_EXPORT CMR_ERROR CMRchrmatPrintDense(CMR *cmr, CMR_CHRMAT *matrix, FILE *stream, char zeroChar, bool header)
Prints a char matrix in dense format.
Definition: matrix.c:965
CMR_EXPORT CMR_ERROR CMRdblmatSignedSupport(CMR *cmr, CMR_DBLMAT *matrix, double epsilon, CMR_CHRMAT **presult)
Creates the (ternary) signed support matrix of a double matrix as a char matrix with absolute error t...
Definition: matrix.c:2572
CMR_EXPORT char * CMRdblmatConsistency(CMR_DBLMAT *matrix)
Checks a double matrix for consistency.
Definition: matrix.c:1994
CMR_EXPORT char * CMRchrmatConsistency(CMR_CHRMAT *matrix)
Checks a char matrix for consistency.
Definition: matrix.c:2070
CMR_EXPORT CMR_ERROR CMRsubmatFree(CMR *cmr, CMR_SUBMAT **psubmatrix)
Frees a submatrix.
Definition: matrix.c:45
CMR_EXPORT CMR_ERROR CMRintmatCreateFromDenseStream(CMR *cmr, FILE *stream, CMR_INTMAT **presult)
Reads an int matrix from a file stream in dense format.
Definition: matrix.c:1517
CMR_EXPORT bool CMRdblmatIsBinary(CMR *cmr, CMR_DBLMAT *matrix, double epsilon, CMR_SUBMAT **psubmatrix)
Checks if a double matrix has only entries in with absolute error tolerance epsilon.
Definition: matrix.c:2112
CMR_EXPORT bool CMRintmatCheckEqual(CMR_INTMAT *matrix1, CMR_INTMAT *matrix2)
Checks whether two int matrices are equal.
Definition: matrix.c:1792
CMR_EXPORT CMR_ERROR CMRchrmatCheckTranspose(CMR *cmr, CMR_CHRMAT *matrix1, CMR_CHRMAT *matrix2, bool *pareTranspose)
Checks whether two char matrices are transposes of each other.
Definition: matrix.c:1950
CMR_EXPORT CMR_ERROR CMRdblmatZoomSubmat(CMR *cmr, CMR_DBLMAT *matrix, CMR_SUBMAT *submatrix, CMR_DBLMAT **presult)
Creates a submatrix of a double matrix as an explicit matrix.
Definition: matrix.c:2264
CMR_EXPORT CMR_ERROR CMRintmatFindEntry(CMR_INTMAT *matrix, size_t row, size_t column, size_t *pentry)
Finds a specific entry of an int matrix.
Definition: matrix.c:2739
CMR_EXPORT CMR_ERROR CMRsubmatZoomSubmat(CMR *cmr, CMR_SUBMAT *reference, CMR_SUBMAT *input, CMR_SUBMAT **poutput)
Returns the submatrix input as a submatrix of the reference submatrix.
Definition: matrix.c:76
CMR_EXPORT CMR_ERROR CMRdblmatCreate(CMR *cmr, CMR_DBLMAT **presult, int numRows, int numColumns, int numNonzeros)
Creates a double matrix of with numRows rows, numColumns columns and numNonzeros nonzeros....
Definition: matrix.c:261
CMR_EXPORT CMR_ERROR CMRintmatZoomSubmat(CMR *cmr, CMR_INTMAT *matrix, CMR_SUBMAT *submatrix, CMR_INTMAT **presult)
Creates a submatrix of an int matrix as an explicit matrix.
Definition: matrix.c:2333
CMR_EXPORT CMR_ERROR CMRchrmatZoomSubmat(CMR *cmr, CMR_CHRMAT *matrix, CMR_SUBMAT *submatrix, CMR_CHRMAT **presult)
Creates a submatrix of a char matrix as an explicit matrix.
Definition: matrix.c:2471
CMR_EXPORT CMR_ERROR CMRchrmatPermute(CMR *cmr, CMR_CHRMAT *matrix, size_t *rows, size_t *columns, CMR_CHRMAT **presult)
Creates the char matrix obtained from matrix by applying row- and column-permutations.
Definition: matrix.c:775
CMR_EXPORT CMR_ERROR CMRdblmatCreateFromSparseFile(CMR *cmr, const char *fileName, const char *stdinName, CMR_DBLMAT **presult)
Reads a double matrix from a file name fileName in sparse format.
Definition: matrix.c:1349
CMR_EXPORT CMR_ERROR CMRintmatPrintDense(CMR *cmr, CMR_INTMAT *matrix, FILE *stream, char zeroChar, bool header)
Prints an int matrix in dense format.
Definition: matrix.c:923
CMR_EXPORT CMR_ERROR CMRintmatToChr(CMR *cmr, CMR_INTMAT *matrix, CMR_CHRMAT **presult)
Converts an int matrix to a char matrix.
Definition: matrix.c:2688
CMR_EXPORT bool CMRdblmatIsTernary(CMR *cmr, CMR_DBLMAT *matrix, double epsilon, CMR_SUBMAT **psubmatrix)
Checks if a double matrix has only entries in with absolute error tolerance epsilon.
Definition: matrix.c:2188
CMR_EXPORT CMR_ERROR CMRchrmatSignedSupport(CMR *cmr, CMR_CHRMAT *matrix, CMR_CHRMAT **presult)
Creates the (ternary) signed support matrix of a char matrix as a char matrix.
Definition: matrix.c:2639
CMR_EXPORT CMR_ERROR CMRchrmatSupport(CMR *cmr, CMR_CHRMAT *matrix, CMR_CHRMAT **presult)
Creates the (binary) support matrix of a char matrix as a char matrix.
Definition: matrix.c:2544
CMR_EXPORT CMR_ERROR CMRintmatSortNonzeros(CMR *cmr, CMR_INTMAT *matrix)
Sorts the nonzeros of an int matrix by column in ascending order.
Definition: matrix.c:457
CMR_EXPORT CMR_ERROR CMRsubmatCreate1x1(CMR *cmr, size_t row, size_t column, CMR_SUBMAT **psubmatrix)
Creates a 1-by-1 submatrix.
Definition: matrix.c:33
CMR_EXPORT bool CMRchrmatIsBinary(CMR *cmr, CMR_CHRMAT *matrix, CMR_SUBMAT **psubmatrix)
Checks if a char matrix has only entries in .
Definition: matrix.c:2163
CMR_EXPORT CMR_ERROR CMRintmatCheckTranspose(CMR *cmr, CMR_INTMAT *matrix1, CMR_INTMAT *matrix2, bool *pareTranspose)
Checks whether two int matrices are transposes of each other.
Definition: matrix.c:1906
CMR_EXPORT CMR_ERROR CMRchrmatFindEntry(CMR_CHRMAT *matrix, size_t row, size_t column, size_t *pentry)
Finds a specific entry of a char matrix.
Definition: matrix.c:2765
CMR_EXPORT CMR_ERROR CMRchrmatPrintSparse(CMR *cmr, CMR_CHRMAT *matrix, FILE *stream)
Prints a char matrix in sparse format.
Definition: matrix.c:861
CMR_EXPORT CMR_ERROR CMRintmatPermute(CMR *cmr, CMR_INTMAT *matrix, size_t *rows, size_t *columns, CMR_INTMAT **presult)
Creates the int matrix obtained from matrix by applying row- and column-permutations.
Definition: matrix.c:729
CMR_EXPORT CMR_ERROR CMRintmatChangeNumNonzeros(CMR *cmr, CMR_INTMAT *matrix, size_t newNumNonzeros)
Changes the number of nonzeros and reallocates corresponding arrays.
Definition: matrix.c:408
CMR_EXPORT CMR_ERROR CMRdblmatFree(CMR *cmr, CMR_DBLMAT **pmatrix)
Frees the memory of a double matrix.
Definition: matrix.c:330
CMR_EXPORT CMR_ERROR CMRdblmatPrintDense(CMR *cmr, CMR_DBLMAT *matrix, FILE *stream, char zeroChar, bool header)
Prints a double matrix in dense format.
Definition: matrix.c:881
CMR_EXPORT bool CMRintmatIsTernary(CMR *cmr, CMR_INTMAT *matrix, CMR_SUBMAT **psubmatrix)
Checks if an int matrix has only entries in .
Definition: matrix.c:2214
CMR_EXPORT CMR_ERROR CMRintmatCopy(CMR *cmr, CMR_INTMAT *matrix, CMR_INTMAT **presult)
Copies an int matrix to a newly allocated one.
Definition: matrix.c:511
CMR_EXPORT CMR_ERROR CMRchrmatCreateFromSparseStream(CMR *cmr, FILE *stream, CMR_CHRMAT **presult)
Reads a char matrix from a file stream in sparse format.
Definition: matrix.c:1264
CMR_EXPORT CMR_ERROR CMRdblmatCreateFromDenseFile(CMR *cmr, const char *fileName, const char *stdinName, CMR_DBLMAT **presult)
Reads a double matrix from a file name fileName in dense format.
Definition: matrix.c:1661
CMR_EXPORT bool CMRchrmatIsTernary(CMR *cmr, CMR_CHRMAT *matrix, CMR_SUBMAT **psubmatrix)
Checks if a double matrix has only entries in .
Definition: matrix.c:2239
CMR_EXPORT CMR_ERROR CMRchrmatTranspose(CMR *cmr, CMR_CHRMAT *matrix, CMR_CHRMAT **presult)
Creates the transpose of a char matrix.
Definition: matrix.c:639
CMR_EXPORT CMR_ERROR CMRchrmatCreate(CMR *cmr, CMR_CHRMAT **presult, int numRows, int numColumns, int numNonzeros)
Creates a char matrix of with numRows rows, numColumns columns and numNonzeros nonzeros....
Definition: matrix.c:308
CMR_EXPORT CMR_ERROR CMRdblmatFindBinarySubmatrix(CMR *cmr, CMR_DBLMAT *matrix, double epsilon, CMR_SUBMAT **psubmatrix)
Finds a large binary submatrix with absolute error tolerance epsilon.
Definition: matrix.c:2916
CMR_EXPORT CMR_ERROR CMRintmatCreate(CMR *cmr, CMR_INTMAT **presult, int numRows, int numColumns, int numNonzeros)
Creates an int matrix of with numRows rows, numColumns columns and numNonzeros nonzeros....
Definition: matrix.c:285
CMR_EXPORT CMR_ERROR CMRchrmatChangeNumNonzeros(CMR *cmr, CMR_CHRMAT *matrix, size_t newNumNonzeros)
Changes the number of nonzeros and reallocates corresponding arrays.
Definition: matrix.c:420
CMR_EXPORT CMR_ERROR CMRdblmatFindTernarySubmatrix(CMR *cmr, CMR_DBLMAT *matrix, double epsilon, CMR_SUBMAT **psubmatrix)
Finds a large ternary submatrix with absolute error tolerance epsilon.
Definition: matrix.c:2944
CMR_EXPORT CMR_ERROR CMRchrmatFree(CMR *cmr, CMR_CHRMAT **pmatrix)
Frees the memory of a char matrix.
Definition: matrix.c:374
CMR_EXPORT CMR_ERROR CMRchrmatCreateFromSparseFile(CMR *cmr, const char *fileName, const char *stdinName, CMR_CHRMAT **presult)
Reads a char matrix from a file name fileName in sparse format.
Definition: matrix.c:1413
CMR_EXPORT CMR_ERROR CMRintmatPrintSparse(CMR *cmr, CMR_INTMAT *matrix, FILE *stream)
Prints an int matrix in sparse format.
Definition: matrix.c:841
CMR_EXPORT bool CMRdblmatCheckEqual(CMR_DBLMAT *matrix1, CMR_DBLMAT *matrix2)
Checks whether two double matrices are equal.
Definition: matrix.c:1757
CMR_EXPORT CMR_ERROR CMRintmatCreateFromDenseFile(CMR *cmr, const char *fileName, const char *stdinName, CMR_INTMAT **presult)
Reads an int matrix from a file name fileName in dense format.
Definition: matrix.c:1693
CMR_EXPORT CMR_ERROR CMRintmatSignedSupport(CMR *cmr, CMR_INTMAT *matrix, CMR_CHRMAT **presult)
Creates the (ternary) signed support matrix of an int matrix as a char matrix.
Definition: matrix.c:2611
CMR_EXPORT CMR_ERROR CMRdblmatTranspose(CMR *cmr, CMR_DBLMAT *matrix, CMR_DBLMAT **presult)
Creates the transpose of a double matrix.
Definition: matrix.c:551
CMR_EXPORT CMR_ERROR CMRchrmatCopy(CMR *cmr, CMR_CHRMAT *matrix, CMR_CHRMAT **presult)
Copies a char matrix to a newly allocated one.
Definition: matrix.c:531
CMR_EXPORT CMR_ERROR CMRchrmatCreateFromDenseStream(CMR *cmr, FILE *stream, CMR_CHRMAT **presult)
Reads a char matrix from a file stream in dense format.
Definition: matrix.c:1589
CMR_EXPORT CMR_ERROR CMRintmatTranspose(CMR *cmr, CMR_INTMAT *matrix, CMR_INTMAT **presult)
Creates the transpose of an int matrix.
Definition: matrix.c:595
CMR_EXPORT CMR_ERROR CMRdblmatCopy(CMR *cmr, CMR_DBLMAT *matrix, CMR_DBLMAT **presult)
Copies a double matrix to a newly allocated one.
Definition: matrix.c:491
CMR_EXPORT CMR_ERROR CMRintmatCreateFromSparseStream(CMR *cmr, FILE *stream, CMR_INTMAT **presult)
Reads an int matrix from a file stream in sparse format.
Definition: matrix.c:1157
CMR_EXPORT CMR_ERROR CMRintmatFree(CMR *cmr, CMR_INTMAT **pmatrix)
Frees the memory of an int matrix.
Definition: matrix.c:352
CMR_EXPORT CMR_ERROR CMRsubmatTranspose(CMR_SUBMAT *submatrix)
Transposes a submatrix.
Definition: matrix.c:61
CMR_EXPORT CMR_ERROR CMRdblmatPrintSparse(CMR *cmr, CMR_DBLMAT *matrix, FILE *stream)
Prints a double matrix in sparse format.
Definition: matrix.c:821
CMR_EXPORT CMR_ERROR CMRdblmatCheckTranspose(CMR *cmr, CMR_DBLMAT *matrix1, CMR_DBLMAT *matrix2, bool *pareTranspose)
Checks whether two double matrices are transposes of each other.
Definition: matrix.c:1862
CMR_EXPORT CMR_ERROR CMRdblmatCreateFromDenseStream(CMR *cmr, FILE *stream, CMR_DBLMAT **presult)
Reads a double matrix from a file stream in dense format.
Definition: matrix.c:1445
CMR_EXPORT CMR_ERROR CMRsubmatReadFromStream(CMR *cmr, CMR_SUBMAT **psubmatrix, size_t *pnumMatrixRows, size_t *pnumMatrixColumns, FILE *stream)
Reads the submatrix *psubmatrix from the file stream.
Definition: matrix.c:194
CMR_EXPORT CMR_ERROR CMRsubmatWriteToFile(CMR *cmr, CMR_SUBMAT *submatrix, size_t numRows, size_t numColumns, const char *fileName)
Writes the submatrix submatrix to the file \fileName by means of lists of row and column indices.
Definition: matrix.c:171
CMR_EXPORT CMR_ERROR CMRdblmatFindEntry(CMR_DBLMAT *matrix, size_t row, size_t column, size_t *pentry)
Finds a specific entry of a double matrix.
Definition: matrix.c:2713
CMR_EXPORT CMR_ERROR CMRdblmatSortNonzeros(CMR *cmr, CMR_DBLMAT *matrix)
Sorts the nonzeros of a double matrix by column in ascending order.
Definition: matrix.c:440
CMR_EXPORT CMR_ERROR CMRchrmatSortNonzeros(CMR *cmr, CMR_CHRMAT *matrix)
Sorts the nonzeros of a char matrix by column in ascending order.
Definition: matrix.c:473
CMR_EXPORT CMR_ERROR CMRdblmatCreateFromSparseStream(CMR *cmr, FILE *stream, CMR_DBLMAT **presult)
Reads a double matrix from a file stream in sparse format.
Definition: matrix.c:1050
CMR_EXPORT CMR_ERROR CMRdblmatChangeNumNonzeros(CMR *cmr, CMR_DBLMAT *matrix, size_t newNumNonzeros)
Changes the number of nonzeros and reallocates corresponding arrays.
Definition: matrix.c:396
CMR_EXPORT CMR_ERROR CMRsubmatCreate(CMR *cmr, size_t numRows, size_t numColumns, CMR_SUBMAT **psubmatrix)
Creates a submatrix of given size.
Definition: matrix.c:16
CMR_EXPORT CMR_ERROR CMRdblmatPermute(CMR *cmr, CMR_DBLMAT *matrix, size_t *rows, size_t *columns, CMR_DBLMAT **presult)
Creates the double matrix obtained from matrix by applying row- and column-permutations.
Definition: matrix.c:683
CMR_EXPORT bool CMRintmatIsBinary(CMR *cmr, CMR_INTMAT *matrix, CMR_SUBMAT **psubmatrix)
Checks if an int matrix has only entries in .
Definition: matrix.c:2138
CMR_EXPORT bool CMRchrmatCheckEqual(CMR_CHRMAT *matrix1, CMR_CHRMAT *matrix2)
Checks whether two char matrices are equal.
Definition: matrix.c:1827
CMR_EXPORT char * CMRintmatConsistency(CMR_INTMAT *matrix)
Checks an int matrix for consistency.
Definition: matrix.c:2028
CMR_EXPORT CMR_ERROR CMRintmatCreateFromSparseFile(CMR *cmr, const char *fileName, const char *stdinName, CMR_INTMAT **presult)
Reads an int matrix from a file name fileName in sparse format.
Definition: matrix.c:1381
CMR_EXPORT CMR_ERROR CMRsubmatPrint(CMR *cmr, CMR_SUBMAT *submatrix, size_t numRows, size_t numColumns, FILE *stream)
Writes the submatrix submatrix to the file stream by means of lists of row and column indices.
Definition: matrix.c:152
Row-wise representation of sparse char matrix.
Definition: matrix.h:204
size_t * rowSlice
Array mapping each row to the index of its first entry.
Definition: matrix.h:208
size_t * entryColumns
Array mapping each entry to its column.
Definition: matrix.h:209
char * entryValues
Array mapping each entry to its value.
Definition: matrix.h:210
size_t numRows
Number of rows.
Definition: matrix.h:205
size_t numColumns
Number of columns.
Definition: matrix.h:206
size_t numNonzeros
Number of and memory allocated for nonzeros.
Definition: matrix.h:207
Row-wise representation of sparse double matrix.
Definition: matrix.h:156
double * entryValues
Array mapping each entry to its value.
Definition: matrix.h:162
size_t * rowSlice
Array mapping each row to the index of its first entry.
Definition: matrix.h:160
size_t numRows
Number of rows.
Definition: matrix.h:157
size_t numNonzeros
Number of and memory allocated for nonzeros.
Definition: matrix.h:159
size_t numColumns
Number of columns.
Definition: matrix.h:158
size_t * entryColumns
Array mapping each entry to its column.
Definition: matrix.h:161
Definition: env_internal.h:45
Row-wise representation of sparse int matrix.
Definition: matrix.h:180
size_t numColumns
Number of columns.
Definition: matrix.h:182
size_t * entryColumns
Array mapping each entry to its column.
Definition: matrix.h:185
int * entryValues
Array mapping each entry to its value.
Definition: matrix.h:186
size_t * rowSlice
Array mapping each row to the index of its first entry.
Definition: matrix.h:184
size_t numRows
Number of rows.
Definition: matrix.h:181
size_t numNonzeros
Number of and memory allocated for nonzeros.
Definition: matrix.h:183
Row and column indices for a submatrix.
Definition: matrix.h:28
size_t * columns
Array with column indices.
Definition: matrix.h:32
size_t numRows
Number of rows.
Definition: matrix.h:29
size_t * rows
Array with row indices.
Definition: matrix.h:30
size_t numColumns
Number of columns.
Definition: matrix.h:31