M4RI 20250128
io.h
Go to the documentation of this file.
1
7
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
43
44void mzd_fprint_row(FILE *stream, mzd_t const *M, const rci_t i);
45
54
55static inline void mzd_print_row(mzd_t const *M, const rci_t i) { mzd_fprint_row(stdout, M, i); }
56
65
66static inline void mzd_fprint(FILE *stream, mzd_t const *M) {
67 for (rci_t i = 0; i < M->nrows; ++i) { mzd_fprint_row(stream, M, i); }
68}
69
77
78static inline void mzd_print(mzd_t const *M) { mzd_fprint(stdout, M); }
79
88
89void mzd_info(const mzd_t *A, int do_rank);
90
91#if __M4RI_HAVE_LIBPNG
92
102
103mzd_t *mzd_from_png(const char *fn, int verbose);
104
128
129int mzd_to_png(const mzd_t *A, const char *fn, int compression_level, const char *comment,
130 int verbose);
131
132#endif //__M4RI_HAVE_LIBPNG
133
171
172mzd_t *mzd_from_jcf(const char *fn, int verbose);
173
191
192mzd_t *mzd_from_str(rci_t m, rci_t n, const char *str);
193
194#endif // M4RI_IO_H
mzd_t * mzd_from_str(rci_t m, rci_t n, const char *str)
Create matrix from dense ASCII string.
Definition io.c:350
void mzd_info(const mzd_t *A, int do_rank)
Print compact information about the matrix to stdout.
Definition io.c:34
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:48
mzd_t * mzd_from_jcf(const char *fn, int verbose)
Read matrix from ASCII file in JCF format.
Definition io.c:296
static void mzd_print_row(mzd_t const *M, const rci_t i)
Print row i of M to stdout.
Definition io.h:55
static void mzd_print(mzd_t const *M)
Print a matrix to stdout.
Definition io.h:78
static void mzd_fprint(FILE *stream, mzd_t const *M)
Print a matrix to an output stream.
Definition io.h:66
int rci_t
Type of row and column indexes.
Definition misc.h:72
Dense matrices over GF(2) represented as a bit field.
Dense matrices over GF(2).
Definition mzd.h:68
rci_t nrows
Definition mzd.h:70