Overview of the BLAS



next up previous contents index
Next: Glossary Up: Templates for the Solution Previous: Obtaining the Software

Overview of the BLAS

 

The BLAS give us a standardized set of basic codes for performing operations on vectors and matrices. BLAS take advantage of the Fortran storage structure and the structure of the mathematical system wherever possible. Additionally, many computers have the BLAS library optimized to their system. Here we use five routines:

  1. SCOPY: copies a vector onto another vector
  2. SAXPY: adds vector (multiplied by a scalar) to vector
  3. SGEMV: general matrix vector product
  4. STRMV: matrix vector product when the matrix is triangular
  5. STRSV: solves for triangular matrix

The prefix ``S'' denotes single precision. This prefix may be changed to ``D'', ``C'', or ``Z'', giving the routine double, complex, or double complex precision. (Of course, the declarations would also have to be changed.) It is important to note that putting double precision into single variables works, but single into double will cause errors.

If we define a(i,j) and = x(i), we can see what the code is doing:

Note that the parameters in single quotes are for descriptions such as 'U' for `UPPER TRIANGULAR', 'N' for `No Transpose'. This feature will be used extensively, resulting in storage savings (among other advantages).

The variable LDA is critical for addressing the array correctly. LDA is the leading dimension of the two-dimensional array A, that is, LDA is the declared (or allocated) number of rows of the two-dimensional array .



next up previous contents index
Next: Glossary Up: Templates for the Solution Previous: Obtaining the Software



Jack Dongarra
Mon Nov 20 08:52:54 EST 1995