forked from h00shi/hbio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
103 lines (81 loc) · 4.19 KB
/
README
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
Harwell-Boeing File I/O in C
V. 1.0
National Institute of Standards and Technology, MD.
K.A. Remington
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
NOTICE
Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby granted
provided that the above copyright notice appear in all copies and
that both the copyright notice and this permission notice appear in
supporting documentation.
Neither the Author nor the Institution (National Institute of Standards
and Technology) make any representations about the suitability of this
software for any purpose. This software is provided "as is" without
expressed or implied warranty.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----------
DESCRIPTION
-----------
This package provides several I/O functions for Harwell-Boeing file,
and is particularly useful for C programs, since the Harwell-Boeing
format can rely heavily on Fortran specific formatting conventions.
A makefile and several driver programs demonstrating usage are also
provided.
------------------
NOTE ON INDEX BASE
------------------
The column pointer and row index vectors are by default 1-based (Fortran
compatible array indexing). To read/write 0-based vectors (for C array
indexing compatibility), simply change the macro definition in the
makefile. (use -D_SP_base=0)
------------------
DISTRIBUTION FILES
-----------------
Main source code: iohb.c, iohb.h
Matrix Market functionality: mmio.c, mmio.h
Makefile for drivers: makefile
Sample drivers: hb2mtxstrm.c
hbmat2hb.c
hbmat2mtx.c
hbrhs2mtx.c
sample.c
Sample data: data/*
--------------
SAMPLE DRIVERS
--------------
To build the driver programs, edit the makefile to reflect your
compiler and desired compile-time flags. Then type 'make'.
The drivers included are:
sample - Demonstrates basic usage, with many explanatory comments.
The functionality is uninteresting (it reads a Harwell-Boeing
file and writes out another Harwell-Boeing file), but it
demonstrates the I/O capabilities typically required.
hbmat2hb - Another example of usage, demonstrating how to read the
input data as characters so that output will exactly reflect
the accuracy of the input.
hbmat2mtx - Another example of usage, with more useful functionality.
The program reads a Harwell-Boeing file and writes a commented
Matrix Market formatted file reflecting the original data.
hbrhs2mtx - This program will extract any available auxillary vectors
from the Harwell-Boeing files (assuming they are in "full"
form), and creates a Matrix Market array formatted file for
each vector. (The data is read as character input, so that
accuracy in the generated output is identical to that of
the input file.)
hb2mtxstrm - This program is similar to hbmat2mtx, but doesn't store
the values of the matrix... instead it streams through the
entries, writing out a Matrix Market formatted file along
the way. This saves considerably on translation time
for large matrices. This program is only intended for
translating files of REAL and COMPLEX data, not PATTERN files.
PATTERN files can be translated with hbmat2mtx.
(The data is read as character input, so that accuracy in
the generated output is identical to that of the input file.)
-----------------
SAMPLE DATA FILES
-----------------
A data directory containing various Harwell-Boeing formatted files
is also provided. The files in this directory reflect some of the
"legal", but very difficult to parse, incarnations of the Harwell-Boeing
format. They can be used as arguments to the provided driver programs.