1 /* glphbm.h (Harwell-Boeing sparse matrix format) */
3 /***********************************************************************
4 * This code is part of GLPK (GNU Linear Programming Kit).
6 * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
7 * 2009, 2010 Andrew Makhorin, Department for Applied Informatics,
8 * Moscow Aviation Institute, Moscow, Russia. All rights reserved.
9 * E-mail: <mao@gnu.org>.
11 * GLPK is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
16 * GLPK is distributed in the hope that it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
19 * License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with GLPK. If not, see <http://www.gnu.org/licenses/>.
23 ***********************************************************************/
28 typedef struct HBM HBM;
31 { /* sparse matrix in Harwell-Boeing format; for details see the
32 report: I.S.Duff, R.G.Grimes, J.G.Lewis. User's Guide for the
33 Harwell-Boeing Sparse Matrix Collection (Release I), 1992 */
35 /* matrix title (informative) */
37 /* matrix key (informative) */
42 P.. pattern only (no numerical values supplied)
43 .S. symmetric (lower triangle + main diagonal)
45 .H. hermitian (lower triangle + main diagonal)
46 .Z. skew symmetric (lower triangle only)
49 ..E elemental (unassembled) */
52 F.. right-hand sides in dense format
53 M.. right-hand sides in same format as matrix
54 .G. starting vector(s) (guess) is supplied
55 ..X exact solution vector(s) is supplied */
57 /* format for pointers */
59 /* format for row (or variable) indices */
61 /* format for numerical values of coefficient matrix */
63 /* format for numerical values of right-hand sides */
65 /* total number of cards excluding header */
67 /* number of cards for ponters */
69 /* number of cards for row (or variable) indices */
71 /* number of cards for numerical values */
73 /* number of lines for right-hand sides;
74 including starting guesses and solution vectors if present;
75 zero indicates no right-hand side data is present */
77 /* number of rows (or variables) */
79 /* number of columns (or elements) */
81 /* number of row (or variable) indices;
82 equal to number of entries for assembled matrix */
84 /* number of elemental matrix entries;
85 zero in case of assembled matrix */
87 /* number of right-hand sides */
89 /* number of row indices;
90 ignored in case of unassembled matrix */
92 /* total number of entries in all right-hand sides */
94 /* total number of entries in all starting guesses */
96 /* total number of entries in all solution vectors */
97 int *colptr; /* alias: eltptr */
98 /* column pointers (in case of assembled matrix);
99 elemental matrix pointers (in case of unassembled matrix) */
100 int *rowind; /* alias: varind */
101 /* row indices (in case of assembled matrix);
102 variable indices (in case of unassembled matrix) */
104 /* right-hand side pointers */
106 /* right-hand side indices */
110 /* right-hand side values */
112 /* starting guess values */
114 /* solution vector values */
117 #define hbm_read_mat _glp_hbm_read_mat
118 HBM *hbm_read_mat(const char *fname);
119 /* read sparse matrix in Harwell-Boeing format */
121 #define hbm_free_mat _glp_hbm_free_mat
122 void hbm_free_mat(HBM *hbm);
123 /* free sparse matrix in Harwell-Boeing format */