CMR  1.3.0
Loading...
Searching...
No Matches
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
17extern "C" {
18#endif
19
20
27typedef struct
28{
29 size_t numRows;
30 size_t* rows;
31 size_t numColumns;
32 size_t* columns;
34
35
42CMR_EXPORT
44 CMR* cmr,
45 size_t numRows,
46 size_t numColumns,
47 CMR_SUBMAT** psubmatrix
48);
49
54CMR_EXPORT
56 CMR* cmr,
57 size_t row,
58 size_t column,
59 CMR_SUBMAT** psubmatrix
60);
61
66CMR_EXPORT
68 CMR* cmr,
69 size_t row1,
70 size_t row2,
71 size_t column1,
72 size_t column2,
73 CMR_SUBMAT** psubmatrix
74);
75
76
81CMR_EXPORT
83 CMR* cmr,
84 CMR_SUBMAT** psubmatrix
85);
86
91CMR_EXPORT
93 CMR_SUBMAT* submatrix
94);
95
104CMR_EXPORT
106 CMR* cmr,
107 CMR_SUBMAT* base,
108 CMR_SUBMAT* input,
109 CMR_SUBMAT** poutput
110);
111
119CMR_EXPORT
121 CMR* cmr,
122 CMR_SUBMAT* base,
123 CMR_SUBMAT* input,
124 CMR_SUBMAT** poutput
125);
126
133CMR_EXPORT
135 CMR* cmr,
136 CMR_SUBMAT* submatrix,
137 size_t numRows,
138 size_t numColumns,
139 FILE* stream
140);
141
148CMR_EXPORT
150 CMR* cmr,
151 CMR_SUBMAT* submatrix,
152 size_t numRows,
153 size_t numColumns,
154 const char* fileName
155);
156
163CMR_EXPORT
165 CMR* cmr,
166 CMR_SUBMAT** psubmatrix,
167 size_t* pnumMatrixRows,
168 size_t* pnumMatrixColumns,
169 FILE* stream
170);
171
186typedef struct
187{
188 size_t numRows;
189 size_t numColumns;
190 size_t numNonzeros;
191 size_t* rowSlice;
192 size_t* entryColumns;
193 double* entryValues;
194} CMR_DBLMAT;
195
210typedef struct
211{
212 size_t numRows;
213 size_t numColumns;
214 size_t numNonzeros;
215 size_t * rowSlice;
216 size_t* entryColumns;
218} CMR_INTMAT;
219
234typedef struct
235{
236 size_t numRows;
237 size_t numColumns;
238 size_t numNonzeros;
239 size_t* rowSlice;
240 size_t* entryColumns;
242} CMR_CHRMAT;
243
249CMR_EXPORT
251 CMR* cmr,
252 CMR_DBLMAT** presult,
253 int numRows,
254 int numColumns,
255 int numNonzeros
256);
257
264CMR_EXPORT
266 CMR* cmr,
267 CMR_INTMAT** presult,
268 int numRows,
269 int numColumns,
270 int numNonzeros
271);
272
278CMR_EXPORT
280 CMR* cmr,
281 CMR_CHRMAT** presult,
282 int numRows,
283 int numColumns,
284 int numNonzeros
285);
286
291CMR_EXPORT
293 CMR* cmr,
294 CMR_DBLMAT** pmatrix
295);
296
301CMR_EXPORT
303 CMR* cmr,
304 CMR_INTMAT** pmatrix
305);
306
311CMR_EXPORT
313 CMR* cmr,
314 CMR_CHRMAT** pmatrix
315);
316
321CMR_EXPORT
323 CMR* cmr,
324 CMR_DBLMAT* matrix,
325 size_t newNumNonzeros
326);
327
332CMR_EXPORT
334 CMR* cmr,
335 CMR_INTMAT* matrix,
336 size_t newNumNonzeros
337);
338
343CMR_EXPORT
345 CMR* cmr,
346 CMR_CHRMAT* matrix,
347 size_t newNumNonzeros
348);
349
354CMR_EXPORT
356 CMR* cmr,
357 CMR_DBLMAT* matrix
358);
359
364CMR_EXPORT
366 CMR* cmr,
367 CMR_INTMAT* matrix
368);
369
374CMR_EXPORT
376 CMR* cmr,
377 CMR_CHRMAT* matrix
378);
379
384CMR_EXPORT
386 CMR* cmr,
387 CMR_DBLMAT* matrix,
388 CMR_DBLMAT** presult
389);
390
395CMR_EXPORT
397 CMR* cmr,
398 CMR_INTMAT* matrix,
399 CMR_INTMAT** presult
400);
401
406CMR_EXPORT
408 CMR* cmr,
409 CMR_CHRMAT* matrix,
410 CMR_CHRMAT** presult
411);
412
417CMR_EXPORT
419 CMR* cmr,
420 CMR_DBLMAT* matrix,
421 CMR_DBLMAT** presult
422);
423
428CMR_EXPORT
430 CMR* cmr,
431 CMR_INTMAT* matrix,
432 CMR_INTMAT** presult
433);
434
439CMR_EXPORT
441 CMR* cmr,
442 CMR_CHRMAT* matrix,
443 CMR_CHRMAT** presult
444);
445
450CMR_EXPORT
452 CMR* cmr,
453 CMR_DBLMAT* matrix,
454 size_t* rows,
455 size_t* columns,
456 CMR_DBLMAT** presult
457);
458
463CMR_EXPORT
465 CMR* cmr,
466 CMR_INTMAT* matrix,
467 size_t* rows,
468 size_t* columns,
469 CMR_INTMAT** presult
470);
471
476CMR_EXPORT
478 CMR* cmr,
479 CMR_CHRMAT* matrix,
480 size_t* rows,
481 size_t* columns,
482 CMR_CHRMAT** presult
483);
484
489CMR_EXPORT
491 CMR* cmr,
492 CMR_DBLMAT* matrix,
493 FILE* stream
494);
495
500CMR_EXPORT
502 CMR* cmr,
503 CMR_INTMAT* matrix,
504 FILE* stream
505);
506
511CMR_EXPORT
513 CMR* cmr,
514 CMR_CHRMAT* matrix,
515 FILE* stream
516);
517
522CMR_EXPORT
524 CMR* cmr,
525 CMR_DBLMAT* matrix,
526 FILE* stream,
527 char zeroChar,
528 bool header
529);
530
535CMR_EXPORT
537 CMR* cmr,
538 CMR_INTMAT* matrix,
539 FILE* stream,
540 char zeroChar,
541 bool header
542);
543
548CMR_EXPORT
550 CMR* cmr,
551 CMR_CHRMAT* matrix,
552 FILE* stream,
553 char zeroChar,
554 bool header
555);
556
563CMR_EXPORT
565 CMR* cmr,
566 FILE* stream,
567 CMR_DBLMAT** presult
568);
569
576CMR_EXPORT
578 CMR* cmr,
579 FILE* stream,
580 CMR_INTMAT** presult
581);
582
589CMR_EXPORT
591 CMR* cmr,
592 FILE* stream,
593 CMR_CHRMAT** presult
594);
595
603CMR_EXPORT
605 CMR* cmr,
606 const char* fileName,
607 const char* stdinName,
608 CMR_DBLMAT** presult
609);
610
618CMR_EXPORT
620 CMR* cmr,
621 const char* fileName,
622 const char* stdinName,
623 CMR_INTMAT** presult
624);
625
633CMR_EXPORT
635 CMR* cmr,
636 const char* fileName,
637 const char* stdinName,
638 CMR_CHRMAT** presult
639);
640
647CMR_EXPORT
649 CMR* cmr,
650 FILE* stream,
651 CMR_DBLMAT** presult
652);
653
660CMR_EXPORT
662 CMR* cmr,
663 FILE* stream,
664 CMR_INTMAT** presult
665);
666
673CMR_EXPORT
675 CMR* cmr,
676 FILE* stream,
677 CMR_CHRMAT** presult
678);
679
687CMR_EXPORT
689 CMR* cmr,
690 const char* fileName,
691 const char* stdinName,
692 CMR_DBLMAT** presult
693);
694
702CMR_EXPORT
704 CMR* cmr,
705 const char* fileName,
706 const char* stdinName,
707 CMR_INTMAT** presult
708);
709
717CMR_EXPORT
719 CMR* cmr,
720 const char* fileName,
721 const char* stdinName,
722 CMR_CHRMAT** presult
723);
724
729CMR_EXPORT
731 CMR_DBLMAT* matrix1,
732 CMR_DBLMAT* matrix2
733);
734
739CMR_EXPORT
741 CMR_INTMAT* matrix1,
742 CMR_INTMAT* matrix2
743);
744
749CMR_EXPORT
751 CMR_CHRMAT* matrix1,
752 CMR_CHRMAT* matrix2
753);
754
759CMR_EXPORT
761 CMR* cmr,
762 CMR_DBLMAT* matrix1,
763 CMR_DBLMAT* matrix2,
764 bool* pareTranspose
765);
766
771CMR_EXPORT
773 CMR* cmr,
774 CMR_INTMAT* matrix1,
775 CMR_INTMAT* matrix2,
776 bool* pareTranspose
777);
778
783CMR_EXPORT
785 CMR* cmr,
786 CMR_CHRMAT* matrix1,
787 CMR_CHRMAT* matrix2,
788 bool* pareTranspose
789);
790
803CMR_EXPORT
805 CMR_DBLMAT* matrix
806);
807
820CMR_EXPORT
822 CMR_INTMAT* matrix
823);
824
837CMR_EXPORT
839 CMR_CHRMAT* matrix
840);
841
846CMR_EXPORT
848 CMR* cmr,
849 CMR_DBLMAT* matrix,
850 CMR_SUBMAT* submatrix,
851 CMR_DBLMAT** presult
852);
853
858CMR_EXPORT
860 CMR* cmr,
861 CMR_INTMAT* matrix,
862 CMR_SUBMAT* submatrix,
863 CMR_INTMAT** presult
864);
865
870CMR_EXPORT
872 CMR* cmr,
873 CMR_CHRMAT* matrix,
874 CMR_SUBMAT* submatrix,
875 CMR_CHRMAT** presult
876);
877
882CMR_EXPORT
884 CMR* cmr,
885 CMR_DBLMAT* matrix,
886 double epsilon,
887 CMR_SUBMAT** psubmatrix
888);
889
894CMR_EXPORT
896 CMR* cmr,
897 CMR_DBLMAT* matrix,
898 double epsilon,
899 CMR_SUBMAT** psubmatrix
900);
901
906CMR_EXPORT
908 CMR* cmr,
909 CMR_INTMAT* matrix,
910 CMR_SUBMAT** psubmatrix
911);
912
917CMR_EXPORT
919 CMR* cmr,
920 CMR_CHRMAT* matrix,
921 CMR_SUBMAT** psubmatrix
922);
923
928CMR_EXPORT
930 CMR* cmr,
931 CMR_DBLMAT* matrix,
932 double epsilon,
933 CMR_SUBMAT** psubmatrix
934);
935
940CMR_EXPORT
942 CMR* cmr,
943 CMR_DBLMAT* matrix,
944 double epsilon,
945 CMR_SUBMAT** psubmatrix
946);
947
952CMR_EXPORT
954 CMR* cmr,
955 CMR_INTMAT* matrix,
956 CMR_SUBMAT** psubmatrix
957);
958
963CMR_EXPORT
965 CMR* cmr,
966 CMR_CHRMAT* matrix,
967 CMR_SUBMAT** psubmatrix
968);
969
974CMR_EXPORT
976 CMR* cmr,
977 CMR_DBLMAT* matrix,
978 double epsilon,
979 CMR_CHRMAT** presult
980);
981
986CMR_EXPORT
988 CMR* cmr,
989 CMR_INTMAT* matrix,
990 CMR_CHRMAT** presult
991);
992
999CMR_EXPORT
1001 CMR* cmr,
1002 CMR_CHRMAT* matrix,
1003 CMR_CHRMAT** presult
1004);
1005
1011CMR_EXPORT
1013 CMR* cmr,
1014 CMR_DBLMAT* matrix,
1015 double epsilon,
1016 CMR_CHRMAT** presult
1017);
1018
1023CMR_EXPORT
1025 CMR* cmr,
1026 CMR_INTMAT* matrix,
1027 CMR_CHRMAT** presult
1028);
1029
1034CMR_EXPORT
1036 CMR* cmr,
1037 CMR_CHRMAT* matrix,
1038 CMR_CHRMAT** presult
1039);
1040
1045CMR_EXPORT
1047 CMR* cmr,
1048 CMR_CHRMAT* matrix,
1049 CMR_INTMAT** presult
1050);
1051
1058CMR_EXPORT
1060 CMR* cmr,
1061 CMR_INTMAT* matrix,
1062 CMR_CHRMAT** presult
1063);
1064
1071CMR_EXPORT
1073 CMR* cmr,
1074 CMR_DBLMAT* matrix,
1075 double epsilon,
1076 CMR_CHRMAT** presult
1077);
1078
1085CMR_EXPORT
1087 CMR_DBLMAT* matrix,
1088 size_t row,
1089 size_t column,
1090 size_t* pentry
1091);
1092
1099CMR_EXPORT
1101 CMR_INTMAT* matrix,
1102 size_t row,
1103 size_t column,
1104 size_t* pentry
1105);
1106
1114CMR_EXPORT
1116 CMR_CHRMAT* matrix,
1117 size_t row,
1118 size_t column,
1119 size_t* pentry
1120);
1121
1122#ifdef __cplusplus
1123}
1124#endif
1125
1126#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:2706
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:1763
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:2509
CMR_EXPORT CMR_ERROR CMRdblmatSlice(CMR *cmr, CMR_DBLMAT *matrix, CMR_SUBMAT *submatrix, CMR_DBLMAT **presult)
Slices a submatrix of a double matrix.
Definition matrix.c:2302
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:2541
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:1001
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:2611
CMR_EXPORT CMR_ERROR CMRsubmatFree(CMR *cmr, CMR_SUBMAT **psubmatrix)
Frees a submatrix.
Definition matrix.c:61
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:1553
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:2150
CMR_EXPORT bool CMRintmatCheckEqual(CMR_INTMAT *matrix1, CMR_INTMAT *matrix2)
Checks whether two int matrices are equal.
Definition matrix.c:1830
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:1988
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:2808
CMR_EXPORT char * CMRintmatConsistency(CMR_INTMAT *matrix)
Checks an int matrix for consistency.
Definition matrix.c:2066
CMR_EXPORT CMR_ERROR CMRdblmatToChr(CMR *cmr, CMR_DBLMAT *matrix, double epsilon, CMR_CHRMAT **presult)
Converts a double matrix to a char matrix.
Definition matrix.c:2752
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:297
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:811
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:1385
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:959
CMR_EXPORT CMR_ERROR CMRintmatToChr(CMR *cmr, CMR_INTMAT *matrix, CMR_CHRMAT **presult)
Converts an int matrix to a char matrix.
Definition matrix.c:2727
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:2226
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:2678
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:2569
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:493
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:34
CMR_EXPORT bool CMRchrmatIsBinary(CMR *cmr, CMR_CHRMAT *matrix, CMR_SUBMAT **psubmatrix)
Checks if a char matrix has only entries in .
Definition matrix.c:2201
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:1944
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:2834
CMR_EXPORT CMR_ERROR CMRchrmatPrintSparse(CMR *cmr, CMR_CHRMAT *matrix, FILE *stream)
Prints a char matrix in sparse format.
Definition matrix.c:897
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:765
CMR_EXPORT CMR_ERROR CMRsubmatCreate2x2(CMR *cmr, size_t row1, size_t row2, size_t column1, size_t column2, CMR_SUBMAT **psubmatrix)
Creates a 2-by-2 submatrix.
Definition matrix.c:46
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:444
CMR_EXPORT CMR_ERROR CMRchrmatSlice(CMR *cmr, CMR_CHRMAT *matrix, CMR_SUBMAT *submatrix, CMR_CHRMAT **presult)
Slices a submatrix of a char matrix.
Definition matrix.c:2440
CMR_EXPORT CMR_ERROR CMRdblmatFree(CMR *cmr, CMR_DBLMAT **pmatrix)
Frees the memory of a double matrix.
Definition matrix.c:366
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:917
CMR_EXPORT bool CMRintmatIsTernary(CMR *cmr, CMR_INTMAT *matrix, CMR_SUBMAT **psubmatrix)
Checks if an int matrix has only entries in .
Definition matrix.c:2252
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:547
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:1300
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:1699
CMR_EXPORT bool CMRchrmatIsTernary(CMR *cmr, CMR_CHRMAT *matrix, CMR_SUBMAT **psubmatrix)
Checks if a double matrix has only entries in .
Definition matrix.c:2277
CMR_EXPORT CMR_ERROR CMRchrmatTranspose(CMR *cmr, CMR_CHRMAT *matrix, CMR_CHRMAT **presult)
Creates the transpose of a char matrix.
Definition matrix.c:675
CMR_EXPORT CMR_ERROR CMRsubmatSlice(CMR *cmr, CMR_SUBMAT *base, CMR_SUBMAT *input, CMR_SUBMAT **poutput)
Returns the submatrix input as a submatrix of the base submatrix.
Definition matrix.c:92
CMR_EXPORT char * CMRdblmatConsistency(CMR_DBLMAT *matrix)
Checks a double matrix for consistency.
Definition matrix.c:2032
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:344
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:2985
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:321
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:456
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:3013
CMR_EXPORT CMR_ERROR CMRchrmatFree(CMR *cmr, CMR_CHRMAT **pmatrix)
Frees the memory of a char matrix.
Definition matrix.c:410
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:1449
CMR_EXPORT CMR_ERROR CMRintmatPrintSparse(CMR *cmr, CMR_INTMAT *matrix, FILE *stream)
Prints an int matrix in sparse format.
Definition matrix.c:877
CMR_EXPORT char * CMRchrmatConsistency(CMR_CHRMAT *matrix)
Checks a char matrix for consistency.
Definition matrix.c:2108
CMR_EXPORT bool CMRdblmatCheckEqual(CMR_DBLMAT *matrix1, CMR_DBLMAT *matrix2)
Checks whether two double matrices are equal.
Definition matrix.c:1795
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:1731
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:2650
CMR_EXPORT CMR_ERROR CMRdblmatTranspose(CMR *cmr, CMR_DBLMAT *matrix, CMR_DBLMAT **presult)
Creates the transpose of a double matrix.
Definition matrix.c:587
CMR_EXPORT CMR_ERROR CMRsubmatUnslice(CMR *cmr, CMR_SUBMAT *base, CMR_SUBMAT *input, CMR_SUBMAT **poutput)
Returns the sub-submatrix input of base as a submatrix of its parent.
Definition matrix.c:168
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:567
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:1626
CMR_EXPORT CMR_ERROR CMRintmatTranspose(CMR *cmr, CMR_INTMAT *matrix, CMR_INTMAT **presult)
Creates the transpose of an int matrix.
Definition matrix.c:631
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:527
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:1193
CMR_EXPORT CMR_ERROR CMRintmatFree(CMR *cmr, CMR_INTMAT **pmatrix)
Frees the memory of an int matrix.
Definition matrix.c:388
CMR_EXPORT CMR_ERROR CMRsubmatTranspose(CMR_SUBMAT *submatrix)
Transposes a submatrix.
Definition matrix.c:77
CMR_EXPORT CMR_ERROR CMRdblmatPrintSparse(CMR *cmr, CMR_DBLMAT *matrix, FILE *stream)
Prints a double matrix in sparse format.
Definition matrix.c:857
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:1900
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:1481
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:230
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:207
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:2782
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:476
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:509
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:1086
CMR_EXPORT CMR_ERROR CMRintmatSlice(CMR *cmr, CMR_INTMAT *matrix, CMR_SUBMAT *submatrix, CMR_INTMAT **presult)
Slices a submatrix of an int matrix.
Definition matrix.c:2371
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:432
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:17
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:719
CMR_EXPORT bool CMRintmatIsBinary(CMR *cmr, CMR_INTMAT *matrix, CMR_SUBMAT **psubmatrix)
Checks if an int matrix has only entries in .
Definition matrix.c:2176
CMR_EXPORT bool CMRchrmatCheckEqual(CMR_CHRMAT *matrix1, CMR_CHRMAT *matrix2)
Checks whether two char matrices are equal.
Definition matrix.c:1865
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:1417
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:188
Row-wise representation of sparse char matrix.
Definition matrix.h:235
size_t * rowSlice
Array mapping each row to the index of its first entry.
Definition matrix.h:239
size_t * entryColumns
Array mapping each entry to its column.
Definition matrix.h:240
char * entryValues
Array mapping each entry to its value.
Definition matrix.h:241
size_t numRows
Number of rows.
Definition matrix.h:236
size_t numColumns
Number of columns.
Definition matrix.h:237
size_t numNonzeros
Number of and memory allocated for nonzeros.
Definition matrix.h:238
Row-wise representation of sparse double matrix.
Definition matrix.h:187
double * entryValues
Array mapping each entry to its value.
Definition matrix.h:193
size_t * rowSlice
Array mapping each row to the index of its first entry.
Definition matrix.h:191
size_t numRows
Number of rows.
Definition matrix.h:188
size_t numNonzeros
Number of and memory allocated for nonzeros.
Definition matrix.h:190
size_t numColumns
Number of columns.
Definition matrix.h:189
size_t * entryColumns
Array mapping each entry to its column.
Definition matrix.h:192
Definition env_internal.h:45
Row-wise representation of sparse int matrix.
Definition matrix.h:211
size_t numColumns
Number of columns.
Definition matrix.h:213
size_t * entryColumns
Array mapping each entry to its column.
Definition matrix.h:216
int * entryValues
Array mapping each entry to its value.
Definition matrix.h:217
size_t * rowSlice
Array mapping each row to the index of its first entry.
Definition matrix.h:215
size_t numRows
Number of rows.
Definition matrix.h:212
size_t numNonzeros
Number of and memory allocated for nonzeros.
Definition matrix.h:214
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