CMR  1.3.0
matrix.h
Go to the documentation of this file.
1 #ifndef CMR_MATRIX_H
2 #define CMR_MATRIX_H
3 
12 #include <cmr/env.h>
13 
14 #include <stdio.h>
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 
27 typedef struct
28 {
29  size_t numRows;
30  size_t* rows;
31  size_t numColumns;
32  size_t* columns;
33 } CMR_SUBMAT;
34 
35 
42 CMR_EXPORT
44  CMR* cmr,
45  size_t numRows,
46  size_t numColumns,
47  CMR_SUBMAT** psubmatrix
48 );
49 
54 CMR_EXPORT
56  CMR* cmr,
57  size_t row,
58  size_t column,
59  CMR_SUBMAT** psubmatrix
60 );
61 
66 CMR_EXPORT
68  CMR* cmr,
69  CMR_SUBMAT** psubmatrix
70 );
71 
76 CMR_EXPORT
78  CMR_SUBMAT* submatrix
79 );
80 
88 CMR_EXPORT
90  CMR* cmr,
91  CMR_SUBMAT* reference,
92  CMR_SUBMAT* input,
93  CMR_SUBMAT** poutput
94 );
95 
102 CMR_EXPORT
104  CMR* cmr,
105  CMR_SUBMAT* submatrix,
106  size_t numRows,
107  size_t numColumns,
108  FILE* stream
109 );
110 
117 CMR_EXPORT
119  CMR* cmr,
120  CMR_SUBMAT* submatrix,
121  size_t numRows,
122  size_t numColumns,
123  const char* fileName
124 );
125 
132 CMR_EXPORT
134  CMR* cmr,
135  CMR_SUBMAT** psubmatrix,
136  size_t* pnumMatrixRows,
137  size_t* pnumMatrixColumns,
138  FILE* stream
139 );
140 
155 typedef struct
156 {
157  size_t numRows;
158  size_t numColumns;
159  size_t numNonzeros;
160  size_t* rowSlice;
161  size_t* entryColumns;
162  double* entryValues;
163 } CMR_DBLMAT;
164 
179 typedef struct
180 {
181  size_t numRows;
182  size_t numColumns;
183  size_t numNonzeros;
184  size_t * rowSlice;
185  size_t* entryColumns;
186  int* entryValues;
187 } CMR_INTMAT;
188 
203 typedef struct
204 {
205  size_t numRows;
206  size_t numColumns;
207  size_t numNonzeros;
208  size_t* rowSlice;
209  size_t* entryColumns;
210  char* entryValues;
211 } CMR_CHRMAT;
212 
218 CMR_EXPORT
220  CMR* cmr,
221  CMR_DBLMAT** presult,
222  int numRows,
223  int numColumns,
224  int numNonzeros
225 );
226 
233 CMR_EXPORT
235  CMR* cmr,
236  CMR_INTMAT** presult,
237  int numRows,
238  int numColumns,
239  int numNonzeros
240 );
241 
247 CMR_EXPORT
249  CMR* cmr,
250  CMR_CHRMAT** presult,
251  int numRows,
252  int numColumns,
253  int numNonzeros
254 );
255 
260 CMR_EXPORT
262  CMR* cmr,
263  CMR_DBLMAT** pmatrix
264 );
265 
270 CMR_EXPORT
272  CMR* cmr,
273  CMR_INTMAT** pmatrix
274 );
275 
280 CMR_EXPORT
282  CMR* cmr,
283  CMR_CHRMAT** pmatrix
284 );
285 
290 CMR_EXPORT
292  CMR* cmr,
293  CMR_DBLMAT* matrix,
294  size_t newNumNonzeros
295 );
296 
301 CMR_EXPORT
303  CMR* cmr,
304  CMR_INTMAT* matrix,
305  size_t newNumNonzeros
306 );
307 
312 CMR_EXPORT
314  CMR* cmr,
315  CMR_CHRMAT* matrix,
316  size_t newNumNonzeros
317 );
318 
323 CMR_EXPORT
325  CMR* cmr,
326  CMR_DBLMAT* matrix
327 );
328 
333 CMR_EXPORT
335  CMR* cmr,
336  CMR_INTMAT* matrix
337 );
338 
343 CMR_EXPORT
345  CMR* cmr,
346  CMR_CHRMAT* matrix
347 );
348 
353 CMR_EXPORT
355  CMR* cmr,
356  CMR_DBLMAT* matrix,
357  CMR_DBLMAT** presult
358 );
359 
364 CMR_EXPORT
366  CMR* cmr,
367  CMR_INTMAT* matrix,
368  CMR_INTMAT** presult
369 );
370 
375 CMR_EXPORT
377  CMR* cmr,
378  CMR_CHRMAT* matrix,
379  CMR_CHRMAT** presult
380 );
381 
386 CMR_EXPORT
388  CMR* cmr,
389  CMR_DBLMAT* matrix,
390  CMR_DBLMAT** presult
391 );
392 
397 CMR_EXPORT
399  CMR* cmr,
400  CMR_INTMAT* matrix,
401  CMR_INTMAT** presult
402 );
403 
408 CMR_EXPORT
410  CMR* cmr,
411  CMR_CHRMAT* matrix,
412  CMR_CHRMAT** presult
413 );
414 
419 CMR_EXPORT
421  CMR* cmr,
422  CMR_DBLMAT* matrix,
423  size_t* rows,
424  size_t* columns,
425  CMR_DBLMAT** presult
426 );
427 
432 CMR_EXPORT
434  CMR* cmr,
435  CMR_INTMAT* matrix,
436  size_t* rows,
437  size_t* columns,
438  CMR_INTMAT** presult
439 );
440 
445 CMR_EXPORT
447  CMR* cmr,
448  CMR_CHRMAT* matrix,
449  size_t* rows,
450  size_t* columns,
451  CMR_CHRMAT** presult
452 );
453 
458 CMR_EXPORT
460  CMR* cmr,
461  CMR_DBLMAT* matrix,
462  FILE* stream
463 );
464 
469 CMR_EXPORT
471  CMR* cmr,
472  CMR_INTMAT* matrix,
473  FILE* stream
474 );
475 
480 CMR_EXPORT
482  CMR* cmr,
483  CMR_CHRMAT* matrix,
484  FILE* stream
485 );
486 
491 CMR_EXPORT
493  CMR* cmr,
494  CMR_DBLMAT* matrix,
495  FILE* stream,
496  char zeroChar,
497  bool header
498 );
499 
504 CMR_EXPORT
506  CMR* cmr,
507  CMR_INTMAT* matrix,
508  FILE* stream,
509  char zeroChar,
510  bool header
511 );
512 
517 CMR_EXPORT
519  CMR* cmr,
520  CMR_CHRMAT* matrix,
521  FILE* stream,
522  char zeroChar,
523  bool header
524 );
525 
532 CMR_EXPORT
534  CMR* cmr,
535  FILE* stream,
536  CMR_DBLMAT** presult
537 );
538 
545 CMR_EXPORT
547  CMR* cmr,
548  FILE* stream,
549  CMR_INTMAT** presult
550 );
551 
558 CMR_EXPORT
560  CMR* cmr,
561  FILE* stream,
562  CMR_CHRMAT** presult
563 );
564 
572 CMR_EXPORT
574  CMR* cmr,
575  const char* fileName,
576  const char* stdinName,
577  CMR_DBLMAT** presult
578 );
579 
587 CMR_EXPORT
589  CMR* cmr,
590  const char* fileName,
591  const char* stdinName,
592  CMR_INTMAT** presult
593 );
594 
602 CMR_EXPORT
604  CMR* cmr,
605  const char* fileName,
606  const char* stdinName,
607  CMR_CHRMAT** presult
608 );
609 
616 CMR_EXPORT
618  CMR* cmr,
619  FILE* stream,
620  CMR_DBLMAT** presult
621 );
622 
629 CMR_EXPORT
631  CMR* cmr,
632  FILE* stream,
633  CMR_INTMAT** presult
634 );
635 
642 CMR_EXPORT
644  CMR* cmr,
645  FILE* stream,
646  CMR_CHRMAT** presult
647 );
648 
656 CMR_EXPORT
658  CMR* cmr,
659  const char* fileName,
660  const char* stdinName,
661  CMR_DBLMAT** presult
662 );
663 
671 CMR_EXPORT
673  CMR* cmr,
674  const char* fileName,
675  const char* stdinName,
676  CMR_INTMAT** presult
677 );
678 
686 CMR_EXPORT
688  CMR* cmr,
689  const char* fileName,
690  const char* stdinName,
691  CMR_CHRMAT** presult
692 );
693 
698 CMR_EXPORT
700  CMR_DBLMAT* matrix1,
701  CMR_DBLMAT* matrix2
702 );
703 
708 CMR_EXPORT
710  CMR_INTMAT* matrix1,
711  CMR_INTMAT* matrix2
712 );
713 
718 CMR_EXPORT
720  CMR_CHRMAT* matrix1,
721  CMR_CHRMAT* matrix2
722 );
723 
728 CMR_EXPORT
730  CMR* cmr,
731  CMR_DBLMAT* matrix1,
732  CMR_DBLMAT* matrix2,
733  bool* pareTranspose
734 );
735 
740 CMR_EXPORT
742  CMR* cmr,
743  CMR_INTMAT* matrix1,
744  CMR_INTMAT* matrix2,
745  bool* pareTranspose
746 );
747 
752 CMR_EXPORT
754  CMR* cmr,
755  CMR_CHRMAT* matrix1,
756  CMR_CHRMAT* matrix2,
757  bool* pareTranspose
758 );
759 
772 CMR_EXPORT
774  CMR_DBLMAT* matrix
775 );
776 
789 CMR_EXPORT
791  CMR_INTMAT* matrix
792 );
793 
806 CMR_EXPORT
808  CMR_CHRMAT* matrix
809 );
810 
815 CMR_EXPORT
817  CMR* cmr,
818  CMR_DBLMAT* matrix,
819  CMR_SUBMAT* submatrix,
820  CMR_DBLMAT** presult
821 );
822 
827 CMR_EXPORT
829  CMR* cmr,
830  CMR_INTMAT* matrix,
831  CMR_SUBMAT* submatrix,
832  CMR_INTMAT** presult
833 );
834 
839 CMR_EXPORT
841  CMR* cmr,
842  CMR_CHRMAT* matrix,
843  CMR_SUBMAT* submatrix,
844  CMR_CHRMAT** presult
845 );
846 
851 CMR_EXPORT
852 bool CMRdblmatIsBinary(
853  CMR* cmr,
854  CMR_DBLMAT* matrix,
855  double epsilon,
856  CMR_SUBMAT** psubmatrix
857 );
858 
863 CMR_EXPORT
865  CMR* cmr,
866  CMR_DBLMAT* matrix,
867  double epsilon,
868  CMR_SUBMAT** psubmatrix
869 );
870 
875 CMR_EXPORT
876 bool CMRintmatIsBinary(
877  CMR* cmr,
878  CMR_INTMAT* matrix,
879  CMR_SUBMAT** psubmatrix
880 );
881 
886 CMR_EXPORT
887 bool CMRchrmatIsBinary(
888  CMR* cmr,
889  CMR_CHRMAT* matrix,
890  CMR_SUBMAT** psubmatrix
891 );
892 
897 CMR_EXPORT
898 bool CMRdblmatIsTernary(
899  CMR* cmr,
900  CMR_DBLMAT* matrix,
901  double epsilon,
902  CMR_SUBMAT** psubmatrix
903 );
904 
909 CMR_EXPORT
911  CMR* cmr,
912  CMR_DBLMAT* matrix,
913  double epsilon,
914  CMR_SUBMAT** psubmatrix
915 );
916 
921 CMR_EXPORT
922 bool CMRintmatIsTernary(
923  CMR* cmr,
924  CMR_INTMAT* matrix,
925  CMR_SUBMAT** psubmatrix
926 );
927 
932 CMR_EXPORT
933 bool CMRchrmatIsTernary(
934  CMR* cmr,
935  CMR_CHRMAT* matrix,
936  CMR_SUBMAT** psubmatrix
937 );
938 
943 CMR_EXPORT
945  CMR* cmr,
946  CMR_DBLMAT* matrix,
947  double epsilon,
948  CMR_CHRMAT** presult
949 );
950 
955 CMR_EXPORT
957  CMR* cmr,
958  CMR_INTMAT* matrix,
959  CMR_CHRMAT** presult
960 );
961 
966 CMR_EXPORT
968  CMR* cmr,
969  CMR_CHRMAT* matrix,
970  CMR_CHRMAT** presult
971 );
972 
978 CMR_EXPORT
980  CMR* cmr,
981  CMR_DBLMAT* matrix,
982  double epsilon,
983  CMR_CHRMAT** presult
984 );
985 
990 CMR_EXPORT
992  CMR* cmr,
993  CMR_INTMAT* matrix,
994  CMR_CHRMAT** presult
995 );
996 
1001 CMR_EXPORT
1003  CMR* cmr,
1004  CMR_CHRMAT* matrix,
1005  CMR_CHRMAT** presult
1006 );
1007 
1012 CMR_EXPORT
1014  CMR* cmr,
1015  CMR_CHRMAT* matrix,
1016  CMR_INTMAT** presult
1017 );
1018 
1025 CMR_EXPORT
1027  CMR* cmr,
1028  CMR_INTMAT* matrix,
1029  CMR_CHRMAT** presult
1030 );
1031 
1038 CMR_EXPORT
1040  CMR_DBLMAT* matrix,
1041  size_t row,
1042  size_t column,
1043  size_t* pentry
1044 );
1045 
1052 CMR_EXPORT
1054  CMR_INTMAT* matrix,
1055  size_t row,
1056  size_t column,
1057  size_t* pentry
1058 );
1059 
1067 CMR_EXPORT
1069  CMR_CHRMAT* matrix,
1070  size_t row,
1071  size_t column,
1072  size_t* pentry
1073 );
1074 
1075 #ifdef __cplusplus
1076 }
1077 #endif
1078 
1079 #endif /* CMR_MATRIX_H */
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