BLAS

Overview

The vecLib framework contains nine C header files (not counting vecLib.h which merely includes the others).

This document describes the functions declared in the header files cblas.h and vblas.h, which contain the interfaces for Apple’s implementation of the Basic Linear Algebra Subprograms (BLAS) API.

For More Information

Documentation on the BLAS standard, including reference implementations, can be found on the web starting from the BLAS FAQ page at these URLs (verified live as of July 2005): http://www.netlib.org/blas/faq.html and http://www.netlib.org/blas/blast-forum/blast-forum.html

Symbols

General Functions

func cblas_icamax(Int32, UnsafeRawPointer!, Int32)

Returns the index of the element with the largest absolute value in a vector (single-precision complex).

func cblas_idamax(Int32, UnsafePointer<Double>!, Int32)

Returns the index of the element with the largest absolute value in a vector (double-precision).

func cblas_isamax(Int32, UnsafePointer<Float>!, Int32)

Returns the index of the element with the largest absolute value in a vector (single-precision).

func cblas_izamax(Int32, UnsafeRawPointer!, Int32)

Returns the index of the element with the largest absolute value in a vector (double-precision complex).

CATLAS and CBLAS Vector Functions

func catlas_caxpby(Int32, UnsafeRawPointer!, UnsafeRawPointer!, Int32, UnsafeRawPointer!, UnsafeMutableRawPointer!, Int32)

Computes the product of two vectors, scaling each one separately (single-precision complex).

func catlas_cset(Int32, UnsafeRawPointer!, UnsafeMutableRawPointer!, Int32)

Modifies a vector (single-precision complex) in place, setting each element to a given value.

func catlas_daxpby(Int32, Double, UnsafePointer<Double>!, Int32, Double, UnsafeMutablePointer<Double>!, Int32)

Computes the sum of two vectors, scaling each one separately (double-precision).

func catlas_dset(Int32, Double, UnsafeMutablePointer<Double>!, Int32)

Modifies a vector (double-precision) in place, setting each element to a given value.

func catlas_saxpby(Int32, Float, UnsafePointer<Float>!, Int32, Float, UnsafeMutablePointer<Float>!, Int32)

Computes the sum of two vectors, scaling each one separately (single-precision).

func catlas_sset(Int32, Float, UnsafeMutablePointer<Float>!, Int32)

Modifies a vector (single-precision) in place, setting each element to a given value.

func catlas_zaxpby(Int32, UnsafeRawPointer!, UnsafeRawPointer!, Int32, UnsafeRawPointer!, UnsafeMutableRawPointer!, Int32)

Computes the sum of two vectors, scaling each one separately (double-precision complex).

func catlas_zset(Int32, UnsafeRawPointer!, UnsafeMutableRawPointer!, Int32)

Modifies a vector (double-precision complex) in place, setting each element to a given value.

func cblas_sdot(Int32, UnsafePointer<Float>!, Int32, UnsafePointer<Float>!, Int32)

Computes the dot product of two vectors (single-precision).

func cblas_sdsdot(Int32, Float, UnsafePointer<Float>!, Int32, UnsafePointer<Float>!, Int32)

Computes the dot product of two single-precision vectors plus an initial single-precision value.

func cblas_cdotc_sub(Int32, UnsafeRawPointer!, Int32, UnsafeRawPointer!, Int32, UnsafeMutableRawPointer!)

Calculates the dot product of the complex conjugate of a single-precision complex vector with a second single-precision complex vector.

func cblas_ddot(Int32, UnsafePointer<Double>!, Int32, UnsafePointer<Double>!, Int32)

Computes the dot product of two vectors (double-precision).

func cblas_dsdot(Int32, UnsafePointer<Float>!, Int32, UnsafePointer<Float>!, Int32)

Computes the double-precision dot product of a pair of single-precision vectors.

func cblas_zdotc_sub(Int32, UnsafeRawPointer!, Int32, UnsafeRawPointer!, Int32, UnsafeMutableRawPointer!)

Calculates the dot product of the complex conjugate of a double-precision complex vector with a second double-precision complex vector.

Single-Precision Float Matrix Functions

