Report a bug
If you spot a problem with this page, click here to create a Github issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

glas.ndslice

GLAS API

Authors:
Ilya Yaroshenko

Transposition

GLAS does not require transposition parameters. Use transposed to perform zero cost ndslice transposition.

Notendslice uses is row major representation.

enum ulong ConjA;
Specifies if the matrix asl stores conjugated elements.
enum ulong ConjB;
Specifies if the matrix bsl stores conjugated elements.
enum ulong Lower;
Specifies if the lower triangular part of the symmetric matrix A is to be referenced.
The lower triangular part of the matrix asl must contain the lower triangular part of the symmetric / hermitian matrix A and the strictly upper triangular part of asl is not referenced.

NoteLower is default flag.

enum ulong Upper;
Specifies if the upper triangular part of the symmetric matrix A is to be referenced.
The upper triangular part of the matrix asl must contain the upper triangular part of the symmetric / hermitian matrix A and the strictly lower triangular part of asl is not referenced.
enum ulong Left;
Specifies if the symmetric/hermitian matrix A appears on the left in the operation.

NoteLeft is default flag.

enum ulong Right;
Specifies if the symmetric/hermitian matrix A appears on the left in the operation.
nothrow @nogc @system string glas_error(int error_code);
Parameters:
int error_codeError code
Returns:
error message
nothrow @nogc @system int glas_validate_gemm(Structure!2 as, Structure!2 bs, Structure!2 cs, ulong settings = 0);

alias validate_gemm = glas_validate_gemm;
Validates input data for GEMM operations.
Parameters:
Structure!2 asstructure for matrix A
Structure!2 bsstructure for matrix B
Structure!2 csstructure for matrix C
ulong settingsOperation settings. Allowed flags are ConjA, ConjB.
Returns:
0 on success and error code otherwise.
nothrow @nogc @system int glas_validate_symm(Structure!2 as, Structure!2 bs, Structure!2 cs, ulong settings = 0);

alias validate_symm = glas_validate_symm;
Validates input data for SYMM operations.
Parameters:
Structure!2 asstructure for matrix A
Structure!2 bsstructure for matrix B
Structure!2 csstructure for matrix C
ulong settingsOperation settings. Allowed flags are Left, Right, Lower, Upper, ConjA, ConjB. ConjA flag specifies if the matrix A is hermitian.
Returns:
0 on success and error code otherwise.
nothrow @nogc @system void glas_sgemm(float alpha, Slice!(SliceKind.universal, [2], const(float)*) asl, Slice!(SliceKind.universal, [2], const(float)*) bsl, float beta, Slice!(SliceKind.universal, [2], float*) csl, ulong settings = 0);

nothrow @nogc @system void glas_dgemm(double alpha, Slice!(SliceKind.universal, [2], const(double)*) asl, Slice!(SliceKind.universal, [2], const(double)*) bsl, double beta, Slice!(SliceKind.universal, [2], double*) csl, ulong settings = 0);

nothrow @nogc @system void glas_cgemm(cfloat alpha, Slice!(SliceKind.universal, [2], const(cfloat)*) asl, Slice!(SliceKind.universal, [2], const(cfloat)*) bsl, cfloat beta, Slice!(SliceKind.universal, [2], cfloat*) csl, ulong settings = 0);

nothrow @nogc @system void glas_zgemm(cdouble alpha, Slice!(SliceKind.universal, [2], const(cdouble)*) asl, Slice!(SliceKind.universal, [2], const(cdouble)*) bsl, cdouble beta, Slice!(SliceKind.universal, [2], cdouble*) csl, ulong settings = 0);

alias gemm = gemm;

alias gemm = gemm;

alias gemm = gemm;

alias gemm = glas_zgemm;
Performs general matrix-matrix multiplication.

Pseudo codeC := alpha A × B + beta C.

Parameters:
float alphascalar
Slice!(SliceKind.universal, [2], const(float)*) aslm ⨉ k matrix
Slice!(SliceKind.universal, [2], const(float)*) bslk ⨉ n matrix
float betascalar. When beta is supplied as zero then the matrix csl need not be set on input.
Slice!(SliceKind.universal, [2], float*) cslm ⨉ n matrix with one stride equal to ±1.
ulong settingsOperation settings. Allowed flags are ConjA and ConjB.

