1 #ifndef MF_H_
2 #define MF_H_
3 
4 /* A few tools for reading matrices in either ascii or binary format, and
5  * extracting info.
6  */
7 
8 #include <stdio.h>
9 #include <stdint.h>
10 
11 /* structs of this type are passed, to decide what gets done with inputs.
12  */
13 struct mf_io_file {
14     uint64_t size;    // allow more than 4G elements.
15     uint64_t alloc;   // allow more than 4G elements.
16     uint32_t * p;
17     FILE * f;
18     int ascii;
19 };
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 extern void matrix_read_pass(
26         struct mf_io_file * m_in,
27         struct mf_io_file * m_out,
28         struct mf_io_file * rw_out,
29         struct mf_io_file * cw_out,
30         unsigned int rskip,
31         unsigned int cskip,
32         int progress,
33         int withcoeffs);
34 
35 extern char * build_mat_auxfile(const char * prefix, const char * what, const char * ext);
36 
37 extern int has_suffix(const char * path, const char * sfx);
38 int matrix_autodetect_input(struct mf_io_file * mf_in, const char * mfile);
39 
40 #ifdef __cplusplus
41 }
42 #endif
43 
44 #endif	/* MF_H_ */
45