M4RI 20200125
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
44void mzd_fprint_row(FILE* stream, mzd_t const *M, const rci_t i);
45
55static inline void mzd_print_row(mzd_t const *M, const rci_t i) {
56 mzd_fprint_row(stdout, M, i);
57}
58
68static 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
82static inline void mzd_print(mzd_t const *M) {
83 mzd_fprint(stdout, M);
84}
85
95void mzd_info(const mzd_t *A, int do_rank);
96
97#if __M4RI_HAVE_LIBPNG
98
109mzd_t * mzd_from_png(const char *fn, int verbose);
110
135int 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
178mzd_t *mzd_from_jcf(const char *fn, int verbose);
179
198mzd_t *mzd_from_str(rci_t m, rci_t n, const char *str);
199
200#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:366
void mzd_info(const mzd_t *A, int do_rank)
Print compact information about the matrix to stdout.
Definition: io.c:36
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_t * mzd_from_jcf(const char *fn, int verbose)
Read matrix from ASCII file in JCF format.
Definition: io.c:308
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:82
static void mzd_fprint(FILE *stream, mzd_t const *M)
Print a matrix to an output stream.
Definition: io.h:68
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:86
rci_t nrows
Definition: mzd.h:88