UNIVERS
15.3
UNIVERS base processing software API
Main Page
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
include
zq
zqb_macros.h
1
/* zqb_macros.hpp */
2
/* $Id: zqb_macros.h,v 1.3 2008/04/25 06:02:11 vlad Exp $ */
3
#ifndef __zqb_macros_hpp
4
#define __zqb_macros_hpp
5
6
11
#define ZqbMIN(a,b) ((a)<(b)?(a):(b))
12
13
18
#define ZqbMAX(a,b) ((a)>(b)?(a):(b))
19
20
25
#define ZqbSIGN(x) ((x)<0?1:((x)>0?(-1):0))
26
27
32
#define ZqbNUMBER(x) (sizeof(x)/sizeof(x[0]))
33
34
35
#ifdef __cplusplus
36
41
template
<
class
T>
void
ZqbEXCHANGE (T& x, T& y)
42
{
43
T tmp = x;
44
x = y;
45
y = tmp;
46
}
47
52
template
<
class
T>
void
ZqbASCENT (T& x, T& y)
53
{
54
if
(x > y)
55
ZqbEXCHANGE(x, y);
56
}
57
62
template
<
class
T>
void
ZqbDESCENT (T& x, T& y)
63
{
64
if
(x < y)
65
ZqbEXCHANGE(x, y);
66
}
67
68
#endif
/* C++ */
69
70
#endif
/* zqb_macros.hpp */
Generated by
1.8.5