SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StdDefs.h
Go to the documentation of this file.
1 /****************************************************************************/
9 //
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef StdDefs_h
23 #define StdDefs_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 /* avoiding compiler warning unreferenced parameter */
36 #define UNUSED_PARAMETER(x) ((void)(x))
37 
38 /* -------------------------------------------------------------------------
39  * some constant defaults used by SUMO
40  * ----------------------------------------------------------------------- */
47 
50 
51 
52 /* -------------------------------------------------------------------------
53  * templates for mathematical functions missing in some c++-implementations
54  * ----------------------------------------------------------------------- */
55 template<typename T>
56 inline T
57 MIN2(T a, T b) {
58  return a < b ? a : b;
59 }
60 
61 template<typename T>
62 inline T
63 MAX2(T a, T b) {
64  return a > b ? a : b;
65 }
66 
67 
68 template<typename T>
69 inline T
70 MIN3(T a, T b, T c) {
71  return MIN2(c, a < b ? a : b);
72 }
73 
74 
75 template<typename T>
76 inline T
77 MAX3(T a, T b, T c) {
78  return MAX2(c, a > b ? a : b);
79 }
80 
81 
82 template<typename T>
83 inline T
84 MIN4(T a, T b, T c, T d) {
85  return MIN2(MIN2(a, b), MIN2(c, d));
86 }
87 
88 
89 template<typename T>
90 inline T
91 MAX4(T a, T b, T c, T d) {
92  return MAX2(MAX2(a, b), MAX2(c, d));
93 }
94 
95 
96 template<typename T>
97 inline T
98 ISNAN(T a) {
99  volatile T d = a;
100  return d != d;
101 }
102 
103 
104 #endif
105 
106 /****************************************************************************/
107 
const SUMOReal SUMO_const_laneWidth
Definition: StdDefs.h:41
const SUMOReal SUMO_const_halfLaneAndOffset
Definition: StdDefs.h:46
T MIN4(T a, T b, T c, T d)
Definition: StdDefs.h:84
const SUMOReal SUMO_const_laneWidthAndOffset
Definition: StdDefs.h:45
T MAX2(T a, T b)
Definition: StdDefs.h:63
const SUMOReal SUMO_const_laneOffset
Definition: StdDefs.h:44
T MAX3(T a, T b, T c)
Definition: StdDefs.h:77
T MAX4(T a, T b, T c, T d)
Definition: StdDefs.h:91
T MIN2(T a, T b)
Definition: StdDefs.h:57
const SUMOReal SUMO_const_quarterLaneWidth
Definition: StdDefs.h:43
T ISNAN(T a)
Definition: StdDefs.h:98
const SUMOReal SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
Definition: StdDefs.h:49
#define SUMOReal
Definition: config.h:215
T MIN3(T a, T b, T c)
Definition: StdDefs.h:70
const SUMOReal SUMO_const_halfLaneWidth
Definition: StdDefs.h:42