Ralph Schleicher > Math-BLAS-1.01 > Math::BLAS::Legacy
Module Version: 1.01

# NAME

Math::BLAS::Legacy - original Level 1, 2, and 3 BLAS

# SYNOPSIS

`    use Math::BLAS::Legacy;`

# DESCRIPTION

## Level 1 BLAS

`blas_dcopy` (n, x, x_ind, x_incr, y, y_ind, y_incr)

Copy array elements.

• First argument n is the number of array elements.
• Second argument x is the source array (an array reference).
• Third argument x_ind is the array index of the first array element for the array x.
• Fourth argument x_incr is the array index increment for the array x.
• Fifth argument y is the destination array (an array reference).
• Sixth argument y_ind is the array index of the first array element for the array y.
• Seventh argument y_incr is the array index increment for the array y.

Arguments x and y may be the same array.

`blas_dswap` (n, x, x_ind, x_incr, y, y_ind, y_incr)

Interchange array elements.

• First argument n is the number of array elements.
• Second argument x is the first array (an array reference).
• Third argument x_ind is the array index of the first array element for the array x.
• Fourth argument x_incr is the array index increment for the array x.
• Fifth argument y is the second array (an array reference).
• Sixth argument y_ind is the array index of the first array element for the array y.
• Seventh argument y_incr is the array index increment for the array y.

Arguments x and y may be the same array.

`blas_dset` (n, alpha, x, x_ind, x_incr)

Set array elements to a constant.

• First argument n is the number of array elements.
• Second argument alpha is the constant value.
• Third argument x is the array (an array reference).
• Fourth argument x_ind is the array index of the first array element.
• Fifth argument x_incr is the array index increment.
`blas_dscal` (n, alpha, x, x_ind, x_incr)

Multiply array elements by a constant.

• First argument n is the number of array elements.
• Second argument alpha is the constant value.
• Third argument x is the array (an array reference).
• Fourth argument x_ind is the array index of the first array element.
• Fifth argument x_incr is the array index increment.
`blas_daxpy` (n, alpha, x, x_ind, x_incr, y, y_ind, y_incr)

Accumulate multiples of array elements.

• First argument n is the number of array elements.
• Second argument alpha is the multiplier.
• Third argument x is the multiplicand array (an array reference).
• Fourth argument x_ind is the array index of the first array element for the array x.
• Fifth argument x_incr is the array index increment for the array x.
• Sixth argument y is the accumulator array (an array reference).
• Seventh argument y_ind is the array index of the first array element for the array y.
• Eighth argument y_incr is the array index increment for the array y.
`blas_ddot` (n, x, x_ind, x_incr, y, y_ind, y_incr)

Return the inner product of two vectors.

• First argument n is the number of array elements.
• Second argument x is the left-hand side operand (an array reference).
• Third argument x_ind is the array index of the first array element for the array x.
• Fourth argument x_incr is the array index increment for the array x.
• Fifth argument y is the right-hand side operand (an array reference).
• Sixth argument y_ind is the array index of the first array element for the array y.
• Seventh argument y_incr is the array index increment for the array y.
`blas_dasum` (n, x, x_ind, x_incr)

Return the sum of the absolute values, that is the one-norm of a vector.

• First argument n is the number of array elements.
• Second argument x is the array (an array reference).
• Third argument x_ind is the array index of the first array element for the array x.
• Fourth argument x_incr is the array index increment for the array x.
`blas_dnrm2` (n, x, x_ind, x_incr)

Return the two-norm (Euclidean norm) of a vector.

• First argument n is the number of array elements.
• Second argument x is the array (an array reference).
• Third argument x_ind is the array index of the first array element for the array x.
• Fourth argument x_incr is the array index increment for the array x.
`blas_idamax` (n, x, x_ind, x_incr)

Return the index offset of the first array element having the maximum absolute value.

• First argument n is the number of array elements to search.
• Second argument x is the array (an array reference).
• Third argument x_ind is the array index of the first array element for the array x.
• Fourth argument x_incr is the array index increment for the array x.

## Level 2 BLAS

The underlying mathematical formulation is

y ← α A·x + β y

where A is a (mn) matrix, x and y are vectors, and α and β are scalars.

If β is zero, y is set to the result of the matrix/vector multiplication. If β is one, the result of the matrix/vector multiplication is added to y. Otherwise, y is scaled by β before adding the result of the matrix/vector multiplication.

`blas_dgemv` (a_op, m, n, alpha, a, a_ind, a_incr, x, x_ind, x_incr, beta, y, y_ind, y_incr)

General matrix/vector multiplication.

• First argument a_op is the transpose operator for the matrix A. Value is either `BLAS_NO_TRANS` or `BLAS_TRANS`.
• Second argument m is the number of matrix rows.
• Third argument n is the number of matrix columns.
• Fourth argument alpha is the multiplier.
• Fifth argument a is the matrix operand (an array reference).
• Sixth argument a_ind is the array index of the first array element for the array a.
• Seventh argument a_incr is the array index increment for the array a.
• Eighth argument x is the vector operand (an array reference).
• Ninth argument x_ind is the array index of the first array element for the array x.
• Tenth argument x_incr is the array index increment for the array x.
• Eleventh argument beta is the scale factor for the result vector.
• Twelfth argument y is the result vector (an array reference).
• Thirteenth argument y_ind is the array index of the first array element for the array y.
• Fourteenth argument y_incr is the array index increment for the array y.

## Level 3 BLAS

The underlying mathematical formulation is

C ← α A·B + β C

where C is a (mn) matrix, A and B are matrices, and α and β are scalars.

If β is zero, C is set to the result of the matrix/matrix multiplication. If β is one, the result of the matrix/matrix multiplication is added to C. Otherwise, C is scaled by β before adding the result of the matrix/matrix multiplication.

`blas_dgemm` (a_op, b_op, m, n, k, alpha, a, a_ind, a_incr, b, b_ind, b_incr, beta, c, c_ind, c_incr)

General matrix/matrix multiplication.

• First argument a_op is the transpose operator for the matrix A. Value is either `BLAS_NO_TRANS` or `BLAS_TRANS`.
• Second argument b_op is the transpose operator for the matrix B. Value is either `BLAS_NO_TRANS` or `BLAS_TRANS`.
• Third argument m is the number of matrix rows.
• Fourth argument n is the number of matrix columns.
• Fifth argument k is the number of matrix columns of the matrix A and the number of matrix rows of the matrix B.
• Sixth argument alpha is the multiplier.
• Seventh argument a is the left-hand side matrix operand (an array reference).
• Eighth argument a_ind is the array index of the first array element for the array a.
• Ninth argument a_incr is the array index increment for the array a.
• Tenth argument b is the right-hand side matrix operand (an array reference).
• Eleventh argument b_ind is the array index of the first array element for the array b.
• Twelfth argument b_incr is the array index increment for the array b.
• Thirteenth argument beta is the scale factor for the result matrix.
• Fourteenth argument c is the result matrix (an array reference).
• Fifteenth argument c_ind is the array index of the first array element for the array c.
• Sixteenth argument c_incr is the array index increment for the array c.

# AUTHOR

Ralph Schleicher <rs@ralph-schleicher.de>

syntax highlighting: