Switch to side-by-side view

--- a/LibDBlasL1F77.def.m2pp
+++ b/LibDBlasL1F77.def.m2pp
@@ -44,6 +44,15 @@
   (* * daxpy     : constant times a vector plus a vector                    *)
   (* * ddot      : dot product of two vectors                               *)
   (* * idamax    : index of vector element with largest absolute value      *)
+  (*                                                                        *)
+  (* * zswap     : Swap complex vectors X and Y                             *)
+  (* * zcopy     : copies a vector, x, to a vector, y.                      *)
+  (* * zdotu     : Forms the dot product of two vectors.                    *)
+  (* * zdotc     : Forms the dot product of two vectors                     *)
+  (* * dznrm2    : dznrm2 returns the euclidean norm of a vector            *)
+  (* * zscal     : Scales a vector by a constant                            *)
+  (* * zaxpy     : constant times a vector plus a vector                    *)
+  (*   zdrot     : plane rotation                                           *)
   (*------------------------------------------------------------------------*)
   (* Last change:                                                           *)
   (*                                                                        *)
@@ -52,44 +61,48 @@
   (* 02.12.15, MRi: Added dasum,dnrm2,idamax                                *)
   (* 30.03.16, MRi: Added dswap                                             *)
   (* 15.04.16, MRi: Added dcopy,drot,drotg                                  *)
-  (*                Changed ARRAY OF DOUBLEPRECISION to                     *)
-  (*                (* ARRAY OF *) DOUBLEPRECISION                          *)
+  (*                Changed ARRAY OF REAL8 to                               *)
+  (*                (* ARRAY OF *) REAL8                                    *)
   (* 01.11.17, MRi: Added idamin, made preprocessor interface               *)
+  (* 01.02.19, MRi: Renamed DOUBLEPRECISION to REAL8, DOUBLE COMPLEX TO     *)
+  (*                COMPLEX16 - all other modules now refer to that         *)
+  (*                Change GM2 types for floating point number back to      *)
+  (*                incorrect types - Fortran BLAS cannot be linked         *)
   (*------------------------------------------------------------------------*)
   (* Implementation : Michael Riedl                                         *)
   (* Licence        : GNU Lesser General Public License (LGPL)              *)
   (*------------------------------------------------------------------------*)
 
-  (* $Id: LibDBlasL1F77.def.m2pp,v 1.5 2018/09/12 13:20:49 mriedl Exp mriedl $ *)
+  (* $Id: LibDBlasL1F77.def.m2pp,v 1.7 2019/02/01 22:48:19 mriedl Exp mriedl $ *)
 
 <* IF (__XDS__) THEN *>
-CONST Version         = "LibDBlasL1F77 for XDS Modula-2";
-
-TYPE  DOUBLEPRECISION = LONGREAL;
-      DOUBLECOMPLEX   = LONGCOMPLEX;
-      REAL4           = REAL;
-      INTEGER4        = LONGINT;
+CONST Version   = "LibDBlasL1F77 for XDS Modula-2";
+
+TYPE  REAL8     = LONGREAL;
+      COMPLEX16 = LONGCOMPLEX;
+      REAL4     = REAL;
+      INTEGER4  = LONGINT;
 <* END *>
 <* IF (__GM2__) THEN *>
-CONST Version         = "LibDBlasL1F77 for GNU Modula-2";
-
-TYPE  DOUBLEPRECISION = REAL;     (* Untested !!! *)
-      DOUBLECOMPLEX   = COMPLEX;  (* Untested !!! *)
-      REAL4           = SHORTREAL;
-      INTEGER4        = INTEGER;
+CONST Version   = "LibDBlasL1F77 for GNU Modula-2";
+
+TYPE  REAL8     = LONGREAL;     (* REAL Untested !!! *)
+      COMPLEX16 = LONGCOMPLEX;  (* Untested !!! *)
+      REAL4     = SHORTREAL;
+      INTEGER4  = INTEGER;
 <* END *>
 <* IF (__MOCKA__) THEN *>
