;; ;; ;; blas documentation for the Chicken Scheme module system. ;; (use eggdoc) (define doc `((eggdoc:begin (name "blas") (description "An interface to level 1, 2 and 3 BLAS linear algebra routines.") (author ((url "mailto:felix@call-with-current-continuation.org" "Felix Winkelmann") " and " (url "http://chicken.wiki.br/users/ivan-raikov" "Ivan Raikov"))) (history (version "2.6" "Ported to Chicken 4") (version "2.5" "Build script updated for better cross-platform compatibility") (version "2.4" "Added iger procedures; fixed a bug in the default arguments of level 2 routines") (version "2.3" "Added iaxpy procedures; fixed a bug in the default arguments of level 1 routines") (version "2.2" "Fixed a bug in the renaming of C routines") (version "2.1" "Added eggdoc property to meta file") (version "2.0" "An overhaul of the library to introduce safe, unsafe, and pure variants of each routine") (version "1.8" "Added icopy procedures [by Ivan Raikov]") (version "1.7" "Support for Mac OS X added [by Will Farr]") (version "1.6" "Fixed bug in blas library test code") (version "1.5" "Added support for CLAPACK [by Ivan Raikov]") (version "1.4" "Added support for atlas CBLAS library [by Stu Glaser]") (version "1.3" "Tries to find a proper CBLAS library (currently only GSL)") (version "1.2" "Adapted to new FFI macro-names") (version "1.1" "Adapted to new setup scheme")) (requires) (usage "(require-extension blas)") (download "blas.egg") (documentation (subsection "Naming conventions for routines" (p "Every routine in the BLAS library comes in four flavors, " "each prefixed by the letters S, D, C, and Z, respectively. " "Each letter indicates the format of input data: " (ul (li "S stands for single-precision (32-bit IEEE floating point numbers), ") (li "D stands for double-precision (64-bit IEEE floating point numbers), ") (li "C stands for complex numbers (represented by pairs of 32-bit IEEE floating point numbers), ") (li "Z stands for double complex numbers (represented by pairs of 64-bit IEEE floating point numbers)"))) (p "In addition, each BLAS routine in this egg comes in three flavors: " (ol (li "Safe, pure (prefix: " (b "blas:") ")" (p (i "Safe") " routines check the sizes of their input arguments. " "For example, if a routine is supplied arguments that indicate that " "an input matrix is of dimensions " (i "M") "-by-" (i "N") ", then " "the argument corresponding to that matrix is checked that it is of size " (i "M * N") ". ") (p (i "Pure") " routines do not alter their arguments in any way. " "A new matrix or vector is allocated for the return value of the routine. ")) (li "Safe, destructive (prefix: " (b "blas:") ", suffix: !)" (p (i "Safe") " routines check the sizes of their input arguments. " "For example, if a routine is supplied arguments that indicate that " "an input matrix is of dimensions " (i "M") "-by-" (i "N") ", then " "the argument corresponding to that matrix is checked that it is of size " (i "M * N") ". ") (p (i "Destructive") " routines can modify some or all of their arguments. " "They are given names ending in exclamation mark. " "Please consult the BLAS documentation to determine which functions modify " "their input arguments. ")) (li "Unsafe, destructive (prefix: " (b "unsafe-blas:") ", suffix: !)" (p (i "Unsafe") " routines do not check the sizes of their input arguments. " "They invoke the corresponding BLAS routines directly. " "Unsafe routines do not have pure variants. ")))) (p "For example, function " (i "xGEMM") " (matrix-matrix multiplication) " "comes in the following variants: " (table (tr (th (b "BLAS name")) (th (b "Safe, pure")) (th (b "Safe, destructive")) (th (b "Unsafe, destructive"))) (tr (td (i "SGEMM")) (td (i "blas:sgemm")) (td (i "blas:sgemm!")) (td (i "unsafe-blas:sgemm!"))) (tr (td (i "DGEMM")) (td (i "blas:dgemm")) (td (i "blas:dgemm!")) (td (i "unsafe-blas:dgemm!"))) (tr (td (i "CGEMM")) (td (i "blas:cgemm")) (td (i "blas:cgemm!")) (td (i "unsafe-blas:cgemm!"))) (tr (td (i "ZGEMM")) (td (i "blas:zgemm")) (td (i "blas:zgemm!")) (td (i "unsafe-blas:zgemm!")))))) (subsection "Vector copy routines" (procedure "blas:scopy:: F32VECTOR -> F32VECTOR " (procedure "blas:dcopy:: F64VECTOR -> F64VECTOR ") (procedure "blas:ccopy:: F32VECTOR -> F32VECTOR ") (procedure "blas:zcopy:: F64VECTOR -> F64VECTOR ") (p "These procedures return a copy of given input SRFI-4 vector. " "The returned vector is allocated with the corresponding SRFI-4 " "constructor, and the input vector is copied to it by the " "corresponding BLAS copy procedure. "))) (subsection "BLAS level 1 routines" (subsection "Conventions" (p "The BLAS level 1 procedures in this egg differ from the actual routines " "they invoke by the position of the vector increment arguments (" (tt "INCX") " and " (tt "INCY") "). " "In this egg, these arguments are optional; the default value of " (tt "INCX") " and " (tt "INCY") " is 1. ") (p "In the procedure signatures below, these optional arguments are indicated " "by [ and ] (square brackets). ")) (subsubsection "Apply plane rotation" (procedure "blas:srot:: N * X * Y * C * S [INCX * INCY] -> F32VECTOR * F32VECTOR " (procedure "blas:drot:: N * X * Y * C * S [INCX * INCY] -> F64VECTOR * F64VECTOR ") (p (tt "xROT") " applies a plane rotation matrix to a sequence of ordered " "pairs: " (tt "(x_i , y_i)") ", for " (tt "i = 1, 2, ..., n") ". ") (p (tt "X") " and " (tt "Y") " are vector of dimensions " (tt "(N-1) * abs(incx) + 1") " and "(tt "(N-1) * abs(incy) + 1") ", respectively. ") (p (tt "C") " and " (tt "S") " are respectively the cosine and sine of the " "plane of rotation."))) (subsubsection "Scale vector" (procedure "blas:sscal:: N * ALPHA * X [INCX] -> F32VECTOR " (procedure "blas:dscal:: N * ALPHA * X [INCX] -> F64VECTOR ") (procedure "blas:cscal:: N * ALPHA * X [INCX] -> F32VECTOR ") (procedure "blas:zscal:: N * ALPHA * X [INCX] -> F64VECTOR ") (p (tt "xSCAL") " scales a vector with a scalar: " (tt "x := alpha * x") ". "))) (subsubsection "Swap the elements of two vectors" (procedure "blas:sswap:: N * X * Y [INCX * INCY] -> F32VECTOR " (procedure "blas:dswap:: N * X * Y [INCX * INCY] -> F64VECTOR ") (procedure "blas:cswap:: N * X * Y [INCX * INCY] -> F32VECTOR ") (procedure "blas:zswap:: N * X * Y [INCX * INCY] -> F64VECTOR ") (p (tt "xSWAP") " interchanges the elements of two vectors: " (tt "x <-> y") ". "))) (subsubsection "Real vector dot product" (procedure "blas:sdot:: N * X * Y [INCX * INCY] -> NUMBER " (procedure "blas:ddot:: N * X * Y [INCX * INCY] -> NUMBER ") (p (tt "xDOT") " computes the dot product of two vectors of real values: " (tt "dot := x'*y = \\Sum_{i=1}^{n} (x_i * y_i)") ". "))) (subsubsection "Complex vector dot product" (procedure "blas:cdotu:: N * X * Y [INCX * INCY] -> NUMBER " (procedure "blas:zdotu:: N * X * Y [INCX * INCY] -> NUMBER ") (p (tt "xDOTU") " computes the dot product of two vectors of complex values: " (tt "dotu := x'*y = \\Sum_{i=1}^{n} (x_i * y_i)") ". " ))) (subsubsection "Hermitian vector dot product" (procedure "blas:cdotc:: N * X * Y [INCX * INCY] -> NUMBER " (procedure "blas:zdotc:: N * X * Y [INCX * INCY] -> NUMBER ") (p (tt "xDOTC") " computes the dot product of the conjugates of two complex vectors: " (tt "dotu := conjg(x')*y = \\Sum_{i=1}^{n} (conjg(x_i) * y_i)") ", for " (tt "i = 1, 2, ..., n") ". "))) (subsubsection "Vector multiply-add" (procedure "blas:saxpy:: N * ALPHA * X * Y [INCX * INCY] -> F32VECTOR " (procedure "blas:daxpy:: N * ALPHA * X * Y [INCX * INCY] -> F64VECTOR ") (procedure "blas:caxpy:: N * ALPHA * X * Y [INCX * INCY] -> F32VECTOR ") (procedure "blas:zaxpy:: N * ALPHA * X * Y [INCX * INCY] -> F64VECTOR ") (p (tt "xAXPY") " adds a scalar multiple of a vector to another vector: " (tt "y := alpha * x + y") ". "))) (subsubsection "Vector multiply-add with optional offset" (procedure "blas:siaxpy:: N * ALPHA * X * Y [INCX * INCY * XOFS * YOFS] -> F32VECTOR " (procedure "blas:diaxpy:: N * ALPHA * X * Y [INCX * INCY * XOFS * YOFS] -> F64VECTOR ") (procedure "blas:ciaxpy:: N * ALPHA * X * Y [INCX * INCY * XOFS * YOFS] -> F32VECTOR ") (procedure "blas:ziaxpy:: N * ALPHA * X * Y [INCX * INCY * XOFS * YOFS] -> F64VECTOR ") (p (tt "xIAXPY") " adds a scalar multiple of a vector to another vector, where " "the beginning of each vector argument can be offset: " (tt "y[yofs:n] := alpha * x[xofs:n] + y[yofs:n]") ". "))) (subsubsection "Euclidean norm of a vector" (procedure "blas:snrm2:: N * X [INCX] -> NUMBER " (procedure "blas:dnrm2:: N * X [INCX] -> NUMBER ") (procedure "blas:cnrm2:: N * X [INCX] -> NUMBER ") (procedure "blas:znrm2:: N * X [INCX] -> NUMBER ") (p (tt "xNRM2") " computes the Euclidean (L2) norm of a vector. "))) (subsubsection "Sum of absolute values of the elements in a vector" (procedure "blas:sasum:: N * X [INCX] -> NUMBER " (procedure "blas:dasum:: N * X [INCX] -> NUMBER ") (procedure "blas:casum:: N * X [INCX] -> NUMBER ") (procedure "blas:zasum:: N * X [INCX] -> NUMBER ") (p (tt "xASUM") " sums the absolute values of the elements in a vector. "))) (subsubsection "Sum of absolute values of the elements in a vector" (procedure "blas:samax:: N * X [INCX] -> INDEX " (procedure "blas:damax:: N * X [INCX] -> INDEX ") (procedure "blas:camax:: N * X [INCX] -> INDEX ") (procedure "blas:zamax:: N * X [INCX] -> INDEX ") (p (tt "xAMAX") " searches a vector for the first occurrence of " "its maximum absolute value, and returns the index of that element. "))) ) (subsection "BLAS level 2 routines" (subsection "Conventions" (p "The BLAS level 2 procedures in this egg differ from the actual routines " "they invoke by the position of the leading dimension argument (" (tt "LDA") ") and the vector increment arguments (" (tt "INCX") " and " (tt "INCY") "). " "In this egg, these arguments are optional; the default value of " (tt "LDA") "is the largest matrix dimension, depending on the semantics " "of the respective operation, and the default value of " (tt "INCX") " and " (tt "INCY") " is 1. ") (p "In the procedure signatures below, these optional arguments are indicated " "by [ and ] (square brackets). ") (p "Argument " (tt "ORDER") " is one of " (tt "blas:RowMajor") " or " (tt "blas:ColMajor") " to indicate that the input and output matrices " "are in row-major or column-major form, respectively. ") (p "Where present, argument " (tt "TRANS") " can be one of " (tt "blas:NoTrans") " or " (tt "blas:Trans") " to indicate whether the input matrix is to be transposed or not. ") (p "Where present, argument " (tt "UPLO") " can be one of " (tt "blas:Upper") " or " (tt "blas:Lower") " to indicate whether the " "upper or lower triangular part of an input symmetric matrix is to referenced," "or to specify the type of an input triangular matrix.") (p "Where present, argument " (tt "DIAG") " can be one of " (tt "blas:NonUnit") " or " (tt "blas:Unit") " to indicate whether " "an input triangular matrix is unit triangular or not.") ) (subsubsection "General matrix-vector multiply-add" (procedure "blas:sgemv:: ORDER * TRANS * M * N * ALPHA * A * X * BETA * Y [LDA * INCX * INCY] -> F32VECTOR " (procedure "blas:dgemv:: ORDER * TRANS * M * N * ALPHA * A * X * BETA * Y [LDA * INCX * INCY] -> F64VECTOR ") (procedure "blas:cgemv:: ORDER * TRANS * M * N * ALPHA * A * X * BETA * Y [LDA * INCX * INCY] -> F32VECTOR ") (procedure "blas:zgemv:: ORDER * TRANS * M * N * ALPHA * A * X * BETA * Y [LDA * INCX * INCY] -> F64VECTOR ") (p (tt "xGEMV") " performs the matrix-vector multiply-add operation of the form " (tt "y := alpha*op( A )*x + beta*y") ", where " (tt "op( X )") " is " "one of " (tt "op( A ) = A") " or " (tt "op( A ) = A'") ". ") (p (tt "ALPHA") " and " (tt "BETA") " are scalars, and " (tt "A") " is an " (tt "M x N") " matrix. " ) (p (tt "X") " is a vector of size " (tt "(1 + ( N - 1 ) * abs(INCX))") " when argument " (tt "TRANS") " is " (tt "blas:NoTrans") ", and " (tt "(1 + ( M - 1 ) * abs(INCX))") " otherwise. " (tt "Y") " is a vector of size " (tt "(1 + ( M - 1 ) * abs(INCY))") " when argument " (tt "TRANS") " is " (tt "blas:NoTrans") ", and " (tt "(1 + ( N - 1 ) * abs(INCY))") " otherwise. "))) (subsubsection "Banded matrix-vector multiply-add" (procedure "blas:sgbmv:: ORDER * TRANS * M * N * KL * KU * ALPHA * A * X * BETA * Y [LDA * INCX * INCY] -> F32VECTOR " (procedure "blas:dgbmv:: ORDER * TRANS * M * N * KL * KU * ALPHA * A * X * BETA * Y [LDA * INCX * INCY] -> F64VECTOR ") (procedure "blas:cgbmv:: ORDER * TRANS * M * N * KL * KU * ALPHA * A * X * BETA * Y [LDA * INCX * INCY] -> F32VECTOR ") (procedure "blas:zgbmv:: ORDER * TRANS * M * N * KL * KU * ALPHA * A * X * BETA * Y [LDA * INCX * INCY] -> F64VECTOR ") (p (tt "xGBMV") " performs the matrix-vector multiply-add operation of the form " (tt "y := alpha*op( A )*x + beta*y") ", where " (tt "op( X )") " is " "one of " (tt "op( A ) = A") " or " (tt "op( A ) = A'") ". ") (p (tt "ALPHA") " and " (tt "BETA") " are scalars, and " (tt "A") " is an " (tt "M x N") " banded matrix, with " (tt "KL") " sub-diagonals and " (tt "KU") " super-diagonals. ") (p (tt "X") " is a vector of size " (tt "(1 + ( N - 1 ) * abs(INCX))") " when argument " (tt "TRANS") " is " (tt "blas:NoTrans") ", and " (tt "(1 + ( M - 1 ) * abs(INCX))") " otherwise. " (tt "Y") " is a vector of size " (tt "(1 + ( M - 1 ) * abs(INCY))") " when argument " (tt "TRANS") " is " (tt "blas:NoTrans") ", and " (tt "(1 + ( N - 1 ) * abs(INCY))") " otherwise. "))) (subsubsection "Hermitian matrix-vector multiply-add" (procedure "blas:chemv:: ORDER * UPLO * N * ALPHA * A * X * BETA * Y [LDA * INCX * INCY] -> F32VECTOR " (procedure "blas:zhemv:: ORDER * UPLO * N * ALPHA * A * X * BETA * Y [LDA * INCX * INCY] -> F64VECTOR ") (p (tt "xHEMV") " performs the matrix-vector multiply-add operation of the form " (tt "y := alpha*op( A )*x + beta*y") ", where " (tt "op( X )") " is " "one of " (tt "op( A ) = A") " or " (tt "op( A ) = A'") ". ") (p (tt "ALPHA") " and " (tt "BETA") " are scalars, and " (tt "A") " is an " (tt "N x N") " Hermitian matrix. ") (p (tt "X") " and " (tt "Y") " are " (tt "N") " element vectors. "))) (subsubsection "Hermitian banded matrix-vector multiply-add" (procedure "blas:chbmv:: ORDER * UPLO * N * K * ALPHA * A * X * BETA * Y [LDA * INCX * INCY] -> F32VECTOR " (procedure "blas:zhbmv:: ORDER * UPLO * N * K * ALPHA * A * X * BETA * Y [LDA * INCX * INCY] -> F64VECTOR ") (p (tt "xHBMV") " performs the matrix-vector multiply-add operation of the form " (tt "y := alpha*op( A )*x + beta*y") ", where " (tt "op( X )") " is " "one of " (tt "op( A ) = A") " or " (tt "op( A ) = A'") ". ") (p (tt "ALPHA") " and " (tt "BETA") " are scalars, and " (tt "A") " is an " (tt "N x N") " Hermitian banded matrix, with " (tt "K") " super-diagonals. ") (p (tt "X") " and " (tt "Y") " are " (tt "N") " element vectors. "))) (subsubsection "Symmetric matrix-vector multiply-add" (procedure "blas:ssymv:: ORDER * UPLO * N * ALPHA * A * X * BETA * Y [LDA * INCX * INCY] -> F32VECTOR " (procedure "blas:dsymv:: ORDER * UPLO * N * ALPHA * A * X * BETA * Y [LDA * INCX * INCY] -> F64VECTOR ") (p (tt "xSYMV") " performs matrix-vector multiply-add operation of the form " (tt "y := alpha*A*x + beta*y") ". ") (p (tt "ALPHA") " and " (tt "BETA") " are scalars, and " (tt "A") " is an " (tt "N x N") " symmetric matrix. " ) (p (tt "X") " and " (tt "Y") " are " (tt "N") " element vectors. "))) (subsubsection "Banded symmetric matrix-vector multiply-add" (procedure "blas:ssbmv:: ORDER * UPLO * N * K * ALPHA * A * X * BETA * Y [LDA * INCX * INCY] -> F32VECTOR " (procedure "blas:dsbmv:: ORDER * UPLO * N * K * ALPHA * A * X * BETA * Y [LDA * INCX * INCY] -> F64VECTOR ") (p (tt "xSBMV") " performs matrix-vector multiply-add operation of the form " (tt "y := alpha*A*B + beta*y") ". ") (p (tt "ALPHA") " and " (tt "BETA") " are scalars, and " (tt "A") " is an " (tt "N x N") " symmetric banded matrix, with " (tt "K") " super-diagonals. " ) (p (tt "X") " and " (tt "Y") " are " (tt "N") " element vectors. "))) (subsubsection "Triangular matrix-vector multiply-add" (procedure "blas:strmv:: ORDER * UPLO * TRANS * DIAG * N * A * X [LDA * INCX] -> F32VECTOR " (procedure "blas:dtrmv:: ORDER * UPLO * TRANS * DIAG * N * A * X [LDA * INCX] -> F64VECTOR ") (procedure "blas:ctrmv:: ORDER * UPLO * TRANS * DIAG * N * A * X [LDA * INCX] -> F32VECTOR ") (procedure "blas:ztrmv:: ORDER * UPLO * TRANS * DIAG * N * A * X [LDA * INCX] -> F64VECTOR ") (p (tt "xTRMV") " performs matrix-vector multiply-add operation of the form " (tt "y := alpha*op( A )*x") ", where " (tt "op ( A ) = A") " or " (tt "op ( A ) = A'") ) (p (tt "ALPHA") " and " (tt "BETA") " are scalars, and " (tt "A") " is an " (tt "N x N") " upper or lower triangular matrix. " ) (p (tt "X") " is a vector of length " (tt "(1 + (n - 1) * abs(INCX))") ". "))) (subsubsection "Banded triangular matrix-vector multiply-add" (procedure "blas:stbmv:: ORDER * UPLO * TRANS * DIAG * N * K * A * X [LDA * INCX] -> F32VECTOR " (procedure "blas:dtbmv:: ORDER * UPLO * TRANS * DIAG * N * K * A * X [LDA * INCX] -> F64VECTOR ") (procedure "blas:ctbmv:: ORDER * UPLO * TRANS * DIAG * N * K * A * X [LDA * INCX] -> F32VECTOR ") (procedure "blas:ztbmv:: ORDER * UPLO * TRANS * DIAG * N * K * A * X [LDA * INCX] -> F64VECTOR ") (p (tt "xTBMV") " performs matrix-vector multiply-add operation of the form " (tt "y := alpha*A*B + beta*y") ", where " (tt "op ( A ) = A") " or " (tt "op ( A ) = A'") ) (p (tt "ALPHA") " and " (tt "BETA") " are scalars, and " (tt "A") " is an " (tt "N x N") " upper or lower triangular banded matrix, with " (tt "K+1") " diagonals. " ) (p (tt "X") " is a vector of length " (tt "(1 + (n - 1) * abs(INCX))") ". "))) (subsubsection "Triangular matrix equation solve" (procedure "blas:strsv:: ORDER * UPLO * TRANS * DIAG * N * ALPHA * A * B * [LDA * INCB] -> F32VECTOR " (procedure "blas:dtrsv:: ORDER * UPLO * TRANS * DIAG * N * A * B * [LDA * INCB] -> F64VECTOR ") (procedure "blas:ctrsv:: ORDER * UPLO * TRANS * DIAG * N * A * B * [LDA * INCB] -> F32VECTOR ") (procedure "blas:ztrsv:: ORDER * UPLO * TRANS * DIAG * N * A * B * [LDA * INCB] -> F64VECTOR ") (p (tt "xTRSV") " solves one of the systems of equations " (tt "A*x = b") " or " (tt "A'*x = b") ". ") (p (tt "ALPHA") " and " (tt "BETA") " are scalars, " (tt "A") " is a upper or lower " "triangular matrix, and " (tt "B") " is a " (tt "N") " element vector. "))) (subsubsection "Banded triangular matrix equation solve" (procedure "blas:stbsv:: ORDER * UPLO * TRANS * DIAG * N * K * A * B * [LDA * INCB] -> F32VECTOR " (procedure "blas:dtbsv:: ORDER * UPLO * TRANS * DIAG * N * K * A * B * [LDA * INCB] -> F64VECTOR ") (procedure "blas:ctbsv:: ORDER * UPLO * TRANS * DIAG * N * K * A * B * [LDA * INCB] -> F32VECTOR ") (procedure "blas:ztbsv:: ORDER * UPLO * TRANS * DIAG * N * K * A * B * [LDA * INCB] -> F64VECTOR ") (p (tt "xTBSV") " solves one of the systems of equations " (tt "A*x = b") " or " (tt "A'*x = b") ". ") (p (tt "ALPHA") " and " (tt "BETA") " are scalars, " (tt "A") " is a upper or lower " "banded triangular matrix with " (tt "K+1") " diagonals, " "and " (tt "B") " is a " (tt "N") " element vector. "))) (subsubsection "Rank 1 operation" (procedure "blas:sger:: ORDER * M * N * ALPHA * X * Y * A [LDA * INCX * INCY] -> F32VECTOR " (procedure "blas:dger:: ORDER * M * N * ALPHA * X * Y * A [LDA * INCX * INCY] -> F64VECTOR ") (p (tt "xGER") " performs the rank 1 operation " (tt "A := alpha*x*y' + A") ". ") (p (tt "ALPHA") " is a scalar, " (tt "X") " is an " (tt "M") " element vector, " (tt "Y") " is an " (tt "N") " element vector, and " (tt "A") " is an " (tt "M x N") " matrix. "))) (subsubsection "Rank 1 operation with optional offset" (procedure "blas:siger:: ORDER * M * N * ALPHA * X * Y * A [LDA * INCX * INCY * XOFS * YOFS] -> F32VECTOR " (procedure "blas:diger:: ORDER * M * N * ALPHA * X * Y * A [LDA * INCX * INCY * XOFS * YOFS] -> F64VECTOR ") (p (tt "xIGER") " performs the rank 1 operation " (tt "A := alpha*x[xofs:M]*y'[yofs:N] + A") ". ") (p (tt "ALPHA") " is a scalar, " (tt "X") " is an " (tt "M") " element vector, " (tt "Y") " is an " (tt "N") " element vector, and " (tt "A") " is an " (tt "M x N") " matrix. "))) (subsubsection "Rank 1 operation on complex matrices and vectors" (procedure "blas:cgeru:: ORDER * M * N * ALPHA * X * Y * A [LDA * INCX * INCY] -> F32VECTOR " (procedure "blas:zgeru:: ORDER * M * N * ALPHA * X * Y * A [LDA * INCX * INCY] -> F64VECTOR ") (p (tt "xGERU") " performs the rank 1 operation " (tt "A := alpha*x*y' + A") ". ") (p (tt "ALPHA") " is a scalar, " (tt "X") " is an " (tt "M") " element vector, " (tt "Y") " is an " (tt "N") " element vector, and " (tt "A") " is an " (tt "M x N") " matrix. "))) (subsubsection "Rank 1 operation on complex matrices and vectors" (procedure "blas:cgerc:: ORDER * M * N * ALPHA * X * Y * A [LDA * INCX * INCY] -> F32VECTOR " (procedure "blas:zgerc:: ORDER * M * N * ALPHA * X * Y * A [LDA * INCX * INCY] -> F64VECTOR ") (p (tt "xGERC") " performs the rank 1 operation " (tt "A := alpha*x*conjg(y') + A") ". ") (p (tt "ALPHA") " is a scalar, " (tt "X") " is an " (tt "M") " element vector, " (tt "Y") " is an " (tt "N") " element vector, and " (tt "A") " is an " (tt "M x N") " matrix. "))) (subsubsection "Hermitian rank 1 operation" (procedure "blas:cher:: ORDER * UPLO * N * ALPHA * X * A [LDA * INCX] -> F32VECTOR " (procedure "blas:zher:: ORDER * UPLO * N * ALPHA * X * A [LDA * INCX] -> F64VECTOR ") (p (tt "xHER") " performs the Hermitian rank 1 operation " (tt "A := alpha*x*conjg(x') + A") ". ") (p (tt "ALPHA") " is a scalar, " (tt "X") " is an " (tt "N") " element vector, " "and " (tt "A") " is an " (tt "N x N") " Hermitian matrix. "))) (subsubsection "Hermitian rank 2 operation" (procedure "blas:cher2:: ORDER * UPLO * N * ALPHA * X * Y * A [LDA * INCX * INCY] -> F32VECTOR " (procedure "blas:zher2:: ORDER * UPLO * N * ALPHA * X * Y * A [LDA * INCX * INCY] -> F64VECTOR ") (p (tt "xHER2") " performs the Hermitian rank 2 operation " (tt "A := alpha*x*conjg(y') + conjg(alpha)*y*conjg(x') + A") ". ") (p (tt "ALPHA") " is a scalar, " (tt "X") " and " (tt "Y") " are " (tt "N") " element vectors, " "and " (tt "A") " is an " (tt "N x N") " Hermitian matrix. "))) (subsubsection "Symmetric rank 1 operation" (procedure "blas:ssyr:: ORDER * UPLO * N * ALPHA * X * A [LDA * INCX] -> F32VECTOR " (procedure "blas:dsyr:: ORDER * UPLO * N * ALPHA * X * A [LDA * INCX] -> F64VECTOR ") (p (tt "xSYR") " performs the symmetric rank 1 operation " (tt "A := alpha*x*x' + A") ". ") (p (tt "ALPHA") " is a scalar, " (tt "X") " is an " (tt "N") " element vector, " "and " (tt "A") " is an " (tt "N x N") " symmetric matrix. "))) (subsubsection "Symmetric rank 2 operation" (procedure "blas:ssyr2:: ORDER * UPLO * N * ALPHA * X * Y * A [LDA * INCX * INCY] -> F32VECTOR " (procedure "blas:dsyr2:: ORDER * UPLO * N * ALPHA * X * Y * A [LDA * INCX * INCY] -> F64VECTOR ") (p (tt "xSYR2") " performs the symmetric rank 2 operation " (tt "A := alpha*x*y' + alpha*y*x' + A") ". ") (p (tt "ALPHA") " is a scalar, " (tt "X") " and " (tt "Y") " are " (tt "N") " element vectors, " "and " (tt "A") " is an " (tt "N x N") " symmetric matrix. "))) ) (subsection "BLAS level 3 routines" (subsection "Conventions" (p "The BLAS level 3 procedures in this egg differ from the actual routines " "they invoke by the position of the leading dimension arguments (" (tt "LDA") ", " (tt "LDB") ", and " (tt "LDC") "). " "In this egg, these arguments are optional, and their default values " "are set to the largest matrix dimension, depending on the semantics " "of the respective operation. ") (p "In the procedure signatures below, these optional arguments are indicated " "by [ and ] (square brackets). ") (p "Argument " (tt "ORDER") " is one of " (tt "blas:RowMajor") " or " (tt "blas:ColMajor") " to indicate that the input and output matrices " "are in row-major or column-major form, respectively. ") (p "Where present, arguments " (tt "TRANS") ", " (tt "TRANSA") ", " (tt "TRANSB") " can be one of " (tt "blas:NoTrans") " or " (tt "blas:Trans") " to indicate whether the respective input matrices are to be transposed or not. ") (p "Where present, argument " (tt "SIDE") " can be one of " (tt "blas:Left") " or " (tt "blas:Right") " to indicate whether an " "input symmetric matrix appears on the left or right in the respective operation. ") (p "Where present, argument " (tt "UPLO") " can be one of " (tt "blas:Upper") " or " (tt "blas:Lower") " to indicate whether the " "upper or lower triangular part of an input symmetric matrix is to referenced," "or to specify the type of an input triangular matrix.") (p "Where present, argument " (tt "DIAG") " can be one of " (tt "blas:NonUnit") " or " (tt "blas:Unit") " to indicate whether " "an input triangular matrix is unit triangular or not.") ) (subsubsection "General matrix multiply-add" (procedure "blas:sgemm:: ORDER * TRANSA * TRANSB * M * N * K * ALPHA * A * B * BETA * C [LDA * LDB * LDC] -> F32VECTOR " (procedure "blas:dgemm:: ORDER * TRANSA * TRANSB * M * N * K * ALPHA * A * B * BETA * C [LDA * LDB * LDC] -> F64VECTOR ") (procedure "blas:cgemm:: ORDER * TRANSA * TRANSB * M * N * K * ALPHA * A * B * BETA * C [LDA * LDB * LDC] -> F32VECTOR ") (procedure "blas:zgemm:: ORDER * TRANSA * TRANSB * M * N * K * ALPHA * A * B * BETA * C [LDA * LDB * LDC] -> F64VECTOR ") (p (tt "xGEMM") " performs matrix-matrix multiply-add operation of the form " (tt "C := alpha*op( A )*op( B ) + beta*C") ", where " (tt "op( X )") " is " "one of " (tt "op( X ) = X") " or " (tt "op( X ) = X'") ". ") (p (tt "ALPHA") " and " (tt "BETA") " are scalars, and " (tt "A") ", " (tt "B") " and " (tt "C") " are matrices, with " (tt "op( A )") " an " (tt "M x K") " matrix, " (tt "op( B )") " a " (tt "K x N") " matrix and " (tt "C") " an " (tt "M x N") " matrix. "))) (subsubsection "Symmetric matrix multiply-add" (procedure "blas:ssymm:: ORDER * SIDE * UPLO * M * N * ALPHA * A * B * BETA * C [LDA * LDB * LDC] -> F32VECTOR " (procedure "blas:dsymm:: ORDER * SIDE * UPLO * M * N * ALPHA * A * B * BETA * C [LDA * LDB * LDC] -> F64VECTOR ") (procedure "blas:csymm:: ORDER * SIDE * UPLO * M * N * ALPHA * A * B * BETA * C [LDA * LDB * LDC] -> F32VECTOR ") (procedure "blas:zsymm:: ORDER * SIDE * UPLO * M * N * ALPHA * A * B * BETA * C [LDA * LDB * LDC] -> F64VECTOR ") (p (tt "xSYMM") " performs matrix-matrix multiply-add operation of the form " (tt "C := alpha*A*B + beta*C") " or " (tt "C := alpha*B*A + beta*C") ". ") (p (tt "ALPHA") " and " (tt "BETA") " are scalars, " (tt "A") " is a symmetric matrix, " "and " (tt "B") " and " (tt "C") " are " (tt "M x N") " matrices. "))) (subsubsection "Symmetric rank k operation" (procedure "blas:ssyrk:: ORDER * UPLO * TRANS * N * K * ALPHA * A * BETA * C [LDA * LDB * LDC] -> F32VECTOR " (procedure "blas:dsyrk:: ORDER * UPLO * TRANS * N * K * ALPHA * A * BETA * C [LDA * LDB * LDC] -> F64VECTOR ") (procedure "blas:csyrk:: ORDER * UPLO * TRANS * N * K * ALPHA * A * BETA * C [LDA * LDB * LDC] -> F64VECTOR ") (procedure "blas:zsyrk:: ORDER * UPLO * TRANS * N * K * ALPHA * A * BETA * C [LDA * LDB * LDC] -> F64VECTOR ") (p (tt "xSYRK") " performs one of the symmetric rank k operations " (tt "C := alpha*A*A' + beta*C") " or " (tt "C := alpha*A'*A + beta*C") ". ") (p (tt "ALPHA") " and " (tt "BETA") " are scalars, " (tt "A") " is an " (tt "N x K") " or " (tt "K x N") " matrix, and " (tt "C") " is an " (tt "N x N") " symmetric matrix. "))) (subsubsection "Hermitian rank k operation" (procedure "blas:cherk:: ORDER * UPLO * TRANS * N * K * ALPHA * A * BETA * C [LDA * LDB * LDC] -> F32VECTOR " (procedure "blas:zherk:: ORDER * UPLO * TRANS * N * K * ALPHA * A * BETA * C [LDA * LDB * LDC] -> F64VECTOR ") (p (tt "xHERK") " performs one of the hermitian rank k operations " (tt "C := alpha*A*conjg(A') + beta*C") " or " (tt "C := alpha*conjg(A')*A + beta*C") ". ") (p (tt "ALPHA") " and " (tt "BETA") " are scalars, " (tt "A") " is an " (tt "N x K") " or " (tt "K x N") " matrix, and " (tt "C") " is an " (tt "N x N") " hermitian matrix. "))) (subsubsection "Symmetric rank 2k operation" (procedure "blas:ssyr2k:: ORDER * UPLO * TRANS * N * K * ALPHA * A * B * BETA * C [LDA * LDB * LDC] -> F32VECTOR " (procedure "blas:dsyr2k:: ORDER * UPLO * TRANS * N * K * ALPHA * A * B * BETA * C [LDA * LDB * LDC] -> F64VECTOR ") (procedure "blas:csyr2k:: ORDER * UPLO * TRANS * N * K * ALPHA * A * B * BETA * C [LDA * LDB * LDC] -> F64VECTOR ") (procedure "blas:zsyr2k:: ORDER * UPLO * TRANS * N * K * ALPHA * A * B * BETA * C [LDA * LDB * LDC] -> F64VECTOR ") (p (tt "xSYR2K") " performs one of the symmetric rank 2k operations " (tt "C := alpha*A*B' + beta*C") " or " (tt "C := alpha*B'*A + beta*C") ". ") (p (tt "ALPHA") " and " (tt "BETA") " are scalars, " (tt "A") " and " (tt "B") " are " (tt "N x K") " or " (tt "K x N") " matrices, and " (tt "C") " is an " (tt "N x N") " symmetric matrix. "))) (subsubsection "Hermitian rank 2k operation" (procedure "blas:cher2k:: ORDER * UPLO * TRANS * N * K * ALPHA * A * B * BETA * C [LDA * LDB * LDC] -> F32VECTOR " (procedure "blas:zher2k:: ORDER * UPLO * TRANS * N * K * ALPHA * A * B * BETA * C [LDA * LDB * LDC] -> F64VECTOR ") (p (tt "xHER2K") " performs one of the hermitian rank 2k operations " (tt "C := alpha*A*conjg(B') + beta*C") " or " (tt "C := alpha*conjg(B')*A + beta*C") ". ") (p (tt "ALPHA") " and " (tt "BETA") " are scalars, " (tt "A") " and " (tt "B") " are " (tt "N x K") " or " (tt "K x N") " matrices, and " (tt "C") " is an " (tt "N x N") " hermitian matrix. "))) (subsubsection "Triangular matrix multiply" (procedure "blas:strmm:: ORDER * SIDE * UPLO * TRANSA * DIAG * M * N * ALPHA * A * B [LDA * LDB] -> F32VECTOR " (procedure "blas:dtrmm:: ORDER * SIDE * UPLO * TRANSA * DIAG * M * N * ALPHA * A * B [LDA * LDB] -> F64VECTOR ") (procedure "blas:ctrmm:: ORDER * SIDE * UPLO * TRANSA * DIAG * M * N * ALPHA * A * B [LDA * LDB] -> F32VECTOR ") (procedure "blas:ztrmm:: ORDER * SIDE * UPLO * TRANSA * DIAG * M * N * ALPHA * A * B [LDA * LDB] -> F64VECTOR ") (p (tt "xTRMM") " performs matrix-matrix multiply operation of the form " (tt "B := alpha*op( A )*B") " or " (tt "B := alpha*B*op( A )") ". ") (p (tt "ALPHA") " is a scalar, " (tt "A") " is an upper or lower triangular matrix, " "and " (tt "B") " is an " (tt "M x N") " matrix. "))) (subsubsection "Triangular matrix equation solve" (procedure "blas:strsm:: ORDER * SIDE * UPLO * TRANSA * DIAG * M * N * ALPHA * A * B * [LDA * LDB * LDC] -> F32VECTOR " (procedure "blas:dtrsm:: ORDER * SIDE * UPLO * TRANSA * DIAG * M * N * ALPHA * A * B * [LDA * LDB * LDC] -> F64VECTOR ") (procedure "blas:ctrsm:: ORDER * SIDE * UPLO * TRANSA * DIAG * M * N * ALPHA * A * B * [LDA * LDB * LDC] -> F32VECTOR ") (procedure "blas:ztrsm:: ORDER * SIDE * UPLO * TRANSA * DIAG * M * N * ALPHA * A * B * [LDA * LDB * LDC] -> F64VECTOR ") (p (tt "xTRSM") " solves one of the matrix equations " (tt "op( A )*X = alpha*B") " or " (tt "X*op( A ) = alpha*B") ". ") (p (tt "op( A )") " is one of " (tt "op( A ) = A") " or " (tt "op( A ) = A'") ". ") (p (tt "ALPHA") " and " (tt "BETA") " are scalars, " (tt "A") " is a upper or lower " "triangular matrix, and " (tt "B") " is a " (tt "M x N") " matrix. "))) )) (examples (pre #<html doc) (void))