Unified aliasgemm

BLASSGEMM, DGEMM, CGEMM, ZGEMM

nothrow @nogc @system void glas_ssymm(float alpha, Slice!(SliceKind.universal, [2], const(float)*) asl, Slice!(SliceKind.universal, [2], const(float)*) bsl, float beta, Slice!(SliceKind.universal, [2], float*) csl, ulong settings = 0);

nothrow @nogc @system void glas_dsymm(double alpha, Slice!(SliceKind.universal, [2], const(double)*) asl, Slice!(SliceKind.universal, [2], const(double)*) bsl, double beta, Slice!(SliceKind.universal, [2], double*) csl, ulong settings = 0);

nothrow @nogc @system void glas_csymm(cfloat alpha, Slice!(SliceKind.universal, [2], const(cfloat)*) asl, Slice!(SliceKind.universal, [2], const(cfloat)*) bsl, cfloat beta, Slice!(SliceKind.universal, [2], cfloat*) csl, ulong settings = 0);

nothrow @nogc @system void glas_zsymm(cdouble alpha, Slice!(SliceKind.universal, [2], const(cdouble)*) asl, Slice!(SliceKind.universal, [2], const(cdouble)*) bsl, cdouble beta, Slice!(SliceKind.universal, [2], cdouble*) csl, ulong settings = 0);

alias symm = symm;

alias symm = symm;

alias symm = symm;

alias symm = glas_zsymm;
Performs symmetric or hermitian matrix-matrix multiplication.

Pseudo codeC := alpha A × B + beta C or C := alpha B × A + beta C, where alpha and beta are scalars, A is a symmetric or hermitian matrix and B and C are m × n matrices.

Parameters:
float alphascalar
Slice!(SliceKind.universal, [2], const(float)*) aslk ⨉ k matrix, where k is n when Right flag is set and is m otherwise.
Slice!(SliceKind.universal, [2], const(float)*) bslm ⨉ n matrix
float betascalar. When beta is supplied as zero then the matrix csl need not be set on input.
Slice!(SliceKind.universal, [2], float*) cslm ⨉ n matrix with one stride equals to ±1.
ulong settingsOperation settings. Allowed flags are Left, Right, Lower, Upper, ConjA, ConjB. ConjA flag specifies if the matrix A is hermitian.

Unified aliassymm

BLASSSYMM, DSYMM, CSYMM, ZSYMM, SHEMM, DHEMM, CHEMM, ZHEMM

pure nothrow @nogc @system void glas_scopy(Slice!(SliceKind.universal, [1], const(float)*) xsl, Slice!(SliceKind.universal, [1], float*) ysl);

pure nothrow @nogc @system void glas_dcopy(Slice!(SliceKind.universal, [1], const(double)*) xsl, Slice!(SliceKind.universal, [1], double*) ysl);

pure nothrow @nogc @system void glas_ccopy(Slice!(SliceKind.universal, [1], const(cfloat)*) xsl, Slice!(SliceKind.universal, [1], float*) ysl);

pure nothrow @nogc @system void glas_zcopy(Slice!(SliceKind.universal, [1], const(cdouble)*) xsl, Slice!(SliceKind.universal, [1], cdouble*) ysl);

pure nothrow @nogc @system void _glas_scopy(size_t n, ptrdiff_t incx, const(float)* x, ptrdiff_t incy, float* y);

pure nothrow @nogc @system void _glas_dcopy(size_t n, ptrdiff_t incx, const(double)* x, ptrdiff_t incy, double* y);

pure nothrow @nogc @system void _glas_ccopy(size_t n, ptrdiff_t incx, const(cfloat)* x, ptrdiff_t incy, cfloat* y);

pure nothrow @nogc @system void _glas_zcopy(size_t n, ptrdiff_t incx, const(cdouble)* x, ptrdiff_t incy, cdouble* y);

alias copy = copy;

alias copy = copy;

alias copy = copy;

alias copy = copy;

alias copy = copy;

alias copy = copy;

alias copy = copy;

alias copy = _glas_zcopy;
copy copies a vector, x, to a vector, y.

Pseudo codey := x.

Unified aliascopy

BLASSCOPY, DCOPY, CCOPY, ZCOPY