-CONST Version         = "LibDBlasL1F77 for GMD Mocka";
-
-TYPE  DOUBLEPRECISION = LONGREAL;
-      REAL4           = REAL;
-      INTEGER4        = LONGINT;
-<* END *>
-      CHAR1           = CHAR;
+CONST Version   = "LibDBlasL1F77 for GMD Mocka";
+
+TYPE  REAL8     = LONGREAL;
+      REAL4     = REAL;
+      INTEGER4  = LONGINT;
+<* END *>
+      CHAR1     = CHAR;
 
 PROCEDURE dnrm2_(VAR n    : INTEGER4;
-                 VAR X    : (* ARRAY OF *) DOUBLEPRECISION;
-                 VAR IncX : INTEGER4): DOUBLEPRECISION;
+                 VAR X    : (* ARRAY OF *) REAL8;
+                 VAR IncX : INTEGER4): REAL8;
 
           (*----------------------------------------------------------------*)
           (* dnrm2 returns the euclidean norm of a vector via the function  *)
@@ -97,9 +110,9 @@
           (*----------------------------------------------------------------*)
 
 PROCEDURE dswap_(VAR N    : INTEGER4;
-                 VAR X    : (* ARRAY OF *) DOUBLEPRECISION;  
+                 VAR X    : (* ARRAY OF *) REAL8;  
                  VAR incx : INTEGER4;  
-                 VAR Y    : (* ARRAY OF *) DOUBLEPRECISION;
+                 VAR Y    : (* ARRAY OF *) REAL8;
                  VAR incy : INTEGER4);
 
           (*----------------------------------------------------------------*)
@@ -108,9 +121,9 @@
           (*----------------------------------------------------------------*)
 
 PROCEDURE dcopy_(VAR N    : INTEGER4;
-                 VAR X    : (* ARRAY OF *) DOUBLEPRECISION;
-                 VAR IncX : INTEGER4;
-                 VAR Y    : (* ARRAY OF *) DOUBLEPRECISION;
+                 VAR X    : (* ARRAY OF *) REAL8;
+                 VAR IncX : INTEGER4;
+                 VAR Y    : (* ARRAY OF *) REAL8;
                  VAR IncY : INTEGER);
 
           (*----------------------------------------------------------------*)
@@ -120,21 +133,21 @@
           (*----------------------------------------------------------------*)
 
 PROCEDURE drot_(VAR N    : INTEGER4;  
-                VAR X    : (* ARRAY OF *) DOUBLEPRECISION;  
+                VAR X    : (* ARRAY OF *) REAL8;  
                 VAR incX : INTEGER4;
-                VAR Y    : (* ARRAY OF *) DOUBLEPRECISION;
+                VAR Y    : (* ARRAY OF *) REAL8;
                 VAR incY : INTEGER4; 
-                VAR c,s  : DOUBLEPRECISION);
+                VAR c,s  : REAL8);
 
           (*---------------------------------------------------------------*)
           (* Applies a plane rotation.                                     *)
           (* Jack Dongarra, linpack, 3/11/78.                              *)
           (*---------------------------------------------------------------*)
 
-PROCEDURE drotg_(VAR da : DOUBLEPRECISION;  
-                 VAR db : DOUBLEPRECISION;  
-                 VAR c  : DOUBLEPRECISION;  
-                 VAR s  : DOUBLEPRECISION);
+PROCEDURE drotg_(VAR da : REAL8;  
+                 VAR db : REAL8;  
+                 VAR c  : REAL8;  
+                 VAR s  : REAL8);
 
           (*---------------------------------------------------------------*)
           (* Construct a Givens plane rotation                             *)
@@ -142,8 +155,8 @@
           (*---------------------------------------------------------------*)
 
 PROCEDURE dscal_(VAR n    : INTEGER4;
-                 VAR da   : DOUBLEPRECISION;
-                 VAR dx   : (* ARRAY OF *) DOUBLEPRECISION; 
+                 VAR da   : REAL8;
+                 VAR dx   : (* ARRAY OF *) REAL8; 
                  VAR incx : INTEGER4);
 
           (*----------------------------------------------------------------*)
