-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathhb_file.hpp
170 lines (170 loc) · 5.22 KB
/
hb_file.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
// hb_file.hpp
//
// Purpose:
//
// HB_FILE.hpp contains definitions for the variables that make up an HBSMC file.
//
// Discussion:
//
// In particular, the routine HB_FILE_READ does not return information
// through its argument list, but instead, stores a copy of all the
// HBSMC data in this module. In this way, a data structure of any
// size can be read, and shared with the user calling routine.
//
// A routine that wants to access this information must include the
// statement "use hb_file_module". To load data into the module,
// call HB_FILE_READ.
//
// Modified:
//
// 13 April 2004
//
// Author:
//
// John Burkardt
//
// Reference:
//
// Iain Duff, Roger Grimes, John Lewis,
// User's Guide for the Harwell-Boeing Sparse Matrix Collection,
// October 1992.
//
// Parameters:
//
// Local, char *TITLE, a 72 character title for the matrix.
//
// Local, char *KEY, an 8 character identifier for the matrix.
//
// Local, int TOTCRD, the total number of lines of data.
//
// Local, int PTRCRD, the number of input lines for pointers.
//
// Local, int INDCRD, the number of input lines for row indices.
//
// Local, int VALCRD, the number of input lines for numerical values.
//
// Local, int RHSCRD, the number of input lines for right hand sides.
//
// Local, char *MXTYPE, the 3 character matrix type.
// First character is R for Real, C for complex, P for pattern only.
// Second character is S for symmetric, U for unsymmetric, H for
// Hermitian, Z for skew symmetric, R for rectangular.
// Third character is A for assembled and E for unassembled
// finite element matrices.
//
// Local, int NROW, the number of rows or variables.
//
// Local, int NCOL, the number of columns or elements.
//
// Local, int NNZERO. In the case of assembled sparse matrices,
// this is the number of nonzeroes. In the case of unassembled finite
// element matrices, in which the right hand side vectors are also
// stored as unassembled finite element vectors, this is the total
// number of entries in a single unassembled right hand side vector.
//
// Local, int NELTVL, the number of finite element matrix entries,
// set to 0 in the case of assembled matrices.
//
// Local, char *PTRFMT, the 16 character format for reading pointers.
//
// Local, char *INDFMT, the 16 character format for reading indices.
//
// Local, char *VALFMT, the 20 character format for reading values.
//
// Local, char *RHSFMT, the 20 character format for reading values
// of the right hand side.
//
// Local, char *RHSTYP, the 3 character right hand side type.
// First character is F for full storage or M for same as matrix.
// Second character is G if starting "guess" vectors are supplied.
// Third character is X if exact solution vectors are supplied.
// Ignored if NRHS = 0.
//
// Local, int NRHS, the number of right hand sides.
//
// Local, int NRHSIX, the number of row indices (set to 0
// in the case of unassembled matrices.) Ignored if NRHS = 0.
//
// Local, int COLPTR[NCOL+1], COLPTR[I-1] points to the location of
// the first entry of column I in the sparse matrix structure.
//
// If MXTYPE[2] == 'A':
//
// Local, int ROWIND[NNZERO], the row index of each item.
//
// Local, float VALUES[NNZERO], the nonzero values of the matrix.
//
// If MXTYPE[2] == 'E':
//
// Local, int ROWIND[NELTVL], the row index of each item.
//
// Local, float VALUES[NELTVL], the nonzero values of the matrix.
//
// If RHSTYP[0] == 'F':
//
// Local, float RHSVAL[NROW*NRHS], contains NRHS dense right hand
// side vectors.
//
// Local, int RHSPTR[], is not used.
//
// Local, int RHSIND[], is not used.
//
// Local, float RHSVEC[], is not used.
//
// If RHSTYP[0] = 'M' and MXTYPE[2] = 'A':
//
// Local, float RHSVAL[], is not used.
//
// Local, int RHSPTR[NRHS+1], RHSPTR(I) points to the location of
// the first entry of right hand side I in the sparse right hand
// side vector.
//
// Local, int RHSIND[NRHSIX], indicates, for each entry of
// RHSVEC, the corresponding row index.
//
// Local, float RHSVEC[NRHSIX], contains the value of the right hand
// side entries.
//
// If RHSTYP[0] = 'M' and MXTYPE[2] = 'E':
//
// Local, float RHSVAL[NNZERO*NRHS], contains NRHS unassembled
// finite element vector right hand sides.
//
// Local, int RHSPTR[], is not used.
//
// Local, int RHSIND[], is not used.
//
// Local, float RHSVEC[], is not used.
//
// Local, float GUESS[NROW*NRHS], the starting guess vectors.
//
// Local, float EXACT[NROW*NRHS], the exact solution vectors.
//
int *colptr;
float *exact;
float *guess;
int indcrd;
char *indfmt;
char *key;
char *mxtype;
int ncol;
int neltvl;
int nnzero;
int nrhs;
int nrhsix;
int nrow;
int ptrcrd;
char *ptrfmt;
int rhscrd;
ch *rhsfmt;
int *rhsind;
int *rhsptr;
char *rhstyp;
float *rhsval;
float *rhsvec;
int rowind;
char *title;
int totcrd;
int valcrd;
char *valfmt;
float *values;