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 /// Alias for Fortran77 integer.
15 alias FortranInt = int;
16 
17 extern(C) nothrow @nogc @system:
18 
19 /++
20  `gemm_`  performs one of the matrix-matrix operations
21 
22     `C := alpha*op( A )*op( B ) + beta*C`,
23 
24  where  `op( X )` is one of
25 
26     `op( X ) = X   or   op( X ) = X**T or op( X ) = X**H`,
27 
28  alpha and beta are scalars, and `A`, `B` and `C` are matrices, with `op( A )`
29  an `m ⨉ k` matrix,  `op( B )`  a  `k ⨉ n` matrix and  `C` an `m ⨉ n` matrix.
30 
31 Unified_alias: `gemm_`
32 +/
33 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);
34 /// ditto
35 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);
36 /// ditto
37 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);
38 /// ditto
39 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);
40 
41 alias gemm_ = sgemm_;
42 alias gemm_ = dgemm_;
43 alias gemm_ = cgemm_;
44 alias gemm_ = zgemm_;
45 
46 /++
47  `symm_`  performs one of the matrix-matrix operations
48 
49     `C := alpha*A*B + beta*C`,
50 
51  where  `op( X )` is one of
52 
53     `C := alpha*B*A + beta*C`,
54 
55  alpha and beta are scalars, `A` is a symmetric matrix and `B` and
56  `C` are `m ⨉ n` matrices..
57 
58 Unified_alias: `symm_`
59 +/
60 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);
61 /// ditto
62 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);
63 /// ditto
64 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);
65 /// ditto
66 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);
67 
68 alias symm_ = ssymm_;
69 alias symm_ = dsymm_;
70 alias symm_ = csymm_;
71 alias symm_ = zsymm_;
72 
73 /++
74  `hemm_`  performs one of the matrix-matrix operations
75 
76     `C := alpha*A*B + beta*C`,
77 
78  where  `op( X )` is one of
79 
80     `C := alpha*B*A + beta*C`,
81 
82  alpha and beta are scalars, `A` is a hermitian matrix and `B` and
83  `C` are `m ⨉ n` matrices..
84 
85 Unified_alias: `hemm_`
86 +/
87 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);
88 /// ditto
89 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);
90 
91 alias hemm_ = chemm_;
92 alias hemm_ = zhemm_;
93 
94 /++
95 `scal_` scales a vector by a constant.
96 
97 Unified_alias: `scal_`
98 +/
99 int sscal_(ref const FortranInt n, ref const float a, float* x, ref const FortranInt incx);
100 /// ditto 
101 int dscal_(ref const FortranInt n, ref const double a, double* x, ref const FortranInt incx);
102 /// ditto 
103 int csscal_(ref const FortranInt n, ref const float a, cfloat* x, ref const FortranInt incx);
104 /// ditto 
105 int cscal_(ref const FortranInt n, ref const cfloat a, cfloat* x, ref const FortranInt incx);
106 /// ditto 
107 int csIscal_(ref const FortranInt n, ref const ifloat a, cfloat* x, ref const FortranInt incx);
108 /// ditto 
109 int zdscal_(ref const FortranInt n, ref const double a, cdouble* x, ref const FortranInt incx);
110 /// ditto 
111 int zscal_(ref const FortranInt n, ref const cdouble a, cdouble* x, ref const FortranInt incx);
112 /// ditto 
113 int zdIscal_(ref const FortranInt n, ref const idouble a, cdouble* x, ref const FortranInt incx);
114 
115 alias scal_ = sscal_;
116 alias scal_ = dscal_;
117 alias scal_ = csscal_;
118 alias scal_ = cscal_;
119 alias scal_ = csIscal_;
120 alias scal_ = zdscal_;
121 alias scal_ = zscal_;
122 alias scal_ = zdIscal_;
123 
124 /++
125  XERBLA  is an error handler for the LAPACK routines.
126  It is called by an LAPACK routine if an input parameter has an
127  invalid value.  A message is printed and execution stops.
128 
129  Installers may consider modifying the STOP statement in order to
130  call system-specific exception-handling facilities.
131 +/
132 int xerbla_(in char* srname, ref FortranInt info);