79eb874b479cf65777ba1f2b86f00155edc4b0fc
[alexxy/gromacs.git] / include / macros.h
1 /*
2  * $Id$
3  * 
4  *       This source code is part of
5  * 
6  *        G   R   O   M   A   C   S
7  * 
8  * GROningen MAchine for Chemical Simulations
9  * 
10  *               VERSION 2.0
11  * 
12  * Copyright (c) 1991-1999
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
16  * Please refer to:
17  * GROMACS: A message-passing parallel molecular dynamics implementation
18  * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19  * Comp. Phys. Comm. 91, 43-56 (1995)
20  * 
21  * Also check out our WWW page:
22  * http://md.chem.rug.nl/~gmx
23  * or e-mail to:
24  * gromacs@chem.rug.nl
25  * 
26  * And Hey:
27  * Good ROcking Metal Altar for Chronical Sinners
28  */
29
30 #ifndef _macros_h
31 #define _macros_h
32
33 static char *SRCID_macros_h = "$Id$";
34
35 #ifdef HAVE_CONFIG_H
36 #include <config.h>
37 #endif
38
39 #ifdef HAVE_IDENT
40 #ident  "@(#) macros.h 1.8 11/23/92"
41 #endif /* HAVE_IDENT */
42
43 #ifdef CPLUSPLUS
44 extern "C" { 
45 #endif
46
47
48 #include "typedefs.h" /* for real definition only */
49
50 /* 
51  * With the macros below you don't
52  * have to use an index if you don't wan't to. You can eg. use
53  * angle.C0[23] instead if angle.c[0][23].
54  * In a similar fashion, you can use angle.AI[3] instead of
55  * angle.a[0][3]
56  */
57 #define AI      a[0]
58 #define AJ      a[1]
59 #define AK      a[2]
60 #define AL      a[3]
61 #define AM      a[4]
62 #define C0      c[0]
63 #define C1      c[1]
64 #define C2      c[2]
65 #define C3      c[3]
66 #define C4      c[4]
67 #define C5      c[5]
68
69 #define min(a,b) (((a) < (b)) ? (a) : (b) )
70 #define max(a,b) (((a) > (b)) ? (a) : (b) )
71 #define even(a) ( ( (a+1) / 2) == (a / 2) )
72
73 /* This macro calculates the size of a array */
74 #define asize(a) (sizeof(a)/sizeof((a)[0]))
75
76 extern real ZERO;
77 extern real THIRD;
78 extern real HALF;
79 extern real ONE;
80 extern real TWO;
81 extern real THREE;
82 extern real SIX;
83 extern real TEN;
84 extern real TWELVE;
85
86 #ifdef CPLUSPLUS
87 }
88 #endif
89
90
91 #endif  /* _macros_h */
92