f2c.h

Go to the documentation of this file.
00001 /* This is also plain -*-c-*-
00002 
00003 // Copyright (C) 2004 
00004 // Christian Stimming <stimming@tuhh.de>
00005 
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public License as
00008 // published by the Free Software Foundation; either version 2, or (at
00009 // your option) any later version.
00010 
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU Lesser General Public License for more details.
00015 
00016 // You should have received a copy of the GNU Lesser General Public License along
00017 // with this library; see the file COPYING.  If not, write to the Free
00018 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
00019 // USA.
00020 */
00021 
00022 /*
00023 // NOTE: this is a modified file of f2c.h to work with most C++ compilers.
00024 //       f2c.h for example, defines abs() as a macro, casuing parsing
00025 //       problems when it encounters abs() in stdlib.h, and so on.
00026 //       It is needed in Lapack++ because some of the C/Lapack functions, like
00027 //       ilaenv_(), need to know what ftn_len is (system dependent.)
00028 //
00029 //       pow_ri() has been removed, since it collides with
00030 //       sunmath.h on SUN4s.
00031 //
00032 //        "typedef float real" has been removed, due to conflict with
00033 //        AT&T CC with real() for complex.
00034 //
00035 //        "typedef ... complex" has been renamed to f2c_complex to
00036 //        avoid conflicts with C++ complex class.
00037 */
00038 
00045 #ifndef _F2C_INCLUDE_H
00046 #define _F2C_INCLUDE_H
00047 
00048 typedef long int integer;
00049 typedef char *address;
00050 typedef short int shortint;
00051 typedef float f2c_real;
00052 typedef double doublereal;
00053 typedef struct { f2c_real r, i; } f2c_complex;
00061 typedef struct { doublereal r, i; } doublecomplex;
00062 typedef long int logical;
00063 typedef short int shortlogical;
00064 
00065 #define TRUE_ (1)
00066 #define FALSE_ (0)
00067 
00068 /* Extern is for use with -E */
00069 #ifndef Extern
00070 #define Extern extern
00071 #endif
00072 
00073 extern int ungetc();    /* This is not declared in Sun's <stdio.h> */
00074 
00075 /* I/O stuff */
00076 #ifndef DOXYGEN_IGNORE
00077 
00078 #ifdef f2c_i2
00079 /* for -i2 */
00080 typedef short flag;
00081 typedef short ftnlen;
00082 typedef short ftnint;
00083 #else
00084 typedef long flag;
00085 typedef long ftnlen;
00086 typedef long ftnint;
00087 #endif /* f2c_i2 */
00088 
00089 /*external read, write*/
00090 typedef struct
00091 {   flag cierr;
00092     ftnint ciunit;
00093     flag ciend;
00094     char *cifmt;
00095     ftnint cirec;
00096 } cilist;
00097 
00098 /*internal read, write*/
00099 typedef struct
00100 {   flag icierr;
00101     char *iciunit;
00102     flag iciend;
00103     char *icifmt;
00104     ftnint icirlen;
00105     ftnint icirnum;
00106 } icilist;
00107 
00108 /*open*/
00109 typedef struct
00110 {   flag oerr;
00111     ftnint ounit;
00112     char *ofnm;
00113     ftnlen ofnmlen;
00114     char *osta;
00115     char *oacc;
00116     char *ofm;
00117     ftnint orl;
00118     char *oblnk;
00119 } olist;
00120 
00121 /*close*/
00122 typedef struct
00123 {   flag cerr;
00124     ftnint cunit;
00125     char *csta;
00126 } cllist;
00127 
00128 /*rewind, backspace, endfile*/
00129 typedef struct
00130 {   flag aerr;
00131     ftnint aunit;
00132 } alist;
00133 
00134 /* inquire */
00135 typedef struct
00136 {   flag inerr;
00137     ftnint inunit;
00138     char *infile;
00139     ftnlen infilen;
00140     ftnint  *inex;  /*parameters in standard's order*/
00141     ftnint  *inopen;
00142     ftnint  *innum;
00143     ftnint  *innamed;
00144     char    *inname;
00145     ftnlen  innamlen;
00146     char    *inacc;
00147     ftnlen  inacclen;
00148     char    *inseq;
00149     ftnlen  inseqlen;
00150     char    *indir;
00151     ftnlen  indirlen;
00152     char    *infmt;
00153     ftnlen  infmtlen;
00154     char    *inform;
00155     ftnint  informlen;
00156     char    *inunf;
00157     ftnlen  inunflen;
00158     ftnint  *inrecl;
00159     ftnint  *innrec;
00160     char    *inblank;
00161     ftnlen  inblanklen;
00162 } inlist;
00163 
00164 #define VOID void
00165 
00166 union Multitype {   /* for multiple entry points */
00167     shortint h;
00168     integer i;
00169     f2c_real r;
00170     doublereal d;
00171     f2c_complex c;
00172     doublecomplex z;
00173     };
00174 
00175 typedef union Multitype Multitype;
00176 
00177 typedef long Long;  /* No longer used; formerly in Namelist */
00178 
00179 struct Vardesc {    /* for Namelist */
00180     char *name;
00181     char *addr;
00182     ftnlen *dims;
00183     int  type;
00184     };
00185 typedef struct Vardesc Vardesc;
00186 
00187 struct Namelist {
00188     char *name;
00189     Vardesc **vars;
00190     int nvars;
00191     };
00192 typedef struct Namelist Namelist;
00193 
00194 /* procedure parameter types for -A and -C++ */
00195 #endif /* DOXYGEN_IGNORE */
00196 
00197 #define F2C_proc_par_types 1
00198 #ifdef __cplusplus
00199 typedef int /* Unknown procedure type */ (*U_fp)(...);
00200 typedef shortint (*J_fp)(...);
00201 typedef integer (*I_fp)(...);
00202 typedef f2c_real (*R_fp)(...);
00203 typedef doublereal (*D_fp)(...), (*E_fp)(...);
00204 typedef /* Complex */ VOID (*C_fp)(...);
00205 typedef /* Double Complex */ VOID (*Z_fp)(...);
00206 typedef logical (*L_fp)(...);
00207 typedef shortlogical (*K_fp)(...);
00208 typedef /* Character */ VOID (*H_fp)(...);
00209 typedef /* Subroutine */ int (*S_fp)(...);
00210 #else /* __cplusplus */
00211 typedef int /* Unknown procedure type */ (*U_fp)();
00212 typedef shortint (*J_fp)();
00213 typedef integer (*I_fp)();
00214 typedef f2c_real (*R_fp)();
00215 typedef doublereal (*D_fp)(), (*E_fp)();
00216 typedef /* Complex */ VOID (*C_fp)();
00217 typedef /* Double Complex */ VOID (*Z_fp)();
00218 typedef logical (*L_fp)();
00219 typedef shortlogical (*K_fp)();
00220 typedef /* Character */ VOID (*H_fp)();
00221 typedef /* Subroutine */ int (*S_fp)();
00222 #endif /* __cplusplus */
00223 /* E_fp is for real functions when -R is not specified */
00224 typedef VOID C_f;   /* (single precision ) complex function */
00225 typedef VOID H_f;   /* character function */
00226 typedef VOID Z_f;   /* double complex function */
00227 typedef doublereal E_f; /* real function with -R not specified */
00228 
00229 /* undef any lower-case symbols that your C compiler predefines, e.g.: */
00230 
00231 #ifndef Skip_f2c_Undefs
00232 #undef cray
00233 #undef gcos
00234 #undef mc68010
00235 #undef mc68020
00236 #undef mips
00237 #undef pdp11
00238 #undef sgi
00239 #undef sparc
00240 #undef sun
00241 #undef sun2
00242 #undef sun3
00243 #undef sun4
00244 #undef u370
00245 #undef u3b
00246 #undef u3b2
00247 #undef u3b5
00248 #undef unix
00249 #undef vax
00250 #endif /* Skip_f2c_Undefs */
00251 
00252 
00253 /* If you are using a C++ compiler, append the following to f2c.h
00254    for compiling libF77 and libI77. */
00255 
00256 #ifdef __cplusplus
00257 extern "C" {
00258 extern int abort_(void);
00259 extern double c_abs(f2c_complex *);
00260 extern void c_cos(f2c_complex *, f2c_complex *);
00261 extern void c_div(f2c_complex *, f2c_complex *, f2c_complex *);
00262 extern void c_exp(f2c_complex *, f2c_complex *);
00263 extern void c_log(f2c_complex *, f2c_complex *);
00264 extern void c_sin(f2c_complex *, f2c_complex *);
00265 extern void c_sqrt(f2c_complex *, f2c_complex *);
00266 extern double d_abs(double *);
00267 extern double d_acos(double *);
00268 extern double d_asin(double *);
00269 extern double d_atan(double *);
00270 extern double d_atn2(double *, double *);
00271 extern void d_cnjg(doublecomplex *, doublecomplex *);
00272 extern double d_cos(double *);
00273 extern double d_cosh(double *);
00274 extern double d_dim(double *, double *);
00275 extern double d_exp(double *);
00276 extern double d_imag(doublecomplex *);
00277 extern double d_int(double *);
00278 extern double d_lg10(double *);
00279 extern double d_log(double *);
00280 extern double d_mod(double *, double *);
00281 extern double d_nint(double *);
00282 extern double d_prod(float *, float *);
00283 extern double d_sign(double *, double *);
00284 extern double d_sin(double *);
00285 extern double d_sinh(double *);
00286 extern double d_sqrt(double *);
00287 extern double d_tan(double *);
00288 extern double d_tanh(double *);
00289 extern double derf_(double *);
00290 extern double derfc_(double *);
00291 extern integer do_fio(ftnint *, char *, ftnlen);
00292 extern integer do_lio(ftnint *, ftnint *, char *, ftnlen);
00293 extern integer do_uio(ftnint *, char *, ftnlen);
00294 extern integer e_rdfe(void);
00295 extern integer e_rdue(void);
00296 extern integer e_rsfe(void);
00297 extern integer e_rsfi(void);
00298 extern integer e_rsle(void);
00299 extern integer e_rsli(void);
00300 extern integer e_rsue(void);
00301 extern integer e_wdfe(void);
00302 extern integer e_wdue(void);
00303 extern integer e_wsfe(void);
00304 extern integer e_wsfi(void);
00305 extern integer e_wsle(void);
00306 extern integer e_wsli(void);
00307 extern integer e_wsue(void);
00308 extern int ef1asc_(ftnint *, ftnlen *, ftnint *, ftnlen *);
00309 extern integer ef1cmc_(ftnint *, ftnlen *, ftnint *, ftnlen *);
00310 /*
00311   #if defined(OS_WIN32) || LAPACK_OS_WIN32 || defined(OS_freebsd)
00312   extern double erf(double);
00313   extern double erfc(double);
00314   #else
00315   extern double erf(double) throw ();
00316   extern double erfc(double) throw ();
00317   #endif
00318 */
00319 /* 2004-09-08 Christian Stimming <stimming@tuhh.de>: Remove
00320    declaration of erf() and erfc() since they cause trouble with
00321    FreeBSD and they seem to be unneeded anyway. */
00322 extern double erf_(float *);
00323 extern double erfc_(float *);
00324 extern integer f_back(alist *);
00325 extern integer f_clos(cllist *);
00326 extern integer f_end(alist *);
00327 extern void f_exit(void);
00328 extern integer f_inqu(inlist *);
00329 extern integer f_open(olist *);
00330 extern integer f_rew(alist *);
00331 extern int flush_(void);
00332 extern void getarg_(integer *, char *, ftnlen);
00333 extern void getenv_(char *, char *, ftnlen, ftnlen);
00334 extern short h_abs(short *);
00335 extern short h_dim(short *, short *);
00336 extern short h_dnnt(double *);
00337 extern short h_indx(char *, char *, ftnlen, ftnlen);
00338 extern short h_len(char *, ftnlen);
00339 extern short h_mod(short *, short *);
00340 extern short h_nint(float *);
00341 extern short h_sign(short *, short *);
00342 extern short hl_ge(char *, char *, ftnlen, ftnlen);
00343 extern short hl_gt(char *, char *, ftnlen, ftnlen);
00344 extern short hl_le(char *, char *, ftnlen, ftnlen);
00345 extern short hl_lt(char *, char *, ftnlen, ftnlen);
00346 extern integer i_abs(integer *);
00347 extern integer i_dim(integer *, integer *);
00348 extern integer i_dnnt(double *);
00349 extern integer i_indx(char *, char *, ftnlen, ftnlen);
00350 extern integer i_len(char *, ftnlen);
00351 extern integer i_mod(integer *, integer *);
00352 extern integer i_nint(float *);
00353 extern integer i_sign(integer *, integer *);
00354 extern integer iargc_(void);
00355 extern ftnlen l_ge(char *, char *, ftnlen, ftnlen);
00356 extern ftnlen l_gt(char *, char *, ftnlen, ftnlen);
00357 extern ftnlen l_le(char *, char *, ftnlen, ftnlen);
00358 extern ftnlen l_lt(char *, char *, ftnlen, ftnlen);
00359 extern void pow_ci(f2c_complex *, f2c_complex *, integer *);
00360 extern double pow_dd(double *, double *);
00361 extern double pow_di(double *, integer *);
00362 extern short pow_hh(short *, shortint *);
00363 extern integer pow_ii(integer *, integer *);
00364 /* extern double pow_ri(float *, integer *); */
00365 extern void pow_zi(doublecomplex *, doublecomplex *, integer *);
00366 extern void pow_zz(doublecomplex *, doublecomplex *, doublecomplex *);
00367 extern double r_abs(float *);
00368 extern double r_acos(float *);
00369 extern double r_asin(float *);
00370 extern double r_atan(float *);
00371 extern double r_atn2(float *, float *);
00372 extern void r_cnjg(f2c_complex *, f2c_complex *);
00373 extern double r_cos(float *);
00374 extern double r_cosh(float *);
00375 extern double r_dim(float *, float *);
00376 extern double r_exp(float *);
00377 extern double r_imag(f2c_complex *);
00378 extern double r_int(float *);
00379 extern double r_lg10(float *);
00380 extern double r_log(float *);
00381 extern double r_mod(float *, float *);
00382 extern double r_nint(float *);
00383 extern double r_sign(float *, float *);
00384 extern double r_sin(float *);
00385 extern double r_sinh(float *);
00386 extern double r_sqrt(float *);
00387 extern double r_tan(float *);
00388 extern double r_tanh(float *);
00389 extern void s_cat(char *, char **, integer *, integer *, ftnlen);
00390 extern integer s_cmp(char *, char *, ftnlen, ftnlen);
00391 extern void s_copy(char *, char *, ftnlen, ftnlen);
00392 extern int s_paus(char *, ftnlen);
00393 extern integer s_rdfe(cilist *);
00394 extern integer s_rdue(cilist *);
00395 extern integer s_rnge(char *, integer, char *, integer);
00396 extern integer s_rsfe(cilist *);
00397 extern integer s_rsfi(icilist *);
00398 extern integer s_rsle(cilist *);
00399 extern integer s_rsli(icilist *);
00400 extern integer s_rsne(cilist *);
00401 extern integer s_rsni(icilist *);
00402 extern integer s_rsue(cilist *);
00403 extern int s_stop(char *, ftnlen);
00404 extern integer s_wdfe(cilist *);
00405 extern integer s_wdue(cilist *);
00406 extern integer s_wsfe(cilist *);
00407 extern integer s_wsfi(icilist *);
00408 extern integer s_wsle(cilist *);
00409 extern integer s_wsli(icilist *);
00410 extern integer s_wsne(cilist *);
00411 extern integer s_wsni(icilist *);
00412 extern integer s_wsue(cilist *);
00413 extern void sig_die(char *, int);
00414 extern integer signal_(integer *, void (*)(int));
00415 extern int system_(char *, ftnlen);
00416 extern double z_abs(doublecomplex *);
00417 extern void z_cos(doublecomplex *, doublecomplex *);
00418 extern void z_div(doublecomplex *, doublecomplex *, doublecomplex *);
00419 extern void z_exp(doublecomplex *, doublecomplex *);
00420 extern void z_log(doublecomplex *, doublecomplex *);
00421 extern void z_sin(doublecomplex *, doublecomplex *);
00422 extern void z_sqrt(doublecomplex *, doublecomplex *);
00423     }
00424 #endif /* __cplusplus  */
00425 
00426 #endif /* _F2C_INCLUDE_H */

Generated on Sat Jul 14 11:40:36 2007 for Lapack++ by  doxygen 1.5.0