pure nothrow @nogc @system void glas_sswap(Slice!(SliceKind.universal, [1], float*) xsl, Slice!(SliceKind.universal, [1], float*) ysl);

pure nothrow @nogc @system void glas_dswap(Slice!(SliceKind.universal, [1], double*) xsl, Slice!(SliceKind.universal, [1], double*) ysl);

pure nothrow @nogc @system void glas_cswap(Slice!(SliceKind.universal, [1], cfloat*) xsl, Slice!(SliceKind.universal, [1], float*) ysl);

pure nothrow @nogc @system void glas_zswap(Slice!(SliceKind.universal, [1], cdouble*) xsl, Slice!(SliceKind.universal, [1], cdouble*) ysl);

pure nothrow @nogc @system void _glas_sswap(size_t n, ptrdiff_t incx, float* x, ptrdiff_t incy, float* y);

pure nothrow @nogc @system void _glas_dswap(size_t n, ptrdiff_t incx, double* x, ptrdiff_t incy, double* y);

pure nothrow @nogc @system void _glas_cswap(size_t n, ptrdiff_t incx, cfloat* x, ptrdiff_t incy, cfloat* y);

pure nothrow @nogc @system void _glas_zswap(size_t n, ptrdiff_t incx, cdouble* x, ptrdiff_t incy, cdouble* y);

alias swap = swap;

alias swap = swap;

alias swap = swap;

alias swap = swap;

alias swap = swap;

alias swap = swap;

alias swap = swap;

alias swap = _glas_zswap;
swap interchanges two vectors.

Pseudo codex <-> y.

Unified aliasswap

BLASSSWAP, DSWAP, CSWAP, ZSWAP

pure nothrow @nogc @system void glas_saxpy(float a, Slice!(SliceKind.universal, [1], const(float)*) xsl, Slice!(SliceKind.universal, [1], float*) ysl);

pure nothrow @nogc @system void glas_daxpy(double a, Slice!(SliceKind.universal, [1], const(double)*) xsl, Slice!(SliceKind.universal, [1], double*) ysl);

pure nothrow @nogc @system void glas_caxpy(cfloat a, Slice!(SliceKind.universal, [1], const(cfloat)*) xsl, Slice!(SliceKind.universal, [1], float*) ysl);

pure nothrow @nogc @system void glas_zaxpy(cdouble a, Slice!(SliceKind.universal, [1], const(cdouble)*) xsl, Slice!(SliceKind.universal, [1], cdouble*) ysl);

pure nothrow @nogc @system void _glas_saxpy(float a, size_t n, ptrdiff_t incx, const(float)* x, ptrdiff_t incy, float* y);

pure nothrow @nogc @system void _glas_daxpy(double a, size_t n, ptrdiff_t incx, const(double)* x, ptrdiff_t incy, double* y);

pure nothrow @nogc @system void _glas_caxpy(cfloat a, size_t n, ptrdiff_t incx, const(cfloat)* x, ptrdiff_t incy, cfloat* y);

pure nothrow @nogc @system void _glas_zaxpy(cdouble a, size_t n, ptrdiff_t incx, const(cdouble)* x, ptrdiff_t incy, cdouble* y);

alias axpy = axpy;

alias axpy = axpy;

alias axpy = axpy;

alias axpy = axpy;

alias axpy = axpy;

alias axpy = axpy;

alias axpy = axpy;

alias axpy = _glas_zaxpy;
Constant times a vector plus a vector.

Pseudo codey += a * x.

Unified aliasaxpy

BLASSAXPY, DAXPY, CAXPY, ZAXPY

pure nothrow @nogc @system void glas_srot(Slice!(SliceKind.universal, [1], float*) xsl, Slice!(SliceKind.universal, [1], float*) ysl, float c, float s);

pure nothrow @nogc @system void glas_drot(Slice!(SliceKind.universal, [1], double*) xsl, Slice!(SliceKind.universal, [1], double*) ysl, double c, double s);

pure nothrow @nogc @system void glas_csrot(Slice!(SliceKind.universal, [1], cfloat*) xsl, Slice!(SliceKind.universal, [1], float*) ysl, float c, float s);

