MADNESS  version 0.9
fortran_ctypes.h
Go to the documentation of this file.
1 /*
2  This file is part of MADNESS.
3 
4  Copyright (C) 2007,2010 Oak Ridge National Laboratory
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 
20  For more information please contact:
21 
22  Robert J. Harrison
23  Oak Ridge National Laboratory
24  One Bethel Valley Road
25  P.O. Box 2008, MS-6367
26 
27  email: harrisonrj@ornl.gov
28  tel: 865-241-3937
29  fax: 865-572-0680
30 
31 
32  $Id$
33 */
34 
35 
36 #ifndef FORTRAN_CTYPES_H
37 #define FORTRAN_CTYPES_H
38 
41 
42 #include <complex>
43 #include <stdint.h>
44 #include <madness/madness_config.h>
45 
46 // Fortran integer types
47 typedef int32_t integer4;
48 #define HAVE_INTEGER4
49 # ifdef HAVE_INT64_T
50 typedef int64_t integer8;
51 #define HAVE_INTEGER8
52 # endif // HAVE_INT64_T
53 
54 // Set the default Fortran integer type
55 #if (MADNESS_FORTRAN_DEFAULT_INTEGER_SIZE == 8)
56 
57 // Set the default Fortran integer type to integer*8, if available; otherwise
58 // the default integer type will be integer*4.
59 #ifdef HAVE_INTEGER8
60 typedef integer8 integer;
61 #else
62 typedef integer4 integer;
63 #endif // HAVE_INT64_T
64 
65 #else // (MADNESS_FORTRAN_DEFAULT_INTEGER_SIZE == 4)
66 
67 // Set the default Fortran integer type to integer*4
68 typedef integer4 integer;
69 
70 #endif // (MADNESS_FORTRAN_DEFAULT_INTEGER_SIZE == 8)
71 
72 
74 typedef double real8;
75 typedef double double_precision ;
76 
78 typedef float real4;
79 typedef float single_precision;
80 
82 typedef std::complex<double> complex_real8;
83 typedef std::complex<double> double_precision_complex;
84 
86 typedef std::complex<float> complex_real4;
87 typedef std::complex<float> single_precision_complex;
88 
90 typedef int char_len;
91 
92 
93 #endif
float real4
Fortran single precision.
Definition: fortran_ctypes.h:78
std::complex< float > complex_real4
Fortran single complex.
Definition: fortran_ctypes.h:86
double double_precision
Definition: fortran_ctypes.h:75
std::complex< double > complex_real8
Fortran double complex.
Definition: fortran_ctypes.h:82
int32_t integer4
Definition: fortran_ctypes.h:47
integer4 integer
Definition: fortran_ctypes.h:68
double real8
Fortran double precision.
Definition: fortran_ctypes.h:74
std::complex< double > double_precision_complex
Definition: fortran_ctypes.h:83
std::complex< float > single_precision_complex
Definition: fortran_ctypes.h:87
int char_len
Type of variable appended to argument list for length of fortran character strings.
Definition: fortran_ctypes.h:90
float single_precision
Definition: fortran_ctypes.h:79