Import Geant4 11.4.0 source tree
This commit is contained in:
-51
@@ -27,64 +27,13 @@ inline double rad2deg() {
|
||||
return s_v;
|
||||
}
|
||||
|
||||
// for Lib/ExpFunc.
|
||||
inline bool in_domain_all(double){return true;}
|
||||
inline bool in_domain_log(double a_x){return (a_x>0?true:false);}
|
||||
inline bool in_domain_tan(double a_x){
|
||||
int n = int(a_x/half_pi());
|
||||
if(a_x!=n*half_pi()) return true;
|
||||
return (2*int(n/2)==n?true:false);
|
||||
}
|
||||
inline bool in_domain_acos(double a_x){
|
||||
if((a_x<-1)||(1<a_x)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
inline double angle_modulo(double a_angle) {
|
||||
int64 div = a_angle/two_pi();
|
||||
double rest = a_angle - div*two_pi();
|
||||
if(rest<0) rest += two_pi();
|
||||
return rest;
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
//#include "power"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
namespace tools {
|
||||
|
||||
inline double dcos(const double& a_x) {return ::cos(a_x);}
|
||||
inline double dsin(const double& a_x) {return ::sin(a_x);}
|
||||
inline double dpow(const double& a_x,const double& a_y) {return ::pow(a_x,a_y);}
|
||||
inline double dcosh(const double& a_x) {return ::cosh(a_x);}
|
||||
inline double dsinh(const double& a_x) {return ::sinh(a_x);}
|
||||
|
||||
inline double dconj(const double& a_x) {return a_x;}
|
||||
inline double dfabs(const double& a_x) {return ::fabs(a_x);} //if passing a_fabs(const T&).
|
||||
inline double dsqrt(const double& a_x) {return ::sqrt(a_x);}
|
||||
|
||||
//long double
|
||||
#ifndef ANDROID
|
||||
inline long double ldfabs(const long double& a_x) {return ::fabsl(a_x);}
|
||||
#endif
|
||||
|
||||
inline bool dpow(const double& a_x,const double& a_y,double& a_v) {
|
||||
if((a_x==0)&&(a_y<0)) {
|
||||
a_v = 0;
|
||||
return false;
|
||||
}
|
||||
a_v = dpow(a_x,a_y);
|
||||
return true;
|
||||
}
|
||||
|
||||
inline double dgaussian(const double& a_x,const double& a_mean,const double& a_sigma) {
|
||||
double _tmp = (a_x-a_mean)/a_sigma;
|
||||
return ::exp(-_tmp*_tmp/2.0)/(a_sigma*::sqrt(2*pi()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user