pure nothrow @nogc @system void glas_zdrot(Slice!(SliceKind.universal, [1], cdouble*) xsl, Slice!(SliceKind.universal, [1], cdouble*) ysl, double c, double s);

pure nothrow @nogc @system void _glas_srot(size_t n, ptrdiff_t incx, float* x, ptrdiff_t incy, float* y, float c, float s);

pure nothrow @nogc @system void _glas_drot(size_t n, ptrdiff_t incx, double* x, ptrdiff_t incy, double* y, double c, double s);

pure nothrow @nogc @system void _glas_csrot(size_t n, ptrdiff_t incx, cfloat* x, ptrdiff_t incy, cfloat* y, float c, float s);

pure nothrow @nogc @system void _glas_zdrot(size_t n, ptrdiff_t incx, cdouble* x, ptrdiff_t incy, cdouble* y, double c, double s);

alias rot = rot;

alias rot = rot;

alias rot = rot;

alias rot = rot;

alias rot = rot;

alias rot = rot;

alias rot = rot;

alias rot = _glas_zdrot;
Applies a plane rotation.

Unified aliasrot

BLASSROT, DROT, CSROT, ZDROT

pure nothrow @nogc @system void glas_srotm(Slice!(SliceKind.universal, [1], float*) xsl, Slice!(SliceKind.universal, [1], float*) ysl, ref const float[5] sparam);

pure nothrow @nogc @system void glas_drotm(Slice!(SliceKind.universal, [1], double*) xsl, Slice!(SliceKind.universal, [1], double*) ysl, ref const double[5] sparam);

pure nothrow @nogc @system void _glas_srotm(size_t n, ptrdiff_t incx, float* x, ptrdiff_t incy, float* y, ref const float[5] sparam);

pure nothrow @nogc @system void _glas_drotm(size_t n, ptrdiff_t incx, double* x, ptrdiff_t incy, double* y, ref const double[5] sparam);

alias rotm = rotm;

alias rotm = rotm;

alias rotm = rotm;

alias rotm = _glas_drotm;
Applies a modified plane rotation.

Unified aliasrotn

BLASSROTM, DROTM

pure nothrow @nogc @system float glas_sdot(Slice!(SliceKind.universal, [1], const(float)*) xsl, Slice!(SliceKind.universal, [1], const(float)*) ysl);

pure nothrow @nogc @system double glas_ddot(Slice!(SliceKind.universal, [1], const(double)*) xsl, Slice!(SliceKind.universal, [1], const(double)*) ysl);

pure nothrow @nogc @system float _glas_sdot(size_t n, ptrdiff_t incx, const(float)* x, ptrdiff_t incy, const(float)* y);

pure nothrow @nogc @system double _glas_ddot(size_t n, ptrdiff_t incx, const(double)* x, ptrdiff_t incy, const(double)* y);

alias dot = dot;

alias dot = dot;

alias dot = dot;

alias dot = _glas_ddot;
Forms the dot product of two vectors. Uses unrolled loops for increments equal to one.

Unified aliasdot

Pseudo codeX^T * Y

BLASSDOT, DDOT

pure nothrow @nogc @system double glas_dsdot(Slice!(SliceKind.universal, [1], const(float)*) xsl, Slice!(SliceKind.universal, [1], const(float)*) ysl);

pure nothrow @nogc @system double _glas_dsdot(size_t n, ptrdiff_t incx, const(float)* x, ptrdiff_t incy, const(float)* y);

alias dsdot = dsdot;

alias dsdot = _glas_dsdot;
Compute the inner product of two vectors with extended precision accumulation and result. Uses unrolled loops for increments equal to one.

Unified aliasdot

Pseudo codeX^T * Y

BLASDSDOT

pure nothrow @nogc @system cfloat glas_cdotu(Slice!(SliceKind.universal, [1], const(cfloat)*) xsl, Slice!(SliceKind.universal, [1], const(cfloat)*) ysl);

pure nothrow @nogc @system cdouble glas_zdotu(Slice!(SliceKind.universal, [1], const(cdouble)*) xsl, Slice!(SliceKind.universal, [1], const(cdouble)*) ysl);

pure nothrow @nogc @system cfloat _glas_cdotu(size_t n, ptrdiff_t incx, const(cfloat)* x, ptrdiff_t incy, const(cfloat)* y);