func cblas_sasum(Int32, UnsafePointer<Float>!, Int32)

Computes the sum of the absolute values of elements in a vector (single-precision).

func cblas_saxpy(Int32, Float, UnsafePointer<Float>!, Int32, UnsafeMutablePointer<Float>!, Int32)

Computes a constant times a vector plus a vector (single-precision).

func cblas_snrm2(Int32, UnsafePointer<Float>!, Int32)

Computes the L2 norm (Euclidian length) of a vector (single precision).

func cblas_sscal(Int32, Float, UnsafeMutablePointer<Float>!, Int32)

Multiplies each element of a vector by a constant (single-precision).

func cblas_sspmv(CBLAS_ORDER, CBLAS_UPLO, Int32, Float, UnsafePointer<Float>!, UnsafePointer<Float>!, Int32, Float, UnsafeMutablePointer<Float>!, Int32)

Scales a packed symmetric matrix, then multiplies by a vector, then scales and adds another vector (single precision).

func cblas_sspr(CBLAS_ORDER, CBLAS_UPLO, Int32, Float, UnsafePointer<Float>!, Int32, UnsafeMutablePointer<Float>!)

Rank one update: adds a packed symmetric matrix to the product of a scaling factor, a vector, and its transpose (single precision).

func cblas_ssymv(CBLAS_ORDER, CBLAS_UPLO, Int32, Float, UnsafePointer<Float>!, Int32, UnsafePointer<Float>!, Int32, Float, UnsafeMutablePointer<Float>!, Int32)

Scales a symmetric matrix, multiplies by a vector, then scales and adds another vector (single precision).

func cblas_ssyr(CBLAS_ORDER, CBLAS_UPLO, Int32, Float, UnsafePointer<Float>!, Int32, UnsafeMutablePointer<Float>!, Int32)

Rank one update: adds a symmetric matrix to the product of a scaling factor, a vector, and its transpose (single precision).

func cblas_ssyrk(CBLAS_ORDER, CBLAS_UPLO, CBLAS_TRANSPOSE, Int32, Int32, Float, UnsafePointer<Float>!, Int32, Float, UnsafeMutablePointer<Float>!, Int32)

Rank-k update—multiplies a symmetric matrix by its transpose and adds a second matrix (single precision).

Single-Precision Complex Matrix Functions

func cblas_caxpy(Int32, UnsafeRawPointer!, UnsafeRawPointer!, Int32, UnsafeMutableRawPointer!, Int32)

Computes a constant times a vector plus a vector (single-precision complex).

func cblas_ccopy(Int32, UnsafeRawPointer!, Int32, UnsafeMutableRawPointer!, Int32)

Copies a vector to another vector (single-precision complex).

func cblas_cgerc(CBLAS_ORDER, Int32, Int32, UnsafeRawPointer!, UnsafeRawPointer!, Int32, UnsafeRawPointer!, Int32, UnsafeMutableRawPointer!, Int32)

Multiplies vector X by the conjugate transform of vector Y, then adds matrix A (single-precision complex).

func cblas_cher(CBLAS_ORDER, CBLAS_UPLO, Int32, Float, UnsafeRawPointer!, Int32, UnsafeMutableRawPointer!, Int32)

Hermitian rank 1 update: adds the product of a scaling factor, vector X, and the conjugate transpose of X to matrix A.

func cblas_cher2(CBLAS_ORDER, CBLAS_UPLO, Int32, UnsafeRawPointer!, UnsafeRawPointer!, Int32, UnsafeRawPointer!, Int32, UnsafeMutableRawPointer!, Int32)

Hermitian rank 2 update: adds the product of a scaling factor, vector X, and the conjugate transpose of vector Y to the product of the conjugate of the scaling factor, vector Y, and the conjugate transpose of vector X, and adds the result to matrix A.

func cblas_cherk(CBLAS_ORDER, CBLAS_UPLO, CBLAS_TRANSPOSE, Int32, Int32, Float, UnsafeRawPointer!, Int32, Float, UnsafeMutableRawPointer!, Int32)

Rank-k update—multiplies a Hermitian matrix by its transpose and adds a second matrix (single precision).

