minor fixes in ditribution files
[gromacs/qmmm-gamess-us.git] / include / types / simple.h
blob789ab1f1348e0bf56ac1da02821cab1e9915f297
1 /*
2 *
3 * This source code is part of
4 *
5 * G R O M A C S
6 *
7 * GROningen MAchine for Chemical Simulations
8 *
9 * VERSION 3.2.0
10 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12 * Copyright (c) 2001-2004, The GROMACS development team,
13 * check out http://www.gromacs.org for more information.
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * If you want to redistribute modifications, please consider that
21 * scientific software is very special. Version control is crucial -
22 * bugs must be traceable. We will be happy to consider code for
23 * inclusion in the official distribution, but derived work must not
24 * be called official GROMACS. Details are found in the README & COPYING
25 * files - if they are missing, get the official version at www.gromacs.org.
27 * To help us fund GROMACS development, we humbly ask that you cite
28 * the papers on the package - you can find them in the top README file.
30 * For more info, check our website at http://www.gromacs.org
32 * And Hey:
33 * GRoups of Organic Molecules in ACtion for Science
36 #ifndef _simple_h
37 #define _simple_h
39 #ifdef HAVE_CONFIG_H
40 #include <config.h>
41 #endif
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
47 #ifndef FALSE
48 #define FALSE 0
49 #endif
50 #ifndef TRUE
51 #define TRUE 1
52 #endif
53 #define BOOL_NR 2
55 #define XX 0 /* Defines for indexing in */
56 #define YY 1 /* vectors */
57 #define ZZ 2
58 #define DIM 3 /* Dimension of vectors */
59 #define XXXX 0 /* defines to index matrices */
60 #define XXYY 1
61 #define XXZZ 2
62 #define YYXX 3
63 #define YYYY 4
64 #define YYZZ 5
65 #define ZZXX 6
66 #define ZZYY 7
67 #define ZZZZ 8
68 #ifndef HAVE_BOOL
69 #define bool int
70 /* typedef int bool; */
71 #endif
74 typedef int atom_id; /* To indicate an atoms id */
75 #define NO_ATID (atom_id)(~0) /* Use this to indicate invalid atid */
77 /*! \brief Double precision accuracy */
78 #define GMX_DOUBLE_EPS 1.11022302E-16
80 /*! \brief Maximum double precision value - reduced 1 unit in last digit for MSVC */
81 #define GMX_DOUBLE_MAX 1.79769312E+308
83 /*! \brief Minimum double precision value */
84 #define GMX_DOUBLE_MIN 2.22507386E-308
86 /*! \brief Single precision accuracy */
87 #define GMX_FLOAT_EPS 5.96046448E-08
89 /*! \brief Maximum single precision value - reduced 1 unit in last digit for MSVC */
90 #define GMX_FLOAT_MAX 3.40282346E+38
92 /*! \brief Minimum single precision value */
93 #define GMX_FLOAT_MIN 1.17549435E-38
96 /* Check whether we already have a real type! */
97 #ifdef GMX_DOUBLE
98 #ifndef HAVE_REAL
99 typedef double real;
100 #define HAVE_REAL
101 #endif
102 #define GMX_MPI_REAL MPI_DOUBLE
103 #define GMX_REAL_EPS GMX_DOUBLE_EPS
104 #define GMX_REAL_MIN GMX_DOUBLE_MIN
105 #define GMX_REAL_MAX GMX_DOUBLE_MAX
106 #else
107 #ifndef HAVE_REAL
108 typedef float real;
109 #define HAVE_REAL
110 #endif
111 #define GMX_MPI_REAL MPI_FLOAT
112 #define GMX_REAL_EPS GMX_FLOAT_EPS
113 #define GMX_REAL_MIN GMX_FLOAT_MIN
114 #define GMX_REAL_MAX GMX_FLOAT_MAX
115 #endif
117 #ifndef VECTORIZATION_BUFLENGTH
118 #define VECTORIZATION_BUFLENGTH 1000
119 /* The total memory size of the vectorization buffers will
120 * be 5*sizeof(real)*VECTORIZATION_BUFLENGTH
122 #endif
123 typedef real rvec[DIM];
125 typedef double dvec[DIM];
127 typedef real matrix[DIM][DIM];
129 typedef real tensor[DIM][DIM];
131 typedef int ivec[DIM];
133 typedef int imatrix[DIM][DIM];
135 /* For the step count type gmx_large_int_t we aim for 8 bytes (64bit),
136 * but we might only be able to get 4 bytes (32bit).
138 #if (!(defined SIZEOF_LONG_LONG_INT) || SIZEOF_LONG_INT == 8)
139 typedef long int gmx_large_int_t;
140 #define gmx_large_int_fmt "ld"
141 #define gmx_large_int_pfmt "%ld"
142 #define SIZEOF_LARGE_INT SIZEOF_LONG_INT
143 #define LARGE_INT_MAX LONG_MAX
144 #else
145 typedef long long int gmx_large_int_t;
146 #define gmx_large_int_fmt "lld"
147 #define gmx_large_int_pfmt "%lld"
148 #define SIZEOF_LARGE_INT SIZEOF_LONG_LONG_INT
149 /* LLONG_MAX is not defined by the C-standard, so check for it */
150 #if (!(defined LLONG_MAX) && SIZEOF_LONG_LONG_INT == 8)
151 #define LARGE_INT_MAX 9223372036854775807LL
152 #else
153 #define LARGE_INT_MAX LLONG_MAX
154 #endif
155 #endif
158 #ifdef __cplusplus
160 #endif
162 #endif