Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
templates.hh File Reference
#include <limits>
#include <climits>
Include dependency graph for templates.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define HIGH_PRECISION   1
 
#define DBL_MIN   std::numeric_limits<double>::min()
 
#define DBL_DIG   std::numeric_limits<double>::digits10
 
#define DBL_MAX   std::numeric_limits<double>::max()
 
#define DBL_EPSILON   std::numeric_limits<double>::epsilon()
 
#define FLT_MIN   std::numeric_limits<float>::min()
 
#define FLT_DIG   std::numeric_limits<float>::digits10
 
#define FLT_MAX   std::numeric_limits<float>::max()
 
#define FLT_EPSILON   std::numeric_limits<float>::epsilon()
 
#define MAXFLOAT   std::numeric_limits<float>::max()
 
#define INT_MAX   std::numeric_limits<int>::max()
 
#define INT_MIN   std::numeric_limits<int>::min()
 
#define G4_SQR_DEFINED
 

Typedefs

typedef double Float
 

Functions

template<class T >
void G4SwapPtr (T *&a, T *&b)
 
template<class T >
void G4SwapObj (T *a, T *b)
 
template<class T >
sqr (const T &x)
 
int G4lrint (double ad)
 
int G4lint (double ad)
 
int G4rint (double ad)
 

Macro Definition Documentation

#define DBL_DIG   std::numeric_limits<double>::digits10

Definition at line 79 of file templates.hh.

#define DBL_EPSILON   std::numeric_limits<double>::epsilon()

Definition at line 87 of file templates.hh.

#define DBL_MAX   std::numeric_limits<double>::max()

Definition at line 83 of file templates.hh.

#define DBL_MIN   std::numeric_limits<double>::min()

Definition at line 75 of file templates.hh.

#define FLT_DIG   std::numeric_limits<float>::digits10

Definition at line 95 of file templates.hh.

#define FLT_EPSILON   std::numeric_limits<float>::epsilon()

Definition at line 103 of file templates.hh.

#define FLT_MAX   std::numeric_limits<float>::max()

Definition at line 99 of file templates.hh.

#define FLT_MIN   std::numeric_limits<float>::min()

Definition at line 91 of file templates.hh.

#define G4_SQR_DEFINED

Definition at line 139 of file templates.hh.

#define HIGH_PRECISION   1

Definition at line 62 of file templates.hh.

#define INT_MAX   std::numeric_limits<int>::max()

Definition at line 111 of file templates.hh.

#define INT_MIN   std::numeric_limits<int>::min()

Definition at line 115 of file templates.hh.

#define MAXFLOAT   std::numeric_limits<float>::max()

Definition at line 107 of file templates.hh.

Typedef Documentation

typedef double Float

Definition at line 66 of file templates.hh.

Function Documentation

int G4lint ( double  ad)
inline

Definition at line 168 of file templates.hh.

169 {
170  return (ad>0) ? static_cast<int>(ad) : static_cast<int>(ad-1.);
171 }
int G4lrint ( double  ad)
inline

Definition at line 163 of file templates.hh.

164 {
165  return (ad>0) ? static_cast<int>(ad+.5) : static_cast<int>(ad-.5);
166 }
int G4rint ( double  ad)
inline

Definition at line 173 of file templates.hh.

174 {
175  return (ad>0) ? static_cast<int>(ad+1) : static_cast<int>(ad);
176 }
template<class T >
void G4SwapObj ( T *  a,
T *  b 
)
inline

Definition at line 129 of file templates.hh.

130 {
131  T tmp= *a;
132  *a = *b;
133  *b = tmp;
134 }

Here is the caller graph for this function:

template<class T >
void G4SwapPtr ( T *&  a,
T *&  b 
)
inline

Definition at line 121 of file templates.hh.

122 {
123  T* tmp= a;
124  a = b;
125  b = tmp;
126 }
template<class T >
T sqr ( const T &  x)
inline

Definition at line 145 of file templates.hh.

146 {
147  return x*x;
148 }