;; ;; ;; atlas-lapack documentation for the Chicken Scheme module system. ;; (use eggdoc) (define doc `((eggdoc:begin (name "atlas-lapack") (description "An interface to the LAPACK routines implemented in ATLAS.") (author (url "http://chicken.wiki.br/users/ivan-raikov" "Ivan Raikov")) (history (version "1.11" "Ported to Chicken 4") (version "1.10" "Bug fix in the detection of ATLAS library") (version "1.9" "Added build system support for libraries linked with f2c") (version "1.8" "Build script updated for better cross-platform compatibility") (version "1.7" "Fixed a bug in the trtri interface") (version "1.6" "Changed matrix copying code to use BLAS routines instead of object-copy") (version "1.5" "License upgrade to GPL v3") (version "1.4" "Added -latlas to the compiler options in the setup script") (version "1.3" "Minor changes in the setup script") (version "1.2" "Bug fix in the setup script") (version "1.1" "Created safe/unsafe variants of each routine, added optional leading dimensions") (version "1.0" "Initial release")) (requires (url "blas.html" "blas")) (usage "(require-extension atlas-lapack)") (download "atlas-lapack.egg") (documentation (p (url "http://math-atlas.sourceforge.net/" "ATLAS") " " "stands for Automatically Tuned Linear Algebra Software. " "Its purpose is to provide portably optimal linear algebra routines. The current version provides a complete " (url "http://www.netlib.org/blas" "BLAS") " API (for both C and Fortran77), and a very small subset of the " (url "http://www.netlib.org/lapack" "LAPACK") " API. " "Please see the documentation for the " (url "blas.html" "blas") " egg for definitions of the ORDER, UPLO, DIAG and TRANSPOSE datatypes.") (subsection "Naming conventions for routines" (p "Every routine in the LAPACK 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 ATLAS-LAPACK routine in this egg comes in three flavors: " (ol (li "Safe, pure (prefix: " (b "atlas-lapack:") ")" (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 "atlas-lapack:") ", 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. " "The matrix factorization routines in LAPACK overwrite the input matrix argument " "with the result of the factorization, and the linear system solvers overwrite " "the right-hand side vector with the system solution. " "Please consult the LAPACK documentation to determine which functions modify " "their input arguments. ")) (li "Unsafe, destructive (prefix: " (b "unsafe-atlas-lapack:") ", suffix: !)" (p (i "Unsafe") " routines do not check the sizes of their input arguments. " "They invoke the corresponding ATLAS-LAPACK routines directly. " "Unsafe routines do not have pure variants. ")))) (p "For example, function " (i "xGESV") " (N-by-N linear system solver) " "comes in the following variants: " (table (tr (th (b "LAPACK name")) (th (b "Safe, pure")) (th (b "Safe, destructive")) (th (b "Unsafe, destructive"))) (tr (td (i "SGESV")) (td (i "atlas-lapack:sgesv")) (td (i "atlas-lapack:sgesv!")) (td (i "unsafe-atlas-lapack:sgesv!"))) (tr (td (i "DGESV")) (td (i "atlas-lapack:dgesv")) (td (i "atlas-lapack:dgesv!")) (td (i "unsafe-atlas-lapack:dgesv!"))) (tr (td (i "CGESV")) (td (i "atlas-lapack:cgesv")) (td (i "atlas-lapack:cgesv!")) (td (i "unsafe-atlas-lapack:cgesv!"))) (tr (td (i "ZGESV")) (td (i "atlas-lapack:zgesv")) (td (i "atlas-lapack:zgesv!")) (td (i "unsafe-atlas-lapack:zgesv!")))))) (subsection "LAPACK driver routines" (subsubsection "General linear system solving" (procedure "atlas-lapack:sgesv:: ORDER * N * NRHS * A * B * [LDA] * [LDB] -> F32VECTOR * F32VECTOR * S32VECTOR" (procedure "atlas-lapack:dgesv:: ORDER * N * NRHS * A * B * [LDA] * [LDB] -> F64VECTOR * F64VECTOR * S32VECTOR") (procedure "atlas-lapack:cgesv:: ORDER * N * NRHS * A * B * [LDA] * [LDB] -> F32VECTOR * F32VECTOR * S32VECTOR") (procedure "atlas-lapack:zgesv:: ORDER * N * NRHS * A * B * [LDA] * [LDB] -> F64VECTOR * F64VECTOR * S32VECTOR") (p "The routines compute the solution to a system of linear equations " (i "A * X = B") ", where " (i "A") " is an N-by-N matrix and " (i "X") " and " (i "B") " are N-by-NRHS matrices. " "Optional arguments " (i "LDA") " and " (i "LDB") " are the leading dimensions of arrays " (i "A") " and " (i "B") ", respectively. " "LU decomposition with partial pivoting and row interchanges " "is used to factor " (i "A") " as " (i "A = P * L * U") ", " "where " (i "P") " is a permutation matrix, " (i "L") " is unit lower triangular, and " (i "U") " is upper triangular. " "The factored form of " (i "A") " is then used to solve the system. " "The return values are: " (ol (li "a matrix containing the factors " (i "L") " and " (i "U") " from the factorization " (i "A = P*L*U") "; " ) (li "the N-by-NRHS solution matrix " (i "X")) (li " a vector with pivot indices: for 1 <= i <= min(M,N), " "row " (i "i") " of the matrix " (i "A") " was interchanged with " "row pivot(" (i "i") ")"))))) (subsubsection "Symmetric positive definite linear system solving" (procedure "atlas-lapack:sposv:: ORDER * UPLO * N * NRHS * A * B * [LDA] * [LDB] -> F32VECTOR * F32VECTOR" (procedure "atlas-lapack:dposv:: ORDER * UPLO * N * NRHS * A * B * [LDA] * [LDB] -> F64VECTOR * F64VECTOR") (procedure "atlas-lapack:cposv:: ORDER * UPLO * N * NRHS * A * B * [LDA] * [LDB] -> F32VECTOR * F32VECTOR") (procedure "atlas-lapack:zposv:: ORDER * UPLO * N * NRHS * A * B * [LDA] * [LDB] -> F64VECTOR * F64VECTOR") (p "The routines compute the solution to a system of linear equations " (i "A * X = B") ", where " (i "A") " is an N-by-N symmetric positive definite matrix and " (i "X") " and " (i "B") " are N-by-NRHS matrices. " "Optional arguments " (i "LDA") " and " (i "LDB") " are the leading dimensions of arrays " (i "A") " and " (i "B") ", respectively. " "Cholesky decomposition is used to factor " (i "A") " as " (ul (li (i "A = U**T * U") " if UPLO = " (b "blas:Upper")) (li (i "A = L * L**T") " if UPLO = " (b "blas:Lower"))) "where " (i "U") " is an upper triangular, and " (i "L") " is a lower triangular matrix. " "The factored form of " (i "A") " is then used to solve the system. " "The return values are: " (ol (li "the factor " (i "U") " or " (i "L") "from the Cholesky factorization, " "depending on the value of argument UPLO.") (li "the N-by-NRHS solution matrix " (i "X"))))))) (subsection "LAPACK computational routines" (subsubsection "General matrix factorization" (procedure "atlas-lapack:sgetrf:: ORDER * M * N * A * [LDA] -> F32VECTOR * S32VECTOR" (procedure "atlas-lapack:dgetrf:: ORDER * M * N * A * [LDA] -> F64VECTOR * S32VECTOR") (procedure "atlas-lapack:cgetrf:: ORDER * M * N * A * [LDA] -> F32VECTOR * S32VECTOR") (procedure "atlas-lapack:zgetrf:: ORDER * M * N * A * [LDA] -> F64VECTOR * S32VECTOR") (p "These routines compute an LU factorization of a general M-by-N matrix " (i "A") " using partial pivoting with row interchanges. " "Optional argument " (i "LDA") " is the leading dimension of array " (i "A") ". " "The return values are: " (ol (li "a matrix containing the factors " (i "L") " and " (i "U") " from the factorization " (i "A = P*L*U") "; " ) (li " a vector with pivot indices: for 1 <= i <= min(M,N), " "row " (i "i") " of the matrix was interchanged with " "row pivot(" (i "i") ")"))))) (subsubsection "General linear system solving using factorization" (procedure "atlas-lapack:sgetrs:: ORDER * TRANSPOSE * N * NRHS * A * B * [LDA] * [LDB] -> F32VECTOR" (procedure "atlas-lapack:dgetrs:: ORDER * TRANSPOSE * N * NRHS * A * B * [LDA] * [LDB] -> F64VECTOR") (procedure "atlas-lapack:cgetrs:: ORDER * TRANSPOSE * N * NRHS * A * B * [LDA] * [LDB] -> F32VECTOR") (procedure "atlas-lapack:zgetrs:: ORDER * TRANSPOSE * N * NRHS * A * B * [LDA] * [LDB] -> F64VECTOR") (p "These routines solve a system of linear equations " (i "A * X = B") " or " (i "A' * X = B") " with a general N-by-N matrix " (i "A") " using the LU factorization computed by the xGETRF routines. " "Argument " (i "NRHS") " is the number of right-hand sides " "(i.e. number of columns in " (i "B") "). " "Optional arguments " (i "LDA") " and " (i "LDB") " are the leading dimensions of arrays " (i "A") " and " (i "B") ", respectively. " "The return value is the solution matrix " (i "X") "."))) (subsubsection "General matrix invert using factorization" (procedure "atlas-lapack:sgetri:: ORDER * N * A * PIVOT * [LDA] -> F32VECTOR" (procedure "atlas-lapack:dgetri:: ORDER * N * A * PIVOT * [LDA] -> F64VECTOR") (procedure "atlas-lapack:cgetri:: ORDER * N * A * PIVOT * [LDA] -> F32VECTOR") (procedure "atlas-lapack:zgetri:: ORDER * N * A * PIVOT * [LDA] -> F64VECTOR") (p "These routines compute the inverse of a matrix " "using the LU factorization computed by the xGETRF routines. " "Argument " (i "A") " must contain the factors L and U from the " "LU factorization computed by xGETRF. Argument " (i "PIVOT") " must be " "the pivot vector returned by the factorization routine. " "Optional argument " (i "LDA") " is the leading dimension of array " (i "A") ". " "The return value is the inverse of the original matrix " (i "A") "."))) (subsubsection "Symmetric positive definite matrix factorization" (procedure "atlas-lapack:spotrf:: ORDER * UPLO * N * A * [LDA] -> F32VECTOR" (procedure "atlas-lapack:dpotrf:: ORDER * UPLO * N * A * [LDA] -> F64VECTOR") (procedure "atlas-lapack:cpotrf:: ORDER * UPLO * N * A * [LDA] -> F32VECTOR") (procedure "atlas-lapack:zpotrf:: ORDER * UPLO * N * A * [LDA] -> F64VECTOR") (p "These routines compute the Cholesky factorization of a " "symmetric positive definite matrix " (i "A") ". " "The factorization has the form: " (ul (li (i "A = U**T * U") " if UPLO = " (b "blas:Upper")) (li (i "A = L * L**T") " if UPLO = " (b "blas:Lower"))) "where " (i "U") " is an upper triangular, and " (i "L") " is a lower triangular matrix. " "Optional argument " (i "LDA") " is the leading dimension of array " (i "A") ". " "The return value is the factor " (i "U") " or " (i "L") "from the Cholesky factorization, " "depending on the value of argument UPLO."))) (subsubsection "Symmetric positive definite matrix solving using factorization" (procedure "atlas-lapack:spotrs:: ORDER * UPLO * N * NRHS * A * B * [LDA] * [LDB] -> F32VECTOR" (procedure "atlas-lapack:dpotrs:: ORDER * UPLO * N * NRHS * A * B * [LDA] * [LDB] -> F64VECTOR") (procedure "atlas-lapack:cpotrs:: ORDER * UPLO * N * NRHS * A * B * [LDA] * [LDB] -> F32VECTOR") (procedure "atlas-lapack:zpotrs:: ORDER * UPLO * N * NRHS * A * B * [LDA] * [LDB] -> F64VECTOR") (p "These routines solve a system of linear equations " (i "A * X = B") " with a symmetric positive definite matrix " (i "A") " using the Cholesky factorization computed by the xPOTRF routines. " "Argument " (i "A") " is the triangular factor " (i "U") " or " (i "L") " as computed by xPOTRF. " "Argument " (i "NRHS") " is the number of right-hand sides " "(i.e. number of columns in " (i "B") "). " "Argument UPLO indicates whether upper or lower triangle of A is stored " "(" (b "blas:Upper") " or " (b "blas:Lower") "). " "Optional arguments " (i "LDA") " and " (i "LDB") " are the leading dimensions of arrays " (i "A") " and " (i "B") ", respectively. " "The return value is the solution matrix " (i "X") "."))) (subsubsection "Symmetric positive definite matrix invert using factorization" (procedure "atlas-lapack:spotri:: ORDER * UPLO * N * A * [LDA] -> F32VECTOR" (procedure "atlas-lapack:dpotri:: ORDER * UPLO * N * A * [LDA] -> F64VECTOR") (procedure "atlas-lapack:cpotri:: ORDER * UPLO * N * A * [LDA] -> F32VECTOR") (procedure "atlas-lapack:zpotri:: ORDER * UPLO * N * A * [LDA] -> F64VECTOR") (p "These routines compute the inverse of a symmetric positive definite " "matrix " (i "A") " using the Cholesky factorization " (i "A = U**T*U") " or " (i "A = L*L**T") " computed by xPOTRF. " "Argument " (i "A") " is the triangular factor " (i "U") " or " (i "L") " as computed by xPOTRF. " "Argument UPLO indicates whether upper or lower triangle of A is stored " "(" (b "blas:Upper") " or " (b "blas:Lower") "). " "Optional argument " (i "LDA") " is the leading dimension of array " (i "A") ". " "The return value is the upper or lower triangle of the inverse of " (i "A") "."))) (subsubsection "Triangular matrix invert" (procedure "atlas-lapack:strtri:: ORDER * UPLO * DIAG * N * A * [LDA] -> F32VECTOR" (procedure "atlas-lapack:dtrtri:: ORDER * UPLO * DIAG * N * A * [LDA] -> F64VECTOR") (procedure "atlas-lapack:ctrtri:: ORDER * UPLO * DIAG * N * A * [LDA] -> F32VECTOR") (procedure "atlas-lapack:ztrtri:: ORDER * UPLO * DIAG * N * A * [LDA] -> F64VECTOR") (p "These routines compute the inverse of a triangular matrix " (i "A") ". " "Argument " (i "A") " is the triangular factor " (i "U") " or " (i "L") " as computed by xPOTRF. " "Argument UPLO indicates whether upper or lower triangle of A is stored " "(" (b "blas:Upper") " or " (b "blas:Lower") "). " "Argument DIAG indicates whether A is non-unit triangular or " "unit triangular " "(" (b "blas:NonUnit") " or " (b "blas:Unit") "). " "Optional argument " (i "LDA") " is the leading dimension of array " (i "A") ". " "The return value is the triangular inverse of the input matrix, " "in the same storage format."))) (subsubsection "Auxilliary routines" (procedure "atlas-lapack:slauum:: ORDER * UPLO * DIAG * N * A * [LDA] -> F32VECTOR" (procedure "atlas-lapack:dlauum:: ORDER * UPLO * DIAG * N * A * [LDA] -> F64VECTOR") (procedure "atlas-lapack:clauum:: ORDER * UPLO * DIAG * N * A * [LDA] -> F32VECTOR") (procedure "atlas-lapack:zlauum:: ORDER * UPLO * DIAG * N * A * [LDA] -> F64VECTOR") (p "These routines compute the product " (i "U * U'") " or " (i "L' * L") ", where the triangular factor " (i "U") " or " (i "L") " is stored in the upper or lower triangular part of the array " (i "A") ". " "Argument UPLO indicates whether upper or lower triangle of A is stored " "(" (b "blas:Upper") " or " (b "blas:Lower") "). " "Optional argument " (i "LDA") " is the leading dimension of array " (i "A") ". " "The return value is the lower triangle of the lower triangular product, " " or the upper triangle of upper triangular product, " "in the respective storage format."))) )) (examples (pre #<.")))) (if (eggdoc->html doc) (void))