Switch to side-by-side view

--- a/LibDBlasM2.def
+++ b/LibDBlasM2.def
@@ -32,8 +32,9 @@
   (*   dasum     : sum of vector elements                                   *)
   (*   dgemv     : matrix vector operations                                 *)
   (*   dgemm     : matrix matrix operations                                 *)
+  (*   dger      : dyadic product of two vectors                            *)
+  (*   dgemv     : matrix vector operations (complex)                       *)
   (*   zgemm     : matrix matrix operations (complex)                       *)
-  (*   dger      : dyadic product of two vectors                            *)
   (*                                                                        *)
   (* Additional Routines                                                    *)
   (*                                                                        *)
@@ -42,9 +43,9 @@
   (*   ENorm     : Euklidian norm of a vector                               *)
   (*------------------------------------------------------------------------*)
 
-  (* $Id: LibDBlasM2.def,v 1.10 2017/10/29 09:55:06 mriedl Exp mriedl $ *)
-
-FROM Deklera IMPORT FLOAT; (* REAL type *)
+  (* $Id: LibDBlasM2.def,v 1.12 2018/09/12 13:20:49 mriedl Exp mriedl $ *)
+
+FROM Deklera IMPORT FLOAT,CFLOAT; (* REAL/COMPLEX Type *)
 
 PROCEDURE SumVek(VAR X   : ARRAY OF FLOAT;
                      s,e : CARDINAL) : FLOAT;
@@ -351,7 +352,7 @@
           (*           matrix op( A ) and the number of rows of the matrix  *)
           (*           op( B ). K must be at least zero.                    *)
           (*  Alpha  : On entry, Alpha specifies the scalar alpha.          *)
-          (*  A      : LONGREAL array of DIMENSION ( LDA, ka ), where ka is *)
+          (*  A      : FLOAT array of DIMENSION ( LDA, ka ), where ka is *)
           (*           k when  TransA = 'N' or 'n', and is m otherwise.     *)
           (*           Before entry with  TransA = 'N' or 'n', the leading  *)
           (*           m by k part of the array  A  must contain the matrix *)
@@ -362,7 +363,7 @@
           (*           declared in the calling (sub) program. When TransA = *)
           (*           'N' or 'n' then LDA must be at least  max( 1, m ),   *)
           (*           otherwise LDA must be at least  max( 1, k ).         *)
-          (*  B      : LONGREAL array of DIMENSION ( LDB, kb ),             *)
+          (*  B      : FLOAT array of DIMENSION ( LDB, kb ),             *)
           (*           where kb is n when  TransB = 'N' or 'n', and is  k   *)
           (*           otherwise. Before entry with TransB = 'N' or 'n',    *)
           (*           the leading  k by n  part of the array  B  must      *)
@@ -375,7 +376,7 @@
           (*           otherwise LDB must be at least  max( 1, n ).         *)
           (*  Beta   : On entry, Beta specifies the scalar beta. When Beta  *)
           (*           is supplied as zero then C need not be set on input. *)
-          (*  C      : LONGREAL array of DIMENSION ( LDC, n ).              *)
+          (*  C      : FLOAT array of DIMENSION ( LDC, n ).              *)
           (*           Before entry, the leading  m by n part of the array  *)
           (*           C must contain the matrix C, except when beta is     *)
           (*           zero, in which case C need not be set on entry.      *)
@@ -447,15 +448,162 @@
            (*                                                              *)
            (*--------------------------------------------------------------*)
 