@@ -151,10 +164,10 @@
           (*----------------------------------------------------------------*)
 
 PROCEDURE daxpy_(VAR n    : INTEGER4;
-                 VAR da   : DOUBLEPRECISION;
-                 VAR dx   : (* ARRAY OF *) DOUBLEPRECISION; 
+                 VAR da   : REAL8;
+                 VAR dx   : (* ARRAY OF *) REAL8; 
                  VAR incx : INTEGER4;
-                 VAR dy   : (* ARRAY OF *) DOUBLEPRECISION; 
+                 VAR dy   : (* ARRAY OF *) REAL8; 
                  VAR incy : INTEGER4);
 
           (*----------------------------------------------------------------*)
@@ -162,17 +175,17 @@
           (*----------------------------------------------------------------*)
 
 PROCEDURE ddot_(VAR N    : INTEGER4;
-                VAR DX   : (* ARRAY OF *) DOUBLEPRECISION;
+                VAR DX   : (* ARRAY OF *) REAL8;
                 VAR INCX : INTEGER4;
-                VAR DY   : (* ARRAY OF *) DOUBLEPRECISION;
-                VAR INCY : INTEGER4) : DOUBLEPRECISION;
+                VAR DY   : (* ARRAY OF *) REAL8;
+                VAR INCY : INTEGER4) : REAL8;
 
           (*----------------------------------------------------------------*)
           (* Forms the dot product of two vectors                           *)
           (*----------------------------------------------------------------*)
 
 PROCEDURE idamax_(VAR n    : INTEGER4;
-                  VAR dx   : (* ARRAY OF *) DOUBLEPRECISION;
+                  VAR dx   : (* ARRAY OF *) REAL8;
                   VAR incx : INTEGER4) : INTEGER4;
 
           (*----------------------------------------------------------------*)
@@ -180,7 +193,7 @@
           (*----------------------------------------------------------------*)
 
 PROCEDURE idamin_(VAR n    : INTEGER4;
-                  VAR dx   : (* ARRAY OF *) DOUBLEPRECISION;
+                  VAR dx   : (* ARRAY OF *) REAL8;
                   VAR incx : INTEGER4) : INTEGER4;
 
           (*----------------------------------------------------------------*)
@@ -188,8 +201,8 @@
           (*----------------------------------------------------------------*)
 
 PROCEDURE dasum_(VAR dim      : INTEGER4;
-                 VAR X        : (* ARRAY OF *) DOUBLEPRECISION;
-                 VAR Inc      : INTEGER4) : DOUBLEPRECISION;
+                 VAR X        : (* ARRAY OF *) REAL8;
+                 VAR Inc      : INTEGER4) : REAL8;
 
           (*----------------------------------------------------------------*)
           (* Berechnet die Summe der Absolutwerte der im Feld X gespeich-   *)
@@ -201,9 +214,9 @@
 (*=========================== Complex valued procedures ====================*)
 
 PROCEDURE zswap_(VAR N    : INTEGER4;
-                 VAR X    : (* ARRAY OF *) DOUBLECOMPLEX;
-                 VAR IncX : INTEGER4;
-                 VAR Y    : (* ARRAY OF *) DOUBLECOMPLEX;
+                 VAR X    : (* ARRAY OF *) COMPLEX16;
+                 VAR IncX : INTEGER4;
+                 VAR Y    : (* ARRAY OF *) COMPLEX16;
                  VAR IncY : INTEGER4);
 
           (*----------------------------------------------------------------*)
@@ -211,9 +224,9 @@
           (*----------------------------------------------------------------*)
 
 PROCEDURE zcopy_(VAR N    : INTEGER4;
-                 VAR X    : (* ARRAY OF *) DOUBLECOMPLEX;
-                 VAR IncX : INTEGER4;
-                 VAR Y    : (* ARRAY OF *) DOUBLECOMPLEX;
+                 VAR X    : (* ARRAY OF *) COMPLEX16;
+                 VAR IncX : INTEGER4;
+                 VAR Y    : (* ARRAY OF *) COMPLEX16;
                  VAR IncY : INTEGER4);
 
           (*----------------------------------------------------------------*)
