summaryrefslogtreecommitdiff
path: root/lib/LAPACK/f2c.h
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2007-06-07 11:13:32 +0000
committerAlberto Ruiz <aruiz@um.es>2007-06-07 11:13:32 +0000
commit92b1ed5e7fcbebbfbcde34206c040a8472d847d9 (patch)
tree6f22b46ea656490e6392a005321e6d5f7da0898d /lib/LAPACK/f2c.h
parente7c03c1ab4de85e7a700d2eafaebd37f4607c51f (diff)
adapting lapack wrappers
Diffstat (limited to 'lib/LAPACK/f2c.h')
-rw-r--r--lib/LAPACK/f2c.h223
1 files changed, 223 insertions, 0 deletions
diff --git a/lib/LAPACK/f2c.h b/lib/LAPACK/f2c.h
new file mode 100644
index 0000000..b94ee7c
--- /dev/null
+++ b/lib/LAPACK/f2c.h
@@ -0,0 +1,223 @@
1/* f2c.h -- Standard Fortran to C header file */
2
3/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
4
5 - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
6
7#ifndef F2C_INCLUDE
8#define F2C_INCLUDE
9
10typedef long int integer;
11typedef unsigned long int uinteger;
12typedef char *address;
13typedef short int shortint;
14typedef float real;
15typedef double doublereal;
16typedef struct { real r, i; } complex;
17typedef struct { doublereal r, i; } doublecomplex;
18typedef long int logical;
19typedef short int shortlogical;
20typedef char logical1;
21typedef char integer1;
22#ifdef INTEGER_STAR_8 /* Adjust for integer*8. */
23typedef long long longint; /* system-dependent */
24typedef unsigned long long ulongint; /* system-dependent */
25#define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b)))
26#define qbit_set(a,b) ((a) | ((ulongint)1 << (b)))
27#endif
28
29#define TRUE_ (1)
30#define FALSE_ (0)
31
32/* Extern is for use with -E */
33#ifndef Extern
34#define Extern extern
35#endif
36
37/* I/O stuff */
38
39#ifdef f2c_i2
40/* for -i2 */
41typedef short flag;
42typedef short ftnlen;
43typedef short ftnint;
44#else
45typedef long int flag;
46typedef long int ftnlen;
47typedef long int ftnint;
48#endif
49
50/*external read, write*/
51typedef struct
52{ flag cierr;
53 ftnint ciunit;
54 flag ciend;
55 char *cifmt;
56 ftnint cirec;
57} cilist;
58
59/*internal read, write*/
60typedef struct
61{ flag icierr;
62 char *iciunit;
63 flag iciend;
64 char *icifmt;
65 ftnint icirlen;
66 ftnint icirnum;
67} icilist;
68
69/*open*/
70typedef struct
71{ flag oerr;
72 ftnint ounit;
73 char *ofnm;
74 ftnlen ofnmlen;
75 char *osta;
76 char *oacc;
77 char *ofm;
78 ftnint orl;
79 char *oblnk;
80} olist;
81
82/*close*/
83typedef struct
84{ flag cerr;
85 ftnint cunit;
86 char *csta;
87} cllist;
88
89/*rewind, backspace, endfile*/
90typedef struct
91{ flag aerr;
92 ftnint aunit;
93} alist;
94
95/* inquire */
96typedef struct
97{ flag inerr;
98 ftnint inunit;
99 char *infile;
100 ftnlen infilen;
101 ftnint *inex; /*parameters in standard's order*/
102 ftnint *inopen;
103 ftnint *innum;
104 ftnint *innamed;
105 char *inname;
106 ftnlen innamlen;
107 char *inacc;
108 ftnlen inacclen;
109 char *inseq;
110 ftnlen inseqlen;
111 char *indir;
112 ftnlen indirlen;
113 char *infmt;
114 ftnlen infmtlen;
115 char *inform;
116 ftnint informlen;
117 char *inunf;
118 ftnlen inunflen;
119 ftnint *inrecl;
120 ftnint *innrec;
121 char *inblank;
122 ftnlen inblanklen;
123} inlist;
124
125#define VOID void
126
127union Multitype { /* for multiple entry points */
128 integer1 g;
129 shortint h;
130 integer i;
131 /* longint j; */
132 real r;
133 doublereal d;
134 complex c;
135 doublecomplex z;
136 };
137
138typedef union Multitype Multitype;
139
140/*typedef long int Long;*/ /* No longer used; formerly in Namelist */
141
142struct Vardesc { /* for Namelist */
143 char *name;
144 char *addr;
145 ftnlen *dims;
146 int type;
147 };
148typedef struct Vardesc Vardesc;
149
150struct Namelist {
151 char *name;
152 Vardesc **vars;
153 int nvars;
154 };
155typedef struct Namelist Namelist;
156
157#define abs(x) ((x) >= 0 ? (x) : -(x))
158#define dabs(x) (doublereal)abs(x)
159#define min(a,b) ((a) <= (b) ? (a) : (b))
160#define max(a,b) ((a) >= (b) ? (a) : (b))
161#define dmin(a,b) (doublereal)min(a,b)
162#define dmax(a,b) (doublereal)max(a,b)
163#define bit_test(a,b) ((a) >> (b) & 1)
164#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
165#define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
166
167/* procedure parameter types for -A and -C++ */
168
169#define F2C_proc_par_types 1
170#ifdef __cplusplus
171typedef int /* Unknown procedure type */ (*U_fp)(...);
172typedef shortint (*J_fp)(...);
173typedef integer (*I_fp)(...);
174typedef real (*R_fp)(...);
175typedef doublereal (*D_fp)(...), (*E_fp)(...);
176typedef /* Complex */ VOID (*C_fp)(...);
177typedef /* Double Complex */ VOID (*Z_fp)(...);
178typedef logical (*L_fp)(...);
179typedef shortlogical (*K_fp)(...);
180typedef /* Character */ VOID (*H_fp)(...);
181typedef /* Subroutine */ int (*S_fp)(...);
182#else
183typedef int /* Unknown procedure type */ (*U_fp)();
184typedef shortint (*J_fp)();
185typedef integer (*I_fp)();
186typedef real (*R_fp)();
187typedef doublereal (*D_fp)(), (*E_fp)();
188typedef /* Complex */ VOID (*C_fp)();
189typedef /* Double Complex */ VOID (*Z_fp)();
190typedef logical (*L_fp)();
191typedef shortlogical (*K_fp)();
192typedef /* Character */ VOID (*H_fp)();
193typedef /* Subroutine */ int (*S_fp)();
194#endif
195/* E_fp is for real functions when -R is not specified */
196typedef VOID C_f; /* complex function */
197typedef VOID H_f; /* character function */
198typedef VOID Z_f; /* double complex function */
199typedef doublereal E_f; /* real function with -R not specified */
200
201/* undef any lower-case symbols that your C compiler predefines, e.g.: */
202
203#ifndef Skip_f2c_Undefs
204#undef cray
205#undef gcos
206#undef mc68010
207#undef mc68020
208#undef mips
209#undef pdp11
210#undef sgi
211#undef sparc
212#undef sun
213#undef sun2
214#undef sun3
215#undef sun4
216#undef u370
217#undef u3b
218#undef u3b2
219#undef u3b5
220#undef unix
221#undef vax
222#endif
223#endif