1 /++ 2 $(H2 BLAS API for GLAS) 3 4 Please read $(LINK2 http://www.netlib.org/blas/ , Netlib BLAS) for more details. 5 6 Note: Standard (fortran) BLAS API is column major. 7 8 Copyright: Copyright © 2016-, Ilya Yaroshenko. 9 License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0). 10 Authors: Ilya Yaroshenko 11 +/ 12 module glas.fortran; 13 14 version(LDC) 15 pragma(LDC_no_moduleinfo); 16 17 /// Alias for Fortran77 integer. 18 alias FortranInt = int; 19 20 extern(C) nothrow @nogc @system: 21 22 /++ 23 `gemm_` performs one of the matrix-matrix operations 24 25 `C := alpha*op( A )*op( B ) + beta*C`, 26 27 where `op( X )` is one of 28 29 `op( X ) = X or op( X ) = X**T or op( X ) = X**H`, 30 31 alpha and beta are scalars, and `A`, `B` and `C` are matrices, with `op( A )` 32 an `m ⨉ k` matrix, `op( B )` a `k ⨉ n` matrix and `C` an `m ⨉ n` matrix. 33 34 Unified_alias: `gemm_` 35 +/ 36 int sgemm_(ref const char transa, ref const char transb, ref const FortranInt m, ref const FortranInt n, ref const FortranInt k, ref const float alpha, const(float)* a, ref const FortranInt lda, const(float)* b, ref const FortranInt ldb, ref const float beta, float* c, ref const FortranInt ldc); 37 /// ditto 38 int dgemm_(ref const char transa, ref const char transb, ref const FortranInt m, ref const FortranInt n, ref const FortranInt k, ref const double alpha, const(double)* a, ref const FortranInt lda, const(double)* b, ref const FortranInt ldb, ref const double beta, double* c, ref const FortranInt ldc); 39 /// ditto 40 int cgemm_(ref const char transa, ref const char transb, ref const FortranInt m, ref const FortranInt n, ref const FortranInt k, ref const cfloat alpha, const(cfloat)* a, ref const FortranInt lda, const(cfloat)* b, ref const FortranInt ldb, ref const cfloat beta, cfloat* c, ref const FortranInt ldc); 41 /// ditto 42 int zgemm_(ref const char transa, ref const char transb, ref const FortranInt m, ref const FortranInt n, ref const FortranInt k, ref const cdouble alpha, const(cdouble)* a, ref const FortranInt lda, const(cdouble)* b, ref const FortranInt ldb, ref const cdouble beta, cdouble* c, ref const FortranInt ldc); 43 44 alias gemm_ = sgemm_; 45 alias gemm_ = dgemm_; 46 alias gemm_ = cgemm_; 47 alias gemm_ = zgemm_; 48 49 /++ 50 `symm_` performs one of the matrix-matrix operations 51 52 `C := alpha*A*B + beta*C`, 53 54 where `op( X )` is one of 55 56 `C := alpha*B*A + beta*C`, 57 58 alpha and beta are scalars, `A` is a symmetric matrix and `B` and 59 `C` are `m ⨉ n` matrices.. 60 61 Unified_alias: `symm_` 62 +/ 63 int ssymm_(ref const char side, ref const char uplo, ref const FortranInt m, ref const FortranInt n, ref const float alpha, const(float)* a, ref const FortranInt lda, const(float)* b, ref const FortranInt ldb, ref const float beta, float* c, ref const FortranInt ldc); 64 /// ditto 65 int dsymm_(ref const char side, ref const char uplo, ref const FortranInt m, ref const FortranInt n, ref const double alpha, const(double)* a, ref const FortranInt lda, const(double)* b, ref const FortranInt ldb, ref const double beta, double* c, ref const FortranInt ldc); 66 /// ditto 67 int csymm_(ref const char side, ref const char uplo, ref const FortranInt m, ref const FortranInt n, ref const cfloat alpha, const(cfloat)* a, ref const FortranInt lda, const(cfloat)* b, ref const FortranInt ldb, ref const cfloat beta, cfloat* c, ref const FortranInt ldc); 68 /// ditto 69 int zsymm_(ref const char side, ref const char uplo, ref const FortranInt m, ref const FortranInt n, ref const cdouble alpha, const(cdouble)* a, ref const FortranInt lda, const(cdouble)* b, ref const FortranInt ldb, ref const cdouble beta, cdouble* c, ref const FortranInt ldc); 70 71 alias symm_ = ssymm_; 72 alias symm_ = dsymm_; 73 alias symm_ = csymm_; 74 alias symm_ = zsymm_; 75 76 /++ 77 `hemm_` performs one of the matrix-matrix operations 78 79 `C := alpha*A*B + beta*C`, 80 81 where `op( X )` is one of 82 83 `C := alpha*B*A + beta*C`, 84 85 alpha and beta are scalars, `A` is a hermitian matrix and `B` and 86 `C` are `m ⨉ n` matrices.. 87 88 Unified_alias: `hemm_` 89 +/ 90 int chemm_(ref const char side, ref const char uplo, ref const FortranInt m, ref const FortranInt n, ref const cfloat alpha, const(cfloat)* a, ref const FortranInt lda, const(cfloat)* b, ref const FortranInt ldb, ref const cfloat beta, cfloat* c, ref const FortranInt ldc); 91 /// ditto 92 int zhemm_(ref const char side, ref const char uplo, ref const FortranInt m, ref const FortranInt n, ref const cdouble alpha, const(cdouble)* a, ref const FortranInt lda, const(cdouble)* b, ref const FortranInt ldb, ref const cdouble beta, cdouble* c, ref const FortranInt ldc); 93 94 alias hemm_ = chemm_; 95 alias hemm_ = zhemm_; 96 97 /++ 98 `scal_` scales a vector by a constant. 99 100 Unified_alias: `scal_` 101 +/ 102 int sscal_(ref const FortranInt n, ref const float a, float* x, ref const FortranInt incx); 103 /// ditto 104 int dscal_(ref const FortranInt n, ref const double a, double* x, ref const FortranInt incx); 105 /// ditto 106 int csscal_(ref const FortranInt n, ref const float a, cfloat* x, ref const FortranInt incx); 107 /// ditto 108 int cscal_(ref const FortranInt n, ref const cfloat a, cfloat* x, ref const FortranInt incx); 109 /// ditto 110 int csIscal_(ref const FortranInt n, ref const ifloat a, cfloat* x, ref const FortranInt incx); 111 /// ditto 112 int zdscal_(ref const FortranInt n, ref const double a, cdouble* x, ref const FortranInt incx); 113 /// ditto 114 int zscal_(ref const FortranInt n, ref const cdouble a, cdouble* x, ref const FortranInt incx); 115 /// ditto 116 int zdIscal_(ref const FortranInt n, ref const idouble a, cdouble* x, ref const FortranInt incx); 117 118 alias scal_ = sscal_; 119 alias scal_ = dscal_; 120 alias scal_ = csscal_; 121 alias scal_ = cscal_; 122 alias scal_ = csIscal_; 123 alias scal_ = zdscal_; 124 alias scal_ = zscal_; 125 alias scal_ = zdIscal_; 126 127 /++ 128 XERBLA is an error handler for the LAPACK routines. 129 It is called by an LAPACK routine if an input parameter has an 130 invalid value. A message is printed and execution stops. 131 132 Installers may consider modifying the STOP statement in order to 133 call system-specific exception-handling facilities. 134 +/ 135 int xerbla_(in char* srname, ref FortranInt info);