slap (original) (raw)
slap, a data directory which contains examples of slap files. These are files associated with the Sparse Linear Algebra Package (SLAP) of Anne Greenbaum and Mark Seager. This package includes a file format that may be used to store matrices externally.
File Characteristics:
- ASCII;
- Store the nonzero elements of a matrix A;
- Use a simple scheme in which every nonzero element is stored as a row index, column index and value;
- includes a space-saving option for symmetric matrices;
- may include one right hand side vector b;
- may include one solution vector x;
SLAP files begin with a single header line containing five integers. These integers are written in a FORTRAN FORMAT of '(5I10)', that is, five integers, each written into a field of width 10 characters, and right justified. The format is
N NELT ISYM IRHS ISOLN
The interpretation of these values is as follows:
- N, the order of the matrix;
- NELT, the number of nonzero values stored;
- ISYM, 1 if the matrix is symmetric, and only the lower triangular part is explicitly stored;
- IRHS, 1 if a right hand side vector is included;
- ISOLN, 1 if a solution vector is included; Note that, presumably, one would only include a solution vector if one is also including a right hand side. In fact, the slap software, as written, will not properly handle a slap file that contains a solution vector but not a right hand side.
Immediately following the header line comes a series of NELT records, each containing the row, column and value of a nonzero entry of the matrix. Each line is written in a FORTRAN FORMAT of '(1X,I5,1X,I5,1X,E16.7)', that is, a space, a right-justified integer in a field of width 5, a space, another right-justified integer in a field of width 5, a space, and a real number in a field of width 16, with 7 digits after the decimal place and written in an exponential format. For K = 1 to NELT, the format is
IA(K) JA(K) A(K)
The interpretation of these values is as follows:
- IA(K), the row index of the K-th element;
- JA(K), the column index of the K-th element;
- A(K), the value of the K-th element;
If IRHS = 1, then there follow N records containing a right hand side vector. Each line is written in a FORTRAN FORMAT of '(1X,E16.7)', that is, a space, and a real number in a field of width 16, with 7 digits after the decimal place and written in an exponential format. For I = 1 to N, the format is
RHS(I)
If ISOLN = 1, then there follow N records containing a solution vector. Each line is written in a FORTRAN FORMAT of '(1X,E16.7)', that is, a space, and a real number in a field of width 16, with 7 digits after the decimal place and written in an exponential format. For I = 1 to N, the format is
SOLN(I)
Licensing:
The computer code and data files described and made available on this web page are distributed underthe GNU LGPL license.
Reference:
- Mark Seager,
A SLAP for the Masses,
Technical Report: UCRL-100267,
Lawrence Livermore National Laboratory, December 1988. - Web site:
https://www.netlib.org/slap/index.html
Sample files:
- <a5by5.slap>, a very simple 5 by 5 matrix, right hand side and solution;
- <a5by5%5Fsym.slap>, a 5 by 5 symmetric matrix, right hand side and solution;
Last revised on 07 June 2022.