pure nothrow @nogc @system cdouble _glas_zdotu(size_t n, ptrdiff_t incx, const(cdouble)* x, ptrdiff_t incy, const(cdouble)* y);

alias dotu = dotu;

alias dotu = dotu;

alias dotu = dotu;

alias dotu = _glas_zdotu;
Forms the dot product of two complex vectors. Uses unrolled loops for increments equal to one.

Unified aliasdotu

Pseudo codeX^T * Y

BLASCDOTU, ZDOTU

pure nothrow @nogc @system cfloat glas_cdotc(Slice!(SliceKind.universal, [1], const(cfloat)*) xsl, Slice!(SliceKind.universal, [1], const(cfloat)*) ysl);

pure nothrow @nogc @system cdouble glas_zdotc(Slice!(SliceKind.universal, [1], const(cdouble)*) xsl, Slice!(SliceKind.universal, [1], const(cdouble)*) ysl);

pure nothrow @nogc @system cfloat _glas_cdotc(size_t n, ptrdiff_t incx, const(cfloat)* x, ptrdiff_t incy, const(cfloat)* y);

pure nothrow @nogc @system cdouble _glas_zdotc(size_t n, ptrdiff_t incx, const(cdouble)* x, ptrdiff_t incy, const(cdouble)* y);

alias dotc = dotc;

alias dotc = dotc;

alias dotc = dotc;

alias dotc = _glas_zdotc;
Forms the dot product of two complex vectors. Uses unrolled loops for increments equal to one.

Unified aliasdotc

Pseudo codeX^H * Y

BLASCDOTC, ZDOTC

pure nothrow @nogc @system float glas_snrm2(Slice!(SliceKind.universal, [1], const(float)*) xsl);

pure nothrow @nogc @system double glas_dnrm2(Slice!(SliceKind.universal, [1], const(double)*) xsl);

pure nothrow @nogc @system float glas_scnrm2(Slice!(SliceKind.universal, [1], const(cfloat)*) xsl);

pure nothrow @nogc @system double glas_dznrm2(Slice!(SliceKind.universal, [1], const(cdouble)*) xsl);

pure nothrow @nogc @system float _glas_snrm2(size_t n, ptrdiff_t incx, const(float)* x);

pure nothrow @nogc @system double _glas_dnrm2(size_t n, ptrdiff_t incx, const(double)* x);

pure nothrow @nogc @system float _glas_scnrm2(size_t n, ptrdiff_t incx, const(cfloat)* x);

pure nothrow @nogc @system double _glas_dznrm2(size_t n, ptrdiff_t incx, const(cdouble)* x);

alias nrm2 = nrm2;

alias nrm2 = nrm2;

alias nrm2 = nrm2;

alias nrm2 = nrm2;

alias nrm2 = nrm2;

alias nrm2 = nrm2;

alias nrm2 = nrm2;

alias nrm2 = _glas_dznrm2;
Returns the euclidean norm of a vector via the function.