+PROCEDURE zswap( N       : CARDINAL;
+                VAR X    : ARRAY OF CFLOAT;
+                    IncX : INTEGER;
+                VAR Y    : ARRAY OF CFLOAT;
+                    IncY : INTEGER);
+
+          (*----------------------------------------------------------------*)
+          (* Swap complex vectors X and Y                                   *)
+          (*----------------------------------------------------------------*)
+
+PROCEDURE zcopy(    N    : INTEGER;
+                VAR X    : ARRAY OF CFLOAT;
+                    IncX : INTEGER;
+                VAR Y    : ARRAY OF CFLOAT;
+                    IncY : INTEGER);
+
+          (*----------------------------------------------------------------*)
+          (* copies a vector, x, to a vector, y.                            *)
+          (* uses unrolled loops for increments equal to one.               *)
+          (* jack dongarra, linpack, 3/11/78.                               *)
+          (* MRi, Modula-2 10.04.16 | 09.09.18 (complex version)            *)
+          (*----------------------------------------------------------------*)
+
+PROCEDURE zdotc(    N    : INTEGER;
+                VAR X    : ARRAY OF CFLOAT;
+                    IncX : INTEGER;
+                VAR Y    : ARRAY OF CFLOAT;
+                    IncY : INTEGER) : CFLOAT;
+
+          (*----------------------------------------------------------------*)
+          (* Forms the dot product of two vectors. Uses unrolled loops for  *)
+          (* increments equal to one.                                       *)
+          (*----------------------------------------------------------------*)
+
+
+PROCEDURE dznrm2(    N    : INTEGER;
+                 VAR X    : ARRAY OF CFLOAT;
+                     IncX : INTEGER) : FLOAT;
+
+          (*----------------------------------------------------------------*)
+          (* dznrm2 returns the euclidean norm of a vector so that          *)
+          (* dznrm2 := sqrt( X**H*X )                                       *)
+          (*----------------------------------------------------------------*)
+
+PROCEDURE zscal(    n    : INTEGER;
+                    da   : CFLOAT;
+                VAR dx   : ARRAY OF CFLOAT;
+                    IncX : INTEGER);
+
+          (*----------------------------------------------------------------*)
+          (* Scales a vector by a constant (UNROLLED version)               *)
+          (*----------------------------------------------------------------*)
+
+PROCEDURE zaxpy(    n    : INTEGER;
+                    da   : CFLOAT;
+                VAR X    : ARRAY OF CFLOAT;
+                    IncX : INTEGER;
+                VAR Y    : ARRAY OF CFLOAT;
+                    IncY : INTEGER);
+
+          (*----------------------------------------------------------------*)
+          (* constant times a vector plus a vector                          *)
+          (*----------------------------------------------------------------*)
+
+PROCEDURE zdrot(    N    : INTEGER;
+                VAR X    : ARRAY OF CFLOAT;
+                    IncX : INTEGER;
+                VAR Y    : ARRAY OF CFLOAT;
+                    IncY : INTEGER;
+                    c,s  : FLOAT);
+
+          (*----------------------------------------------------------------*)
+          (* Applies a plane rotation, where the cos and sin (c and s) are  *)
+          (* real and the vectors cx and cy are complex.                    *)
+          (*----------------------------------------------------------------*)
+
+PROCEDURE zgemv(    Trans : CHAR; 
+                    M,N   : INTEGER;
+                    Alpha : CFLOAT;
+                VAR A     : ARRAY OF ARRAY OF CFLOAT;
+                    lda   : INTEGER;
+                VAR X     : ARRAY OF CFLOAT;
+                    IncX  : INTEGER;
+                    Beta  : CFLOAT;
+                VAR Y     : ARRAY OF CFLOAT;
+                    IncY  : INTEGER);
+
+          (*----------------------------------------------------------------*)
+          (* Performs one of the matrix-vector operations                   *)
+          (*                                                                *)
+          (*   Y = Alpha*      A  *x + Beta*Y,   or                         *)
+          (*   Y = Alpha*      A' *x + Beta*Y,   or                         *)
+          (*   Y = Alpha*conjg(A')*x + Beta*Y,;                             *)
+          (*                                                                *)
+          (* where Alpha and Beta are scalars, X and Y are vectors          *)
+          (* and A is an M by N matrix.                                     *)
+          (*                                                                *)
+          (* parameters                                                     *)
+          (*                                                                *)
+          (* Trans  : trans specifies the operation to be performed as      *)
+          (*          follows:                                              *)
+          (*                                                                *)
+          (*          trans = 'N' or 'n'  Y = Alpha*A*X + Beta*Y            *)
+          (*          trans = 'T' or 't'  Y = Alpha*A'*X + Beta*Y           *)
+          (*          trans = 'C' or 'c'  Y = Alpha*conjg(A')*X + Beta*Y    *)
+          (*                                                                *)
+          (*                                                                *)
+          (* M      : M specifies the number of rows of the matrix A.       *)
+          (*          M must be at least zero.                              *)
+          (* N      : N specifies the number of columns of the matrix A.    *)
+          (*          N must be at least zero.                              *)
+          (* Alpha  : Alpha specifies the scalar Alpha                      *)
+          (* A      : array of dimension (lda,N)                            *)
+          (*          Before entry, the leading M by N part of the          *)
+          (*          array A must contain the matrix of coefficients.      *)
+          (*          Unchanged on exit.                                    *)
+          (* lda    : on entry, lda specifies the first dimension           *)
+          (*          of A as declared in the calling (sub) program.        *)
+          (*          lda must be at least max(1,M).                        *)
+          (* X      : array of dimension at least (1+(n-1 )*abs(incx))      *)
+          (*          when trans = 'n' or 'N' and at least                  *)
+          (*          (1+(m-1 )*abs(incx)) otherwise.                       *)
+          (*          Before entry, the incremented array x must contain    *)
+          (*          the vector X. Unchanged on exit.                      *)
+          (* IncX   : IncX specifies the increment for the elements of      *)
+          (*          X. IncX must not be zero.                             *)
+          (* Beta   : Beta specifies the scalar Beta. When Beta is          *)
+          (*          supplied as zero then y need not be set on input.     *)
+          (*          Unchanged on exit.                                    *)
+          (* Y      : array of dimension at least (1+(m-1)*abs(incy))       *)
+          (*          when trans = 'N' or 'n' and at least                  *)
+          (*          (1+(n-1 *abs(incy)) otherwise.                        *)
+          (*          Before entry with beta non-zero, the incremented      *)
+          (*          array Y must contain the vector Y. On exit, Y is      *)
+          (*          overwritten by the updated vector Y.                  *)
+          (* IncY   : IncY specifies the increment for the elements of      *)
+          (*          Y. IncY must not be zero.                             *)
+          (*                                                                *)
+          (* level 2 blas routine.                                          *)
+          (*                                                                *)
+          (* -- written on 22-october-1986.                                 *)
+          (* Jack Dongarra, Argonne National Lab.                           *)
+          (* Jeremy du Croz, NAG central office.                            *)
+          (* Sven Hammarling, NAG central office.                           *)
+          (* Richard Hanson, Sandia National Labs.                          *)
+          (*----------------------------------------------------------------*)
+
 PROCEDURE zgemm(    TransA,TransB : CHAR;
                     M,N,K         : INTEGER;
-                    Alpha         : LONGCOMPLEX;
-                VAR A             : ARRAY OF ARRAY OF LONGCOMPLEX;
+                    Alpha         : CFLOAT;
+                VAR A             : ARRAY OF ARRAY OF CFLOAT;
                     LDA           : INTEGER;
-                VAR B             : ARRAY OF ARRAY OF LONGCOMPLEX;
+                VAR B             : ARRAY OF ARRAY OF CFLOAT;
                     LDB           : INTEGER;
-                    Beta          : LONGCOMPLEX;
-                VAR C             : ARRAY OF ARRAY OF LONGCOMPLEX;
+                    Beta          : CFLOAT;
+                VAR C             : ARRAY OF ARRAY OF CFLOAT;
                     LDC           : INTEGER);
 
           (*----------------------------------------------------------------*)