@@ -223,20 +236,31 @@
           (* MRi, Modula-2 10.04.16 | 09.09.18 (complex version)            *)
           (*----------------------------------------------------------------*)
 
-PROCEDURE zdotc_(VAR N    : INTEGER4;
-                 VAR X    : (* ARRAY OF *) DOUBLECOMPLEX;
-                 VAR IncX : INTEGER4;
-                 VAR Y    : (* ARRAY OF *) DOUBLECOMPLEX;
-                 VAR IncY : INTEGER4) : DOUBLECOMPLEX;
+PROCEDURE zdotu_(VAR N    : INTEGER4;
+                 VAR X    : (* ARRAY OF *) COMPLEX16;
+                 VAR IncX : INTEGER4;
+                 VAR Y    : (* ARRAY OF *) COMPLEX16;
+                 VAR IncY : INTEGER4) : COMPLEX16;
 
           (*----------------------------------------------------------------*)
           (* Forms the dot product of two vectors. Uses unrolled loops for  *)
           (* increments equal to one.                                       *)
           (*----------------------------------------------------------------*)
 
+PROCEDURE zdotc_(VAR N    : INTEGER4;
+                 VAR X    : (* ARRAY OF *) COMPLEX16;
+                 VAR IncX : INTEGER4;
+                 VAR Y    : (* ARRAY OF *) COMPLEX16;
+                 VAR IncY : INTEGER4) : COMPLEX16;
+
+          (*----------------------------------------------------------------*)
+          (* Forms the dot product of two vectors conj(X)*Y                 *)
+          (* Uses unrolled loops for increments equal to one.               *)
+          (*----------------------------------------------------------------*)
+
 PROCEDURE dznrm2_(VAR N    : INTEGER4;
-                  VAR X    : (* ARRAY OF *) DOUBLECOMPLEX;
-                  VAR IncX : INTEGER4) : DOUBLEPRECISION;
+                  VAR X    : (* ARRAY OF *) COMPLEX16;
+                  VAR IncX : INTEGER4) : REAL8;
 
           (*----------------------------------------------------------------*)
           (* dznrm2 returns the euclidean norm of a vector so that          *)
@@ -244,8 +268,8 @@
           (*----------------------------------------------------------------*)
 
 PROCEDURE zscal_(VAR n    : INTEGER4;
-                 VAR da   : DOUBLECOMPLEX;
-                 VAR dx   : (* ARRAY OF *) DOUBLECOMPLEX;
+                 VAR da   : COMPLEX16;
+                 VAR dx   : (* ARRAY OF *) COMPLEX16;
                  VAR IncX : INTEGER4);
 
           (*----------------------------------------------------------------*)
@@ -253,10 +277,10 @@
           (*----------------------------------------------------------------*)
 
 PROCEDURE zaxpy_(VAR n    : INTEGER4;
-                 VAR da   : DOUBLECOMPLEX;
-                 VAR X    : (* ARRAY OF *) DOUBLECOMPLEX;
-                 VAR IncX : INTEGER4;
-                 VAR Y    : (* ARRAY OF *) DOUBLECOMPLEX;
+                 VAR da   : COMPLEX16;
+                 VAR X    : (* ARRAY OF *) COMPLEX16;
+                 VAR IncX : INTEGER4;
+                 VAR Y    : (* ARRAY OF *) COMPLEX16;
                  VAR IncY : INTEGER4);
 
           (*----------------------------------------------------------------*)
@@ -264,9 +288,9 @@
           (*----------------------------------------------------------------*)
 
 PROCEDURE zdrot_(VAR N    : INTEGER4;
-                 VAR X    : (* ARRAY OF *) DOUBLECOMPLEX;
-                 VAR IncX : INTEGER4;
-                 VAR Y    : (* ARRAY OF *) DOUBLECOMPLEX;
+                 VAR X    : (* ARRAY OF *) COMPLEX16;
+                 VAR IncX : INTEGER4;
+                 VAR Y    : (* ARRAY OF *) COMPLEX16;
                  VAR IncY : INTEGER4;
                  VAR c,s  : REAL4);