/[escript]/trunk/esysUtils/src/index.h
ViewVC logotype

Contents of /trunk/esysUtils/src/index.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3259 - (show annotations)
Mon Oct 11 01:48:14 2010 UTC (8 years, 11 months ago) by jfenwick
File MIME type: text/plain
File size: 2115 byte(s)
Merging dudley and scons updates from branches

1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2010 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 #ifndef INC_ESYS_INDEX
16 #define INC_ESYS_INDEX
17
18 /**************************************************************/
19
20 /* Macros for array indexing */
21
22 /**************************************************************/
23
24 /**************************************************************/
25
26 /* some useful functions: */
27
28 #include <limits.h>
29
30
31 #define FALSE 0
32 #define TRUE 1
33 #define UNKNOWN -1
34 #define DBLE(_x_) (double)(_x_)
35 #define INDEX1(_X1_) (_X1_)
36 #define INDEX2(_X1_,_X2_,_N1_) ((_X1_)+(_N1_)*(_X2_))
37 #define INDEX3(_X1_,_X2_,_X3_,_N1_,_N2_) ((_X1_)+(_N1_)*INDEX2(_X2_,_X3_,_N2_))
38 #define INDEX4(_X1_,_X2_,_X3_,_X4_,_N1_,_N2_,_N3_) ((_X1_)+(_N1_)*INDEX3(_X2_,_X3_,_X4_,_N2_,_N3_))
39 #define INDEX5(_X1_,_X2_,_X3_,_X4_,_X5_,_N1_,_N2_,_N3_,_N4_) ((_X1_)+(_N1_)*INDEX4(_X2_,_X3_,_X4_,_X5_,_N2_,_N3_,_N4_))
40 #define INDEX6(_X1_,_X2_,_X3_,_X4_,_X5_,_X6_,_N1_,_N2_,_N3_,_N4_,_N5_) ((_X1_)+(_N1_)*INDEX5(_X2_,_X3_,_X4_,_X5_,_X6_,_N2_,_N3_,_N4_,_N5_))
41
42 #define MAX(_arg1_,_arg2_) ((_arg1_)>(_arg2_) ? (_arg1_) : (_arg2_))
43 #define MAX3(_arg1_,_arg2_,_arg3_) MAX(_arg1_,MAX(_arg2_,_arg3_))
44 #define MIN(_arg1_,_arg2_) ((_arg1_)>(_arg2_) ? (_arg2_) : (_arg1_))
45 #define MIN3(_arg1_,_arg2_,_arg3_) MIN(_arg1_,MIN(_arg2_,_arg3_))
46 #define ABS(_arg_) MAX((_arg_),-(_arg_))
47 #define SIGN(_arg_) ((_arg_)>0 ? 1 : ((_arg_)<0 ? -1 : 0 ))
48 #define SWAP(_a0_,_a1_,_type_) { \
49 _type_ s; \
50 s=(_a0_); \
51 _a0_= (_a1_); \
52 _a1_=s; \
53 }
54 #define XNOR(_a0_,_a1_) ( ( (_a0_) && (_a1_) ) || ( !(_a0_) && !(_a1_) ) )
55
56 #define INDEX_T_MAX INT_MAX
57 #define INDEX_T_MIN -INT_MAX
58
59 #endif

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision
svn:mergeinfo /branches/lapack2681/paso/src/Common.h:2682-2741 /branches/restext/paso/src/Common.h:2610-2624 /branches/stage3.0/paso/src/Common.h:2569-2590 /release/3.0/paso/src/Common.h:2591-2601

  ViewVC Help
Powered by ViewVC 1.1.26