M4RI  20200115
io.h
Go to the documentation of this file.
1 
8 #ifndef M4RI_IO_H
9 #define M4RI_IO_H
10 
11 /*******************************************************************
12 *
13 * M4RI: Linear Algebra over GF(2)
14 *
15 * Copyright (C) 2011 Martin Albrecht <martinralbrecht@googlemail.com>
16 *
17 * Distributed under the terms of the GNU General Public License (GPL)
18 * version 2 or higher.
19 *
20 * This code is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * General Public License for more details.
24 *
25 * The full text of the GPL is available at:
26 *
27 * http://www.gnu.org/licenses/
28 *
29 ********************************************************************/
30 
31 #include <m4ri/m4ri_config.h>
32 #include <m4ri/mzd.h>
33 
44 void mzd_fprint_row(FILE* stream, mzd_t const *M, const rci_t i);
45 
55 static inline void mzd_print_row(mzd_t const *M, const rci_t i) {
56  mzd_fprint_row(stdout, M, i);
57 }
58 
68 static inline void mzd_fprint(FILE* stream, mzd_t const *M) {
69  for (rci_t i = 0; i < M->nrows; ++i) {
70  mzd_fprint_row(stream, M, i);
71  }
72 }
73 
82 static inline void mzd_print(mzd_t const *M) {
83  mzd_fprint(stdout, M);
84 }
85 
95 void mzd_info(const mzd_t *A, int do_rank);
96 
97 #if __M4RI_HAVE_LIBPNG
98 
109 mzd_t * mzd_from_png(const char *fn, int verbose);
110 
135 int mzd_to_png(const mzd_t *A, const char *fn, int compression_level, const char *comment, int verbose);
136 
137 #endif //__M4RI_HAVE_LIBPNG
138 
139 
178 mzd_t *mzd_from_jcf(const char *fn, int verbose);
179 
198 mzd_t *mzd_from_str(rci_t m, rci_t n, const char *str);
199 
200 #endif //M4RI_IO_H
mzd_from_str
mzd_t * mzd_from_str(rci_t m, rci_t n, const char *str)
Create matrix from dense ASCII string.
Definition: io.c:366
mzd_print
static void mzd_print(mzd_t const *M)
Print a matrix to stdout.
Definition: io.h:82
mzd_from_jcf
mzd_t * mzd_from_jcf(const char *fn, int verbose)
Read matrix from ASCII file in JCF format.
Definition: io.c:308
mzd_fprint_row
void mzd_fprint_row(FILE *stream, mzd_t const *M, const rci_t i)
Print row i of M to an output stream.
Definition: io.c:49
mzd.h
Dense matrices over GF(2) represented as a bit field.
rci_t
int rci_t
Type of row and column indexes.
Definition: misc.h:72
mzd_t
Dense matrices over GF(2).
Definition: mzd.h:86
mzd_print_row
static void mzd_print_row(mzd_t const *M, const rci_t i)
Print row i of M to stdout.
Definition: io.h:55
mzd_info
void mzd_info(const mzd_t *A, int do_rank)
Print compact information about the matrix to stdout.
Definition: io.c:36
mzd_t::nrows
rci_t nrows
Definition: mzd.h:88
mzd_fprint
static void mzd_fprint(FILE *stream, mzd_t const *M)
Print a matrix to an output stream.
Definition: io.h:68