1 | // (C) Copyright Jeremy Siek 2004 |
---|
2 | // Distributed under the Boost Software License, Version 1.0. (See |
---|
3 | // accompanying file LICENSE_1_0.txt or copy at |
---|
4 | // http://www.boost.org/LICENSE_1_0.txt) |
---|
5 | |
---|
6 | #ifndef IOHB_H |
---|
7 | #define IOHB_H |
---|
8 | |
---|
9 | #include<stdio.h> |
---|
10 | #include<stdlib.h> |
---|
11 | |
---|
12 | #ifdef __cplusplus |
---|
13 | extern "C" { |
---|
14 | #endif |
---|
15 | |
---|
16 | int readHB_info(const char* filename, int* M, int* N, int* nz, char** Type, |
---|
17 | int* Nrhs); |
---|
18 | |
---|
19 | int readHB_header(FILE* in_file, char* Title, char* Key, char* Type, |
---|
20 | int* Nrow, int* Ncol, int* Nnzero, int* Nrhs, |
---|
21 | char* Ptrfmt, char* Indfmt, char* Valfmt, char* Rhsfmt, |
---|
22 | int* Ptrcrd, int* Indcrd, int* Valcrd, int* Rhscrd, |
---|
23 | char *Rhstype); |
---|
24 | |
---|
25 | int readHB_mat_double(const char* filename, int colptr[], int rowind[], |
---|
26 | double val[]); |
---|
27 | |
---|
28 | int readHB_newmat_double(const char* filename, int* M, int* N, int* nonzeros, |
---|
29 | int** colptr, int** rowind, double** val); |
---|
30 | |
---|
31 | int readHB_aux_double(const char* filename, const char AuxType, double b[]); |
---|
32 | |
---|
33 | int readHB_newaux_double(const char* filename, const char AuxType, double** b); |
---|
34 | |
---|
35 | int writeHB_mat_double(const char* filename, int M, int N, |
---|
36 | int nz, const int colptr[], const int rowind[], |
---|
37 | const double val[], int Nrhs, const double rhs[], |
---|
38 | const double guess[], const double exact[], |
---|
39 | const char* Title, const char* Key, const char* Type, |
---|
40 | char* Ptrfmt, char* Indfmt, char* Valfmt, char* Rhsfmt, |
---|
41 | const char* Rhstype); |
---|
42 | |
---|
43 | int readHB_mat_char(const char* filename, int colptr[], int rowind[], |
---|
44 | char val[], char* Valfmt); |
---|
45 | |
---|
46 | int readHB_newmat_char(const char* filename, int* M, int* N, int* nonzeros, int** colptr, |
---|
47 | int** rowind, char** val, char** Valfmt); |
---|
48 | |
---|
49 | int readHB_aux_char(const char* filename, const char AuxType, char b[]); |
---|
50 | |
---|
51 | int readHB_newaux_char(const char* filename, const char AuxType, char** b, char** Rhsfmt); |
---|
52 | |
---|
53 | int writeHB_mat_char(const char* filename, int M, int N, |
---|
54 | int nz, const int colptr[], const int rowind[], |
---|
55 | const char val[], int Nrhs, const char rhs[], |
---|
56 | const char guess[], const char exact[], |
---|
57 | const char* Title, const char* Key, const char* Type, |
---|
58 | char* Ptrfmt, char* Indfmt, char* Valfmt, char* Rhsfmt, |
---|
59 | const char* Rhstype); |
---|
60 | |
---|
61 | int ParseIfmt(char* fmt, int* perline, int* width); |
---|
62 | |
---|
63 | int ParseRfmt(char* fmt, int* perline, int* width, int* prec, int* flag); |
---|
64 | |
---|
65 | void IOHBTerminate(char* message); |
---|
66 | #ifdef __cplusplus |
---|
67 | } |
---|
68 | #endif |
---|
69 | |
---|
70 | #endif |
---|