diff options
-rw-r--r-- | lib/Numeric/LinearAlgebra/LAPACK/f2c.h | 284 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h | 41 |
2 files changed, 40 insertions, 285 deletions
diff --git a/lib/Numeric/LinearAlgebra/LAPACK/f2c.h b/lib/Numeric/LinearAlgebra/LAPACK/f2c.h deleted file mode 100644 index 6a07e09..0000000 --- a/lib/Numeric/LinearAlgebra/LAPACK/f2c.h +++ /dev/null | |||
@@ -1,284 +0,0 @@ | |||
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 | |||
10 | /* | ||
11 | |||
12 | Extracted from http://opengrok.creo.hu/dragonfly/xref/src/contrib/gcc-3.4/libf2c/readme.netlib | ||
13 | |||
14 | NOTE: f2c.h defines several types, e.g., real, integer, doublereal. | ||
15 | 115 The definitions in f2c.h are suitable for most machines, but if | ||
16 | 116 your machine has sizeof(double) > 2*sizeof(long), you may need | ||
17 | 117 to adjust f2c.h appropriately. f2c assumes | ||
18 | 118 sizeof(doublecomplex) = 2*sizeof(doublereal) | ||
19 | 119 sizeof(doublereal) = sizeof(complex) | ||
20 | 120 sizeof(doublereal) = 2*sizeof(real) | ||
21 | 121 sizeof(real) = sizeof(integer) | ||
22 | 122 sizeof(real) = sizeof(logical) | ||
23 | 123 sizeof(real) = 2*sizeof(shortint) | ||
24 | 124 EQUIVALENCEs may not be translated correctly if these | ||
25 | 125 assumptions are violated. | ||
26 | 126 | ||
27 | 127 On machines, such as those using a DEC Alpha processor, on | ||
28 | 128 which sizeof(short) == 2, sizeof(int) == sizeof(float) == 4, | ||
29 | 129 and sizeof(long) == sizeof(double) == 8, it suffices to | ||
30 | 130 modify f2c.h by removing the first occurrence of "long " | ||
31 | 131 on each line containing "long ", e.g., by issuing the | ||
32 | 132 commands | ||
33 | 133 mv f2c.h f2c.h0 | ||
34 | 134 sed 's/long //' f2c.h0 >f2c.h | ||
35 | 135 On such machines, one can enable INTEGER*8 by uncommenting | ||
36 | 136 the typedef of longint in f2c.h, so it reads | ||
37 | 137 typedef long longint; | ||
38 | 138 by compiling libI77 with -DAllow_TYQUAD, and by adjusting | ||
39 | 139 libF77/makefile as described in libF77/README. | ||
40 | 140 | ||
41 | 141 Some machines may have sizeof(int) == 4, sizeof(float) == 8, | ||
42 | 142 and sizeof(long long) == 8. On such machines, adjust f2c.h | ||
43 | 143 by changing "long int " to "long long ", e.g., by saying | ||
44 | 144 mv f2c.h f2c.h0 | ||
45 | 145 sed 's/long int /long long /' f2c.h0 >f2c.h | ||
46 | 146 One can enable INTEGER*8 on such machines as described | ||
47 | 147 above, but with | ||
48 | 148 typedef long long longint; | ||
49 | |||
50 | I thing that the following definitions are correct: | ||
51 | |||
52 | */ | ||
53 | |||
54 | #ifdef _LP64 | ||
55 | typedef int integer; | ||
56 | typedef unsigned int uinteger; | ||
57 | typedef int logical; | ||
58 | typedef long longint; /* system-dependent */ | ||
59 | typedef unsigned long ulongint; /* system-dependent */ | ||
60 | #else | ||
61 | typedef long int integer; | ||
62 | typedef unsigned long int uinteger; | ||
63 | typedef long int logical; | ||
64 | typedef long long longint; /* system-dependent */ | ||
65 | typedef unsigned long long ulongint; /* system-dependent */ | ||
66 | #endif | ||
67 | |||
68 | typedef char *address; | ||
69 | typedef short int shortint; | ||
70 | typedef float real; | ||
71 | typedef double doublereal; | ||
72 | typedef struct { real r, i; } complex; | ||
73 | typedef struct { doublereal r, i; } doublecomplex; | ||
74 | typedef short int shortlogical; | ||
75 | typedef char logical1; | ||
76 | typedef char integer1; | ||
77 | #ifdef INTEGER_STAR_8 /* Adjust for integer*8. */ | ||
78 | #define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b))) | ||
79 | #define qbit_set(a,b) ((a) | ((ulongint)1 << (b))) | ||
80 | #endif | ||
81 | |||
82 | #define TRUE_ (1) | ||
83 | #define FALSE_ (0) | ||
84 | |||
85 | /* Extern is for use with -E */ | ||
86 | #ifndef Extern | ||
87 | #define Extern extern | ||
88 | #endif | ||
89 | |||
90 | /* I/O stuff */ | ||
91 | |||
92 | #ifdef f2c_i2 | ||
93 | /* for -i2 */ | ||
94 | typedef short flag; | ||
95 | typedef short ftnlen; | ||
96 | typedef short ftnint; | ||
97 | #else | ||
98 | |||
99 | #ifdef _LP64 | ||
100 | typedef int flag; | ||
101 | typedef int ftnlen; | ||
102 | typedef int ftnint; | ||
103 | #else | ||
104 | typedef long int flag; | ||
105 | typedef long int ftnlen; | ||
106 | typedef long int ftnint; | ||
107 | #endif | ||
108 | |||
109 | #endif | ||
110 | |||
111 | /*external read, write*/ | ||
112 | typedef struct | ||
113 | { flag cierr; | ||
114 | ftnint ciunit; | ||
115 | flag ciend; | ||
116 | char *cifmt; | ||
117 | ftnint cirec; | ||
118 | } cilist; | ||
119 | |||
120 | /*internal read, write*/ | ||
121 | typedef struct | ||
122 | { flag icierr; | ||
123 | char *iciunit; | ||
124 | flag iciend; | ||
125 | char *icifmt; | ||
126 | ftnint icirlen; | ||
127 | ftnint icirnum; | ||
128 | } icilist; | ||
129 | |||
130 | /*open*/ | ||
131 | typedef struct | ||
132 | { flag oerr; | ||
133 | ftnint ounit; | ||
134 | char *ofnm; | ||
135 | ftnlen ofnmlen; | ||
136 | char *osta; | ||
137 | char *oacc; | ||
138 | char *ofm; | ||
139 | ftnint orl; | ||
140 | char *oblnk; | ||
141 | } olist; | ||
142 | |||
143 | /*close*/ | ||
144 | typedef struct | ||
145 | { flag cerr; | ||
146 | ftnint cunit; | ||
147 | char *csta; | ||
148 | } cllist; | ||
149 | |||
150 | /*rewind, backspace, endfile*/ | ||
151 | typedef struct | ||
152 | { flag aerr; | ||
153 | ftnint aunit; | ||
154 | } alist; | ||
155 | |||
156 | /* inquire */ | ||
157 | typedef struct | ||
158 | { flag inerr; | ||
159 | ftnint inunit; | ||
160 | char *infile; | ||
161 | ftnlen infilen; | ||
162 | ftnint *inex; /*parameters in standard's order*/ | ||
163 | ftnint *inopen; | ||
164 | ftnint *innum; | ||
165 | ftnint *innamed; | ||
166 | char *inname; | ||
167 | ftnlen innamlen; | ||
168 | char *inacc; | ||
169 | ftnlen inacclen; | ||
170 | char *inseq; | ||
171 | ftnlen inseqlen; | ||
172 | char *indir; | ||
173 | ftnlen indirlen; | ||
174 | char *infmt; | ||
175 | ftnlen infmtlen; | ||
176 | char *inform; | ||
177 | ftnint informlen; | ||
178 | char *inunf; | ||
179 | ftnlen inunflen; | ||
180 | ftnint *inrecl; | ||
181 | ftnint *innrec; | ||
182 | char *inblank; | ||
183 | ftnlen inblanklen; | ||
184 | } inlist; | ||
185 | |||
186 | #define VOID void | ||
187 | |||
188 | union Multitype { /* for multiple entry points */ | ||
189 | integer1 g; | ||
190 | shortint h; | ||
191 | integer i; | ||
192 | /* longint j; */ | ||
193 | real r; | ||
194 | doublereal d; | ||
195 | complex c; | ||
196 | doublecomplex z; | ||
197 | }; | ||
198 | |||
199 | typedef union Multitype Multitype; | ||
200 | |||
201 | /*typedef long int Long;*/ /* No longer used; formerly in Namelist */ | ||
202 | |||
203 | struct Vardesc { /* for Namelist */ | ||
204 | char *name; | ||
205 | char *addr; | ||
206 | ftnlen *dims; | ||
207 | int type; | ||
208 | }; | ||
209 | typedef struct Vardesc Vardesc; | ||
210 | |||
211 | struct Namelist { | ||
212 | char *name; | ||
213 | Vardesc **vars; | ||
214 | int nvars; | ||
215 | }; | ||
216 | typedef struct Namelist Namelist; | ||
217 | |||
218 | #define abs(x) ((x) >= 0 ? (x) : -(x)) | ||
219 | #define dabs(x) (doublereal)abs(x) | ||
220 | #define min(a,b) ((a) <= (b) ? (a) : (b)) | ||
221 | #define max(a,b) ((a) >= (b) ? (a) : (b)) | ||
222 | #define dmin(a,b) (doublereal)min(a,b) | ||
223 | #define dmax(a,b) (doublereal)max(a,b) | ||
224 | #define bit_test(a,b) ((a) >> (b) & 1) | ||
225 | #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) | ||
226 | #define bit_set(a,b) ((a) | ((uinteger)1 << (b))) | ||
227 | |||
228 | /* procedure parameter types for -A and -C++ */ | ||
229 | |||
230 | #define F2C_proc_par_types 1 | ||
231 | #ifdef __cplusplus | ||
232 | typedef int /* Unknown procedure type */ (*U_fp)(...); | ||
233 | typedef shortint (*J_fp)(...); | ||
234 | typedef integer (*I_fp)(...); | ||
235 | typedef real (*R_fp)(...); | ||
236 | typedef doublereal (*D_fp)(...), (*E_fp)(...); | ||
237 | typedef /* Complex */ VOID (*C_fp)(...); | ||
238 | typedef /* Double Complex */ VOID (*Z_fp)(...); | ||
239 | typedef logical (*L_fp)(...); | ||
240 | typedef shortlogical (*K_fp)(...); | ||
241 | typedef /* Character */ VOID (*H_fp)(...); | ||
242 | typedef /* Subroutine */ int (*S_fp)(...); | ||
243 | #else | ||
244 | typedef int /* Unknown procedure type */ (*U_fp)(); | ||
245 | typedef shortint (*J_fp)(); | ||
246 | typedef integer (*I_fp)(); | ||
247 | typedef real (*R_fp)(); | ||
248 | typedef doublereal (*D_fp)(), (*E_fp)(); | ||
249 | typedef /* Complex */ VOID (*C_fp)(); | ||
250 | typedef /* Double Complex */ VOID (*Z_fp)(); | ||
251 | typedef logical (*L_fp)(); | ||
252 | typedef shortlogical (*K_fp)(); | ||
253 | typedef /* Character */ VOID (*H_fp)(); | ||
254 | typedef /* Subroutine */ int (*S_fp)(); | ||
255 | #endif | ||
256 | /* E_fp is for real functions when -R is not specified */ | ||
257 | typedef VOID C_f; /* complex function */ | ||
258 | typedef VOID H_f; /* character function */ | ||
259 | typedef VOID Z_f; /* double complex function */ | ||
260 | typedef doublereal E_f; /* real function with -R not specified */ | ||
261 | |||
262 | /* undef any lower-case symbols that your C compiler predefines, e.g.: */ | ||
263 | |||
264 | #ifndef Skip_f2c_Undefs | ||
265 | #undef cray | ||
266 | #undef gcos | ||
267 | #undef mc68010 | ||
268 | #undef mc68020 | ||
269 | #undef mips | ||
270 | #undef pdp11 | ||
271 | #undef sgi | ||
272 | #undef sparc | ||
273 | #undef sun | ||
274 | #undef sun2 | ||
275 | #undef sun3 | ||
276 | #undef sun4 | ||
277 | #undef u370 | ||
278 | #undef u3b | ||
279 | #undef u3b2 | ||
280 | #undef u3b5 | ||
281 | #undef unix | ||
282 | #undef vax | ||
283 | #endif | ||
284 | #endif | ||
diff --git a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h index bccd4b8..79e52be 100644 --- a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h +++ b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h | |||
@@ -1,6 +1,45 @@ | |||
1 | #include "f2c.h" | 1 | /* |
2 | * We have copied the definitions in f2c.h required | ||
3 | * to compile clapack.h, modified to support both | ||
4 | * 32 and 64 bit | ||
5 | |||
6 | http://opengrok.creo.hu/dragonfly/xref/src/contrib/gcc-3.4/libf2c/readme.netlib | ||
7 | http://www.ibm.com/developerworks/library/l-port64.html | ||
8 | */ | ||
9 | |||
10 | #ifdef _LP64 | ||
11 | typedef int integer; | ||
12 | typedef unsigned int uinteger; | ||
13 | typedef int logical; | ||
14 | typedef long longint; /* system-dependent */ | ||
15 | typedef unsigned long ulongint; /* system-dependent */ | ||
16 | #else | ||
17 | typedef long int integer; | ||
18 | typedef unsigned long int uinteger; | ||
19 | typedef long int logical; | ||
20 | typedef long long longint; /* system-dependent */ | ||
21 | typedef unsigned long long ulongint; /* system-dependent */ | ||
22 | #endif | ||
23 | |||
24 | typedef char *address; | ||
25 | typedef short int shortint; | ||
26 | typedef float real; | ||
27 | typedef double doublereal; | ||
28 | typedef struct { real r, i; } complex; | ||
29 | typedef struct { doublereal r, i; } doublecomplex; | ||
30 | typedef short int shortlogical; | ||
31 | typedef char logical1; | ||
32 | typedef char integer1; | ||
33 | |||
34 | typedef logical (*L_fp)(); | ||
35 | typedef short ftnlen; | ||
36 | |||
37 | /********************************************************/ | ||
38 | |||
2 | #include "clapack.h" | 39 | #include "clapack.h" |
3 | 40 | ||
41 | /********************************************************/ | ||
42 | |||
4 | #define DVEC(A) int A##n, double*A##p | 43 | #define DVEC(A) int A##n, double*A##p |
5 | #define CVEC(A) int A##n, double*A##p | 44 | #define CVEC(A) int A##n, double*A##p |
6 | #define DMAT(A) int A##r, int A##c, double* A##p | 45 | #define DMAT(A) int A##r, int A##c, double* A##p |