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.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /externals/g4tools/include/tools/mathd (Version 11.3.0) and /externals/g4tools/include/tools/mathd (Version 9.4)


  1 // Copyright (C) 2010, Guy Barrand. All rights    
  2 // See the file tools.license for terms.          
  3                                                   
  4 #ifndef tools_mathd                               
  5 #define tools_mathd                               
  6                                                   
  7 namespace tools {                                 
  8                                                   
  9 //have : static const pi = 3.14159265358979311    
 10                                                   
 11 //HEALPix lsconstants.h. Quite not the same as    
 12 //const double pi=3.14159265358979323846264338    
 13 //const double twopi=6.28318530717958647692528    
 14 //const double fourpi=12.566370614359172953850    
 15 //const double halfpi=1.5707963267948966192313    
 16                                                   
 17 inline double pi()      {return 3.141592653589    
 18 inline double two_pi()  {return 6.283185307179    
 19 inline double half_pi() {return 1.570796326794    
 20                                                   
 21 inline double deg2rad() {                         
 22   static const double s_v = pi()/180.0;           
 23   return s_v;                                     
 24 }                                                 
 25 inline double rad2deg() {                         
 26   static const double s_v = 180.0/pi();           
 27   return s_v;                                     
 28 }                                                 
 29                                                   
 30 // for Lib/ExpFunc.                               
 31 inline bool in_domain_all(double){return true;    
 32 inline bool in_domain_log(double a_x){return (    
 33 inline bool in_domain_tan(double a_x){            
 34   int n = int(a_x/half_pi());                     
 35   if(a_x!=n*half_pi()) return true;               
 36   return (2*int(n/2)==n?true:false);              
 37 }                                                 
 38 inline bool in_domain_acos(double a_x){           
 39   if((a_x<-1)||(1<a_x)) return false;             
 40   return true;                                    
 41 }                                                 
 42                                                   
 43 /*                                                
 44 inline double angle_modulo(double a_angle) {      
 45   int64 div = a_angle/two_pi();                   
 46   double rest = a_angle - div*two_pi();           
 47   if(rest<0) rest += two_pi();                    
 48   return rest;                                    
 49 }                                                 
 50 */                                                
 51                                                   
 52 }                                                 
 53                                                   
 54 //#include "power"                                
 55                                                   
 56 #include <cmath>                                  
 57                                                   
 58 namespace tools {                                 
 59                                                   
 60 inline double dcos(const double& a_x) {return     
 61 inline double dsin(const double& a_x) {return     
 62 inline double dpow(const double& a_x,const dou    
 63 inline double dcosh(const double& a_x) {return    
 64 inline double dsinh(const double& a_x) {return    
 65                                                   
 66 inline double dconj(const double& a_x) {return    
 67 inline double dfabs(const double& a_x) {return    
 68 inline double dsqrt(const double& a_x) {return    
 69                                                   
 70 //long double                                     
 71 #ifndef ANDROID                                   
 72 inline long double ldfabs(const long double& a    
 73 #endif                                            
 74                                                   
 75 inline bool dpow(const double& a_x,const doubl    
 76   if((a_x==0)&&(a_y<0)) {                         
 77     a_v = 0;                                      
 78     return false;                                 
 79   }                                               
 80   a_v = dpow(a_x,a_y);                            
 81   return true;                                    
 82 }                                                 
 83                                                   
 84 inline double dgaussian(const double& a_x,cons    
 85   double _tmp = (a_x-a_mean)/a_sigma;             
 86   return ::exp(-_tmp*_tmp/2.0)/(a_sigma*::sqrt    
 87 }                                                 
 88                                                   
 89 }                                                 
 90                                                   
 91 #endif