Import Geant4 10.7.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2020-06-26 10:23:25 +02:00
parent c02c370437
commit 67ba86d073
1871 changed files with 174422 additions and 131884 deletions
+47 -67
View File
@@ -23,42 +23,22 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// -*- C++ -*-
//
// -----------------------------------------------------------------------
// This file should define some platform dependent features and some
// useful utilities.
// -----------------------------------------------------------------------
// Module defining platform dependent features and some useful utilities.
// =======================================================================
// Gabriele Cosmo - Created: 5th September 1995
// Gabriele Cosmo - Minor change: 08/02/1996
// Gabriele Cosmo - Added DBL_MIN, FLT_MIN, DBL_DIG,
// DBL_MAX, FLT_DIG, FLT_MAX : 12/04/1996
// Gabriele Cosmo - Removed boolean enum definition : 29/11/1996
// Gunter Folger - Added G4SwapPtr() and G4SwapObj() : 31/07/1997
// Gabriele Cosmo - Adapted signatures of min(), max() to
// STL's ones, thanks to E.Tcherniaev : 31/07/1997
// Gabriele Cosmo,
// Evgueni Tcherniaev - Migrated to CLHEP: 04/12/1997
// =======================================================================
// Author: Gabriele Cosmo, 5 September 1995 - Created
// --------------------------------------------------------------------
#ifndef templates_hh
#define templates_hh 1
#ifndef templates_h
#define templates_h 1
#include <limits>
#include <climits>
#include <limits>
//
// If HIGH_PRECISION is defined to TRUE (ie. != 0) then the type "Float"
// is typedefed to "double". If it is FALSE (ie. 0) it is typedefed
// to "float".
//
#ifndef HIGH_PRECISION
#define HIGH_PRECISION 1
# define HIGH_PRECISION 1
#endif
#if HIGH_PRECISION
@@ -70,52 +50,52 @@ typedef float Float;
// Following values have been taken from limits.h
// and temporarly defined for portability on HP-UX.
#ifndef DBL_MIN /* Min decimal value of a double */
#define DBL_MIN std::numeric_limits<double>::min() // 2.2250738585072014e-308
#ifndef DBL_MIN /* Min decimal value of a double */
# define DBL_MIN std::numeric_limits<double>::min() // 2.2250738585072014e-308
#endif
#ifndef DBL_DIG /* Digits of precision of a double */
#define DBL_DIG std::numeric_limits<double>::digits10 // 15
#ifndef DBL_DIG /* Digits of precision of a double */
# define DBL_DIG std::numeric_limits<double>::digits10 // 15
#endif
#ifndef DBL_MAX /* Max decimal value of a double */
#define DBL_MAX std::numeric_limits<double>::max() // 1.7976931348623157e+308
#ifndef DBL_MAX /* Max decimal value of a double */
# define DBL_MAX std::numeric_limits<double>::max() // 1.7976931348623157e+308
#endif
#ifndef DBL_EPSILON
#define DBL_EPSILON std::numeric_limits<double>::epsilon()
#endif // 2.2204460492503131e-16
# define DBL_EPSILON std::numeric_limits<double>::epsilon()
#endif // 2.2204460492503131e-16
#ifndef FLT_MIN /* Min decimal value of a float */
#define FLT_MIN std::numeric_limits<float>::min() // 1.17549435e-38F
#ifndef FLT_MIN /* Min decimal value of a float */
# define FLT_MIN std::numeric_limits<float>::min() // 1.17549435e-38F
#endif
#ifndef FLT_DIG /* Digits of precision of a float */
#define FLT_DIG std::numeric_limits<float>::digits10 // 6
#ifndef FLT_DIG /* Digits of precision of a float */
# define FLT_DIG std::numeric_limits<float>::digits10 // 6
#endif
#ifndef FLT_MAX /* Max decimal value of a float */
#define FLT_MAX std::numeric_limits<float>::max() // 3.40282347e+38F
#ifndef FLT_MAX /* Max decimal value of a float */
# define FLT_MAX std::numeric_limits<float>::max() // 3.40282347e+38F
#endif
#ifndef FLT_EPSILON
#define FLT_EPSILON std::numeric_limits<float>::epsilon()
#endif // 1.192092896e-07F
# define FLT_EPSILON std::numeric_limits<float>::epsilon()
#endif // 1.192092896e-07F
#ifndef MAXFLOAT /* Max decimal value of a float */
#define MAXFLOAT std::numeric_limits<float>::max() // 3.40282347e+38F
#ifndef MAXFLOAT /* Max decimal value of a float */
# define MAXFLOAT std::numeric_limits<float>::max() // 3.40282347e+38F
#endif
#ifndef INT_MAX /* Max decimal value of a int */
#define INT_MAX std::numeric_limits<int>::max() // 2147483647
#ifndef INT_MAX /* Max decimal value of a int */
# define INT_MAX std::numeric_limits<int>::max() // 2147483647
#endif
#ifndef INT_MIN /* Min decimal value of a int */
#define INT_MIN std::numeric_limits<int>::min() // -2147483648
#ifndef INT_MIN /* Min decimal value of a int */
# define INT_MIN std::numeric_limits<int>::min() // -2147483648
#endif
#ifndef LOG_EKIN_MIN /* Min value of the natural logarithm of kin. energy. */
#define LOG_EKIN_MIN -30
#ifndef LOG_EKIN_MIN /* Min value of the natural logarithm of kin. energy. */
# define LOG_EKIN_MIN -30
#endif
//---------------------------------
@@ -123,47 +103,47 @@ typedef float Float;
template <class T>
inline void G4SwapPtr(T*& a, T*& b)
{
T* tmp= a;
a = b;
b = tmp;
T* tmp = a;
a = b;
b = tmp;
}
template <class T>
inline void G4SwapObj(T* a, T* b)
{
T tmp= *a;
*a = *b;
*b = tmp;
T tmp = *a;
*a = *b;
*b = tmp;
}
//-----------------------------
#ifndef G4_SQR_DEFINED
#define G4_SQR_DEFINED
#ifdef sqr
#undef sqr
#endif
# define G4_SQR_DEFINED
# ifdef sqr
# undef sqr
# endif
template <class T>
inline T sqr(const T& x)
{
return x*x;
return x * x;
}
#endif
inline int G4lrint(double ad)
{
return (ad>0) ? static_cast<int>(ad+.5) : static_cast<int>(ad-.5);
return (ad > 0) ? static_cast<int>(ad + .5) : static_cast<int>(ad - .5);
}
inline int G4lint(double ad)
{
return (ad>0) ? static_cast<int>(ad) : static_cast<int>(ad-1.);
return (ad > 0) ? static_cast<int>(ad) : static_cast<int>(ad - 1.);
}
inline int G4rint(double ad)
{
return (ad>0) ? static_cast<int>(ad+1) : static_cast<int>(ad);
return (ad > 0) ? static_cast<int>(ad + 1) : static_cast<int>(ad);
}
//-----------------------------
@@ -205,6 +185,6 @@ inline int G4rint(double ad)
//
template <typename... _Args>
inline void G4ConsumeParameters(_Args&&...)
{ }
{}
#endif // templates_h
#endif // templates_hh