HB_IO
HB Matrix Files
Read and Write Utilities
HB_IO
is a MATLAB library which
reads and writes files in the
Harwell Boeing sparse matrix format.
Note that the most common "flavor" of HB file is an assembled
sparse matrix, but that there are some lesser used options,
including storage of the matrix as unassembled finite element
matrices, and corresponding storage of vectors. These secondary
options are less well documented, and are only marginally supported
in this package.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
HB_IO is available in
a C++ version and
a FORTRAN90 version and
a MATLAB version.
Related Data and Programs:
DLAP_IO,
a FORTRAN90 library which
reads and writes matrices in a variety of formats, and includes a routine for reading
matrices in HB format.
HB,
a dataset directory which
contains a collection of sparse matrices in the HB format.
HB_TO_MM,
a MATLAB program which
converts a sparse matrix from Harwell-Boeing to Matrix Market format.
HB_TO_MSM,
a MATLAB program which
reads an HB file and converts the matrix to MATLAB's sparse matrix format.
HB_TO_ST,
a MATLAB program which
converts a sparse matrix from Harwell-Boeing to sparse triplet format.
HBSMC,
a dataset directory which
contains the Harwell Boeing Sparse Matrix Collection;
LINPLUS,
a MATLAB library which
includes routines to manipulate matrices stored in the HB sparse matrix
format.
MM_IO,
a MATLAB library which
reads and writes matrices in the Matrix Market format.
MM_TO_HB,
a MATLAB program which
reads the sparse matrix information from an MM Matrix Market file
and writes a corresponding HB Harwell Boeing file.
MSM_TO_HB,
a MATLAB program which
takes a matrix in MATLAB's sparse
matrix format and writes it out in the HB format.
ST_TO_HB,
a MATLAB program which
converts a sparse matrix file from
ST format to
HB format (Harwell Boeing format);
SUPER_LU,
a C library which
includes routines which can read and write matrices in the HB format.
Reference:
-
Iain Duff, Roger Grimes, John Lewis,
User's Guide for the Harwell-Boeing Sparse Matrix Collection,
October 1992,
Available online at
../../pdf/hb.pdf.
-
http://math.nist.gov/MatrixMarket/data/Harwell-Boeing/
the Matrix Market web site.
Source Code:
-
ch_cap.m,
returns the uppercase version of a character.
-
ch_eqi.m,
determines whether two characters are the same, ignoring case.
-
ch_is_digit.m,
determines whether a character is a digit.
-
ch_is_format_code.m,
determines whether a character is a one letter FORTRAN format code.
-
ch_to_digit.m,
converts a character to the digit it represents.
-
hb_exact_read.m,
reads the exact solution vectors of an HB file.
-
hb_exact_write.m,
writes the exact solution vectors of an HB file.
-
hb_file_read.m,
reads an HB file.
-
hb_file_write.m,
writes an HB file.
-
hb_guess_read.m,
reads the starting guess vectors of an HB file.
-
hb_guess_write.m,
writes the starting guess vectors of an HB file.
-
hb_header_print.m,
prints the header of an HB file.
-
hb_header_read.m,
reads the header of an HB file.
-
hb_header_write.m,
writes the header of an HB file.
-
hb_matvec_a_mem.m,
multiplies an assembled HB matrix times a vector.
-
hb_rhs_read.m,
reads the right hand sides of an HB file.
-
hb_rhs_write.m,
writes the right hand sides of an HB file.
-
hb_structure_print.m,
prints the structure of an HB file.
-
hb_structure_read.m,
reads the structure of an HB file.
-
hb_structure_write.m,
writes the structure of an HB file.
-
hb_ua_colind.m,
constructs a column index vector for an unsymmetric
assembled matrix.
-
hb_values_print.m,
prints the values of an HB file.
-
hb_values_read.m,
reads the values of an HB file.
-
hb_values_write.m,
writes the values of an HB file.
-
hb_vecmat_a_mem.m,
multiplies a vector times an assembled HB matrix.
-
i4vec_print.m,
prints an I4VEC.
-
i4vec_print_some.m,
prints some of an I4VEC.
-
r8mat_print.m,
prints an R8MAT.
-
r8mat_print_some.m,
prints some of an R8MAT.
-
r8vec_print.m,
prints an R8VEC.
-
r8vec_print_some.m,
prints some of an R8VEC.
-
s_len_trim.m,
determines the length of a string to the last nonblank.
-
s_to_format.m,
extracts information from a string representing a FORTRAN format.
-
s_to_i4.m,
converts a string to an I4.
-
s_to_r8.m,
converts a string to an R8.
-
timestamp.m,
prints the current YMDHMS date as a timestamp.
Examples and Tests:
-
hb_io_test.m,
runs all the tests.
-
hb_io_test_output.txt,
the output file.
-
hb_io_test01.m,
tests HB_HEADER_READ.
-
hb_io_test02.m,
tests HB_HEADER_WRITE.
-
hb_io_test03.m,
tests HB_STRUCTURE_READ.
-
hb_io_test04.m,
tests HB_STRUCTURE_WRITE.
-
hb_io_test05.m,
tests HB_VALUES_READ.
-
hb_io_test06.m,
tests HB_VALUES_WRITE.
-
hb_io_test07.m,
tests HB_RHS_READ, HB_GUESS_READ, HB_EXACT_READ.
-
hb_io_test08.m,
tests HB_RHS_WRITE, HB_GUESS_WRITE, HB_EXACT_WRITE.
-
hb_io_test09.m,
tests HB_FILE_READ.
-
hb_io_test10.m,
tests HB_FILE_WRITE.
-
hb_io_test11.m,
tests HB_MATVEC_A_MEM.
-
hb_io_test12.m,
tests HB_VECMAT_A_MEM.
Data files you may copy include:
-
rse_5.txt,
a sample HBSMC symmetric unassembled "element" matrix file.
-
rua_32.txt,
a sample HBSMC unsymmetric assembled sparse matrix file.
-
rua_32_file.txt,
a full version of "rua_32.txt" written by HB_FILE_WRITE.
-
rua_32_header.txt,
the header of "rua_32.txt" written by HB_HEADER_WRITE.
-
rua_32_rhs.txt,
the headers, structure, values and right hand side of
"rua_32.txt".
-
rua_32_structure.txt,
the headers and structure of "rua_32.txt".
-
rua_32_values.txt,
the headers, structure, and values of "rua_32.txt".
-
rua_32_ax.txt,
a sample HBSMC unsymmetric assembled sparse matrix file,
with exact solutions, and two right hand side vectors
computed from the exact solutions by calling HB_MATVEC_A_MEM.
You can go up one level to
the MATLAB source codes.
Last revised on 01 September 2005.