Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (14 years ago)
Author:
garnier
Message:

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/global/management/include/G4Pow.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4Pow.hh,v 1.2 2009/07/03 11:35:07 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     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 $
    2828//
    2929//
     
    3535//
    3636// 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
    3841
    3942// Author: Vladimir Ivanchenko
     
    109112inline G4double G4Pow::A13(G4double A)
    110113{
    111   const G4int maxZ = 256;
     114  const G4double minA = 0.5000001;
     115  const G4double maxA = 255.5;
    112116
    113117  G4double res;
    114   G4int i = G4int(A + 0.5);
    115   if((i >= 1) && (i < maxZ))
     118  if((A >= minA) && (A <= maxA))
    116119  {
     120    G4int i = G4int(A + 0.5);
    117121    G4double x = (1.0 - A/G4double(i))*onethird;
    118122    res = pz13[i]*(1.0 + x - x*x*(1.0 - 1.66666666*x));
     
    144148inline G4double G4Pow::logA(G4double A)
    145149{
    146   const G4int maxZ = 256;
     150  const G4double minA = 0.5000001;
     151  const G4double maxA = 255.5;
    147152
    148153  G4double res;
    149   G4int i = G4int(A + 0.5);
    150   if((i >= 1) && (i < maxZ))
     154  if((A >= minA) && (A <= maxA))
    151155  {
     156    G4int i = G4int(A + 0.5);
    152157    G4double x = 1.0 - A/G4double(i);
    153158    res = lz[i] + x*(1.0 - 0.5*x + onethird*x*x);
Note: See TracChangeset for help on using the changeset viewer.