func cblas_chpr(CBLAS_ORDER, CBLAS_UPLO, Int32, Float, UnsafeRawPointer!, Int32, UnsafeMutableRawPointer!)

Scales and multiplies a vector times its conjugate transpose, then adds a matrix.

func cblas_chpr2(CBLAS_ORDER, CBLAS_UPLO, Int32, UnsafeRawPointer!, UnsafeRawPointer!, Int32, UnsafeRawPointer!, Int32, UnsafeMutableRawPointer!)

Multiplies a vector times the conjugate transpose of a second vector and vice-versa, sums the results, and adds a matrix.

func cblas_cscal(Int32, UnsafeRawPointer!, UnsafeMutableRawPointer!, Int32)

Multiplies each element of a vector by a constant (single-precision complex).

func cblas_csscal(Int32, Float, UnsafeMutableRawPointer!, Int32)

Multiplies each element of a vector by a constant (single-precision complex).

func cblas_cswap(Int32, UnsafeMutableRawPointer!, Int32, UnsafeMutableRawPointer!, Int32)

Exchanges the elements of two vectors (single-precision complex).

func cblas_csyrk(CBLAS_ORDER, CBLAS_UPLO, CBLAS_TRANSPOSE, Int32, Int32, UnsafeRawPointer!, UnsafeRawPointer!, Int32, UnsafeRawPointer!, UnsafeMutableRawPointer!, Int32)

Rank-k update—multiplies a symmetric matrix by its transpose and adds a second matrix (single-precision complex).

func cblas_ctpmv(CBLAS_ORDER, CBLAS_UPLO, CBLAS_TRANSPOSE, CBLAS_DIAG, Int32, UnsafeRawPointer!, UnsafeMutableRawPointer!, Int32)

Multiplies a triangular matrix by a vector, then adds a vector (single-precision complex).

func cblas_scasum(Int32, UnsafeRawPointer!, Int32)

Computes the sum of the absolute values of real and imaginary parts of elements in a vector (single-precision complex).

func cblas_scnrm2(Int32, UnsafeRawPointer!, Int32)

Computes the unitary norm of a vector (single-precision complex).

Double-Precision Float Matrix Functions

func cblas_dasum(Int32, UnsafePointer<Double>!, Int32)

Computes the sum of the absolute values of elements in a vector (double-precision).

func cblas_daxpy(Int32, Double, UnsafePointer<Double>!, Int32, UnsafeMutablePointer<Double>!, Int32)

Computes a constant times a vector plus a vector (double-precision).

func cblas_dnrm2(Int32, UnsafePointer<Double>!, Int32)

Computes the L2 norm (Euclidian length) of a vector (double precision).

func cblas_dscal(Int32, Double, UnsafeMutablePointer<Double>!, Int32)

Multiplies each element of a vector by a constant (double-precision).

func cblas_dspmv(CBLAS_ORDER, CBLAS_UPLO, Int32, Double, UnsafePointer<Double>!, UnsafePointer<Double>!, Int32, Double, UnsafeMutablePointer<Double>!, Int32)

Scales a packed symmetric matrix, then multiplies by a vector, then scales and adds another vector (double precision).

func cblas_dspr(CBLAS_ORDER, CBLAS_UPLO, Int32, Double, UnsafePointer<Double>!, Int32, UnsafeMutablePointer<Double>!)

Rank one update: adds a packed symmetric matrix to the product of a scaling factor, a vector, and its transpose (double precision).

func cblas_dsyr(CBLAS_ORDER, CBLAS_UPLO, Int32, Double, UnsafePointer<Double>!, Int32, UnsafeMutablePointer<Double>!, Int32)

Rank one update: adds a symmetric matrix to the product of a scaling factor, a vector, and its transpose (double precision).

func cblas_dsyrk(CBLAS_ORDER, CBLAS_UPLO, CBLAS_TRANSPOSE, Int32, Int32, Double, UnsafePointer<Double>!, Int32, Double, UnsafeMutablePointer<Double>!, Int32)

Rank-k update—multiplies a symmetric matrix by its transpose and adds a second matrix (double precision).