Pseudo codesqrt( x'*x ).

Unified aliasnrm2

BLASSNRM2, DNRM2, SCNRM2, DZNRM2

pure nothrow @nogc @system float glas_sasum(Slice!(SliceKind.universal, [1], const(float)*) xsl);

pure nothrow @nogc @system double glas_dasum(Slice!(SliceKind.universal, [1], const(double)*) xsl);

pure nothrow @nogc @system float glas_scasum(Slice!(SliceKind.universal, [1], const(cfloat)*) xsl);

pure nothrow @nogc @system double glas_dzasum(Slice!(SliceKind.universal, [1], const(cdouble)*) xsl);

pure nothrow @nogc @system float _glas_sasum(size_t n, ptrdiff_t incx, const(float)* x);

pure nothrow @nogc @system double _glas_dasum(size_t n, ptrdiff_t incx, const(double)* x);

pure nothrow @nogc @system float _glas_scasum(size_t n, ptrdiff_t incx, const(cfloat)* x);

pure nothrow @nogc @system double _glas_dzasum(size_t n, ptrdiff_t incx, const(cdouble)* x);

alias asum = asum;

alias asum = asum;

alias asum = asum;

alias asum = asum;

alias asum = asum;

alias asum = asum;

alias asum = asum;

alias asum = _glas_dzasum;
Takes the sum of the absolute values.

Unified aliasasum

BLASSASUM, DASUM, SCASUM, DZASUM

pure nothrow @nogc @system ptrdiff_t glas_isamax(Slice!(SliceKind.universal, [1], const(float)*) xsl);

pure nothrow @nogc @system ptrdiff_t glas_idamax(Slice!(SliceKind.universal, [1], const(double)*) xsl);

pure nothrow @nogc @system ptrdiff_t glas_icamax(Slice!(SliceKind.universal, [1], const(cfloat)*) xsl);

pure nothrow @nogc @system ptrdiff_t glas_izamax(Slice!(SliceKind.universal, [1], const(cdouble)*) xsl);

pure nothrow @nogc @system ptrdiff_t _glas_isamax(size_t n, ptrdiff_t incx, const(float)* x);

pure nothrow @nogc @system ptrdiff_t _glas_idamax(size_t n, ptrdiff_t incx, const(double)* x);

pure nothrow @nogc @system ptrdiff_t _glas_icamax(size_t n, ptrdiff_t incx, const(cfloat)* x);

pure nothrow @nogc @system ptrdiff_t _glas_izamax(size_t n, ptrdiff_t incx, const(cdouble)* x);

alias iamax = iamax;

alias iamax = iamax;

alias iamax = iamax;

alias iamax = iamax;

alias iamax = iamax;

alias iamax = iamax;

alias iamax = iamax;

alias iamax = _glas_izamax;
Finds the index of the first element having maximum |Re(.)| + |Im(.)|.

Unified aliasamax

BLASISAMAX, IDAMAX, ICAMAX, IZAMAX

pure nothrow @nogc @system void glas_sscal(float a, Slice!(SliceKind.universal, [1], float*) xsl);

pure nothrow @nogc @system void glas_dscal(double a, Slice!(SliceKind.universal, [1], double*) xsl);

pure nothrow @nogc @system void glas_csscal(float a, Slice!(SliceKind.universal, [1], cfloat*) xsl);

pure nothrow @nogc @system void glas_cscal(cfloat a, Slice!(SliceKind.universal, [1], cfloat*) xsl);

pure nothrow @nogc @system void glas_csIscal(ifloat a, Slice!(SliceKind.universal, [1], cfloat*) xsl);

pure nothrow @nogc @system void glas_zdscal(double a, Slice!(SliceKind.universal, [1], cdouble*) xsl);

pure nothrow @nogc @system void glas_zscal(cdouble a, Slice!(SliceKind.universal, [1], cdouble*) xsl);

pure nothrow @nogc @system void glas_zdIscal(idouble a, Slice!(SliceKind.universal, [1], cdouble*) xsl);

pure nothrow @nogc @system void _glas_sscal(float a, size_t n, ptrdiff_t incx, float* x);

pure nothrow @nogc @system void _glas_dscal(double a, size_t n, ptrdiff_t incx, double* x);

pure nothrow @nogc @system void _glas_csscal(float a, size_t n, ptrdiff_t incx, cfloat* x);

pure nothrow @nogc @system void _glas_cscal(cfloat a, size_t n, ptrdiff_t incx, cfloat* x);

pure nothrow @nogc @system void _glas_csIscal(ifloat a, size_t n, ptrdiff_t incx, cfloat* x);

pure nothrow @nogc @system void _glas_zdscal(double a, size_t n, ptrdiff_t incx, cdouble* x);

pure nothrow @nogc @system void _glas_zscal(cdouble a, size_t n, ptrdiff_t incx, cdouble* x);

pure nothrow @nogc @system void _glas_zdIscal(idouble a, size_t n, ptrdiff_t incx, cdouble* x);

alias scal = scal;

alias scal = scal;

alias scal = scal;

alias scal = scal;

alias scal = scal;

alias scal = scal;

alias scal = scal;

alias scal = scal;

alias scal = scal;

alias scal = scal;

alias scal = scal;

alias scal = scal;

alias scal = scal;

alias scal = scal;

alias scal = scal;

alias scal = _glas_zdIscal;
scal scales a vector by a constant.

Pseudo codex := a x.

Unified aliasscal

BLASSSSCAL, DSSCAL, CSSCAL, ZSSCAL, CSCAL, ZSCAL