45 # define FOAM_LABEL_MAX 9000000000000000000
47 # define FOAM_LABEL_MAX 2000000000
51 #if INT_MAX > FOAM_LABEL_MAX
55 # undef FOAM_LABEL_MAX
56 # define FOAM_LABEL_MAX INT_MAX
64 static const label labelMin = INT_MIN;
65 static const label labelMax = INT_MAX;
67 inline label readLabel(Istream& is)
75 #elif LONG_MAX > FOAM_LABEL_MAX
78 # undef FOAM_LABEL_MAX
79 # define FOAM_LABEL_MAX LONG_MAX
88 static const label labelMin = LONG_MIN;
89 static const label labelMax = LONG_MAX;
91 inline label readLabel(Istream& is)
99 #elif LLONG_MAX > FOAM_LABEL_MAX
103 # undef FOAM_LABEL_MAX
104 # define FOAM_LABEL_MAX LLONG_MAX
112 typedef long long label;
114 static const label labelMin = LLONG_MIN;
115 static const label labelMax = LLONG_MAX;
117 inline label readLabel(Istream& is)
158 static const char*
const typeName;
159 static const char* componentNames[];
163 static const label
max;
180 operator label()
const
195 label
pow(label a, label
b);
201 #define MAXMIN(retType, type1, type2) \
203 inline retType max(const type1 s1, const type2 s2) \
205 return (s1 > s2)? s1: s2; \
208 inline retType min(const type1 s1, const type2 s2) \
210 return (s1 < s2)? s1: s2; \
218 MAXMIN(
long long,
long long,
long long)
220 MAXMIN(
unsigned char,
unsigned char,
unsigned char)
221 MAXMIN(
unsigned short,
unsigned short,
unsigned short)
222 MAXMIN(
unsigned int,
unsigned int,
unsigned int)
223 MAXMIN(
unsigned long,
unsigned long,
unsigned long)
224 MAXMIN(
unsigned long long,
unsigned long long,
unsigned long long)
228 MAXMIN(
long long,
long long,
int)
240 inline label
mag(
const label l)
245 inline label
sign(
const label s)
247 return (s >= 0)? 1: -1;
250 inline label
pos(
const label s)
252 return (s >= 0)? 1: 0;
255 inline label
neg(
const label s)
257 return (s < 0)? 1: 0;