Double-Precision Complex Matrix Functions

func cblas_dzasum(Int32, UnsafeRawPointer!, Int32)

Computes the sum of the absolute values of real and imaginary parts of elements in a vector (single-precision complex).

func cblas_dznrm2(Int32, UnsafeRawPointer!, Int32)

Computes the unitary norm of a vector (double-precision complex).

func cblas_zaxpy(Int32, UnsafeRawPointer!, UnsafeRawPointer!, Int32, UnsafeMutableRawPointer!, Int32)

Computes a constant times a vector plus a vector (double-precision complex).

func cblas_zcopy(Int32, UnsafeRawPointer!, Int32, UnsafeMutableRawPointer!, Int32)

Copies a vector to another vector (double-precision complex).

func cblas_zdscal(Int32, Double, UnsafeMutableRawPointer!, Int32)

Multiplies each element of a vector by a constant (double-precision complex).

func cblas_zgerc(CBLAS_ORDER, Int32, Int32, UnsafeRawPointer!, UnsafeRawPointer!, Int32, UnsafeRawPointer!, Int32, UnsafeMutableRawPointer!, Int32)

Multiplies vector X by the conjugate transform of vector Y, then adds matrix A (double-precision complex).

func cblas_zher(CBLAS_ORDER, CBLAS_UPLO, Int32, Double, UnsafeRawPointer!, Int32, UnsafeMutableRawPointer!, Int32)

Adds the product of a scaling factor, vector X, and the conjugate transpose of X to matrix A.

func cblas_zher2(CBLAS_ORDER, CBLAS_UPLO, Int32, UnsafeRawPointer!, UnsafeRawPointer!, Int32, UnsafeRawPointer!, Int32, UnsafeMutableRawPointer!, Int32)

Hermitian rank 2 update: adds the product of a scaling factor, vector X, and the conjugate transpose of vector Y to the product of the conjugate of the scaling factor, vector Y, and the conjugate transpose of vector X, and adds the result to matrix A.

func cblas_zherk(CBLAS_ORDER, CBLAS_UPLO, CBLAS_TRANSPOSE, Int32, Int32, Double, UnsafeRawPointer!, Int32, Double, UnsafeMutableRawPointer!, Int32)

Rank-k update—multiplies a Hermitian matrix by its transpose and adds a second matrix (single precision).

func cblas_zhpr(CBLAS_ORDER, CBLAS_UPLO, Int32, Double, UnsafeRawPointer!, Int32, UnsafeMutableRawPointer!)

Scales and multiplies a vector times its conjugate transpose, then adds a matrix.

func cblas_zhpr2(CBLAS_ORDER, CBLAS_UPLO, Int32, UnsafeRawPointer!, UnsafeRawPointer!, Int32, UnsafeRawPointer!, Int32, UnsafeMutableRawPointer!)

Multiplies a vector times the conjugate transpose of a second vector and vice-versa, sums the results, and adds a matrix.

func cblas_zscal(Int32, UnsafeRawPointer!, UnsafeMutableRawPointer!, Int32)

Multiplies each element of a vector by a constant (double-precision complex).

func cblas_zswap(Int32, UnsafeMutableRawPointer!, Int32, UnsafeMutableRawPointer!, Int32)

Exchanges the elements of two vectors (double-precision complex).

func cblas_zsyrk(CBLAS_ORDER, CBLAS_UPLO, CBLAS_TRANSPOSE, Int32, Int32, UnsafeRawPointer!, UnsafeRawPointer!, Int32, UnsafeRawPointer!, UnsafeMutableRawPointer!, Int32)

Rank-k update—multiplies a symmetric matrix by its transpose and adds a second matrix (double-precision complex).

func cblas_ztpmv(CBLAS_ORDER, CBLAS_UPLO, CBLAS_TRANSPOSE, CBLAS_DIAG, Int32, UnsafeRawPointer!, UnsafeMutableRawPointer!, Int32)

Multiplies a triangular matrix by a vector, then adds a vector (double-precision compex).

Data Types

BLASParamErrorProc

BLAS error handler callback type.