SBLAS - Single precision Basic Linear Algebra Subroutines
(adapted from LINPACK FORTRAN):
isamax return index of element with maximum absolute value
sasum return sum of absolute values
saxpy compute y[i] = a*x[i]+y[i]
scopy copy x[i] to y[i] (i.e., set y[i] = x[i])
sdot return sum of x[i]*y[i] (i.e., return the dot product of x and y)
snrm2 return square root of sum of squares of x[i]
sscal compute x[i] = a*x[i]
sswap swap x[i] and y[i]
Function Prototypes:
int isamax (int n, float *sx, int incx);
float sasum (int n, float *sx, int incx);
void saxpy (int n, float sa, float *sx, int incx, float *sy, int incy);
void scopy (int n, float *sx, int incx, float *sy, int incy);
float sdot (int n, float *sx, int incx, float *sy, int incy);
float snrm2 (int n, float *sx, int incx);
void sscal (int n, float sa, float *sx, int incx);
void sswap (int n, float *sx, int incx, float *sy, int incy);
isamax:
Input:
n number of elements in array
sx array[n] of elements
incx increment between elements
Returned: index of element with maximum absolute value
sasum:
Input:
n number of elements in array
sx array[n] of elements
incx increment between elements
Returned: sum of absolute values
saxpy:
Input:
n number of elements in arrays
sa the scalar multiplier
sx array[n] of elements to be scaled and added
incx increment between elements of sx
sy array[n] of elements to be added
incy increment between elements of sy
Output:
sy array[n] of accumulated elements
scopy:
Input:
n number of elements in arrays
sx array[n] of elements to be copied
incx increment between elements of sx
incy increment between elements of sy
Output:
sy array[n] of copied elements
sdot:
Input:
n number of elements in arrays
sx array[n] of elements
incx increment between elements of sx
sy array[n] of elements
incy increment between elements of sy
Returned: dot product of the two arrays
snrm2
Input:
n number of elements in array
sx array[n] of elements
incx increment between elements
Returned: square root of sum of squares of x[i]
sscal:
Input:
n number of elements in array
sa the scalar multiplier
sx array[n] of elements
incx increment between elements
Output:
sx array[n] of scaled elements
sswap:
Input:
n number of elements in arrays
sx array[n] of elements
incx increment between elements of sx
sy array[n] of elements
incy increment between elements of sy
Output:
sx array[n] of swapped elements
sy array[n] of swapped elements
Notes:
Adapted from Linpack Fortran.
snrm2:
This simple version may cause overflow or underflow!
Author: Dave Hale, Colorado School of Mines, 10/01/89