Department of Computer Science
Institute for Advanced Computer Studies
University of Maryland
Mathematical and Computations Sciences Division
NIST
Detailed information about Matran may be found in the Matran Writeup (ps, pdf). Here we give a general overview of Matran, its organization, and its capabilities.
Matran consists of a number of Fortran 95 modules, which fall into five categories.
The Rmat has a special tag field that specifies if the matrix is general, triangular, Hermitian, or positive (semi) definite. Matran uses this field to the most efficient way to perform operations with the matrices. There are no packed representations. For example, the zero elements of a triangular matrix are explicitly stored in the Rmat array.
The Rdiag implements a diagonal matrix with its diagonal elements stored in a linear array.
Although they are not currently implemented, Matran will eventually have complex types, Cmat and Cdiag, corresponding to the real types.
These operations are organized into collections of modules called suites. For example, there are two modules in the product suite that compute matrix products. The module RmatProduct_m implements products between Rmats, taking due account of the tag components mentioned above. The module RdiagProduct implements products between Rdiags and between Rdiags and Rmats. When the type Cmat is introduced, the module CmatProduct_m will be responsible for implementing products between any combination of Rmats, Rdiags, and Cmats.
A recurring problem in matrix oriented languages is how to prevent the recomputation of matrix decompositions in loops. Matran provides features that help the programmer circumvent this problem.
Matran allows considerable control over the creation of temporary matrix objects by shadowing matrix operators with subroutine forms. For example, the statement
C = A + Brequires a temporary Rmat to hold the intermediate result A + B. On the other hand the statement
call Plus(C, A, B)accomplishes the same thing with no temporaries.
Matran performs most of its computations by calling appropriate Lapack and Blas routines, some of which require the user to furnish working storage. Ordinarily, this storage is silently allocated and deallocated by Matran. But through optional arguments, the coder can furnish the storage explicitly, thus reducing calls to the allocator.
File |
Description |
Method |
|
README |
Please do! |
http |
ftp |
Matran.html |
This document |
http |
ftp |
MatranWriteup.ps |
The postscript documentation |
http |
ftp |
MatranWriteup.pdf |
The pdf documentation |
http |
ftp |
Matran.tar |
The whole shebang |
http |
ftp |
tar -xf Matran.tarThis will create a directory Matran with the following contents.
READMEDoc is a directory containing the Matran writup. The directory Matran contains the goodies.
Doc
Matran
FC = f95to invoke your Fortran 95 compiler with the Fortran preprocessor. (Note the initial spaces in the second line represent a tab character.) Then enter
.f95.o :
$(FC) -c -fpp $<
make allfollowed by
make archThis will produce a file Matran.a, which you can move to wherever you store your library files. To get a single precision version of Matran, change the make all command to
make all PREC=sngl
To use Matran, you must not only link your program to Matran.a but to Lapack and the Blas. If these routines are already installed on your system, use the standard linking syntax for your compiler-loader. If not, you may obtain them from
www.netlib.orgYou will need the real codes of the appropriate precision. The code is not difficult to compile and collect into a library. However, the compiler specified in the Lapack make file is Fortran 77, and it may be necessary to change it to Fortran 95 for compatibility with Matran. Note that the Blas you obtain from netlib are reference code and are not optimized for any particular machine.
Some compilers are fussy about the suffixes they will accept. For example some Fortran 95 compilers accept only the suffix F90. The Makefile contains a target chsuf that automates the tedious procedure of changing suffixes on unix machines with sed. Edit the command
ls -d *.s1 | sed 's/\(.*\)\.s1$$/mv & \1.s2/' | shto replace s1 with the old suffix and s2 with the new one, and then enter
make chsuf
Although Matran has been tested on a number of compilers, it has been impossible to cover the field. For this reason, the rough code used to debug the modules of Matran are included. Each debugging program is named after the module it tests; e.g., RmatDebug for the module Rmat_m. The line
LIB = lapack.a blas.ain Makefile must be edited to link to Lapack and the Blas on your system. The corresponding Makefile target is rmatdebug. Please understand that these uncommented programs do not represent exhaustive tests of the modules; they were written to bootstrap Matran, not establish its correctnesss. To aid you in deciphering these programs, representative output is contained in the .out files (e.g., Rmat.out for Rmat_m). If you enounter errors or problems please report them to stewart@cs.umd.edu.
Your use or distribution of Matran or any derivative code implies that you agree to this License.
Permission is hereby granted to use or copy this program, provided that the Copyright, this License, and the Availability note of the original version is retained on all copies. Only the current, umodified version of Matran may be distributed, whether by itself or as part of another program; however, additional modules extending Matran may be appended. Any such distributation stand must cite the Copyright, this License, the Availability note, and "Used by permission."
THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
Explanatory note: The reason for the restriction on the distribution is that Matran is still growing. It is desirable during this period to have only one version of core Matran in circulation. Suggestions for improvements may be sent to stewart@cs.umd.edu.
ftp://thales.cs.umd.edu/pub/Matran
I am indebted to John Reid and Bill Mitchell for sharing their expertise in Fortran~95. I also wish to thank my student Che-Rung Lee for his help in assembling the package.