Changeset 1315 for trunk/source/global/management/include/G4Pow.hh
- Timestamp:
- Jun 18, 2010, 11:42:07 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/global/management/include/G4Pow.hh
r1228 r1315 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4Pow.hh,v 1. 2 2009/07/03 11:35:07vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 3$26 // $Id: G4Pow.hh,v 1.5 2010/05/28 08:18:03 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 28 28 // 29 29 // … … 35 35 // 36 36 // Utility singleton class for the fast computation of log and pow 37 // functions 37 // functions. Integer argument should in the interval 0-255, no 38 // check is performed inside these methods for performance reasons. 39 // Computations with double arguments are fast for the interval 40 // 0.5-255.5, standard library is used in the opposite case 38 41 39 42 // Author: Vladimir Ivanchenko … … 109 112 inline G4double G4Pow::A13(G4double A) 110 113 { 111 const G4int maxZ = 256; 114 const G4double minA = 0.5000001; 115 const G4double maxA = 255.5; 112 116 113 117 G4double res; 114 G4int i = G4int(A + 0.5); 115 if((i >= 1) && (i < maxZ)) 118 if((A >= minA) && (A <= maxA)) 116 119 { 120 G4int i = G4int(A + 0.5); 117 121 G4double x = (1.0 - A/G4double(i))*onethird; 118 122 res = pz13[i]*(1.0 + x - x*x*(1.0 - 1.66666666*x)); … … 144 148 inline G4double G4Pow::logA(G4double A) 145 149 { 146 const G4int maxZ = 256; 150 const G4double minA = 0.5000001; 151 const G4double maxA = 255.5; 147 152 148 153 G4double res; 149 G4int i = G4int(A + 0.5); 150 if((i >= 1) && (i < maxZ)) 154 if((A >= minA) && (A <= maxA)) 151 155 { 156 G4int i = G4int(A + 0.5); 152 157 G4double x = 1.0 - A/G4double(i); 153 158 res = lz[i] + x*(1.0 - 0.5*x + onethird*x*x);
Note: See TracChangeset
for help on using the changeset viewer.