37 : fFunction(pFunction),
45 : fFunction(pFunction),
46 fTolerance(pTolerance),
61 G4int iterationNumber )
63 G4double Step = (xFinal - xInitial)/iterationNumber ;
64 G4double mean = (fFunction(xInitial) + fFunction(xFinal))*0.5 ;
66 for(
G4int i=1;i<iterationNumber;i++)
69 mean += fFunction(x) ;
77 G4int iterationNumber )
79 G4double Step = (xFinal - xInitial)/iterationNumber ;
82 for(
G4int i=1;i<iterationNumber;i++)
85 mean += fFunction(x) ;
93 G4int iterationNumber )
96 static const G4double root = 1.0/std::sqrt(3.0) ;
97 G4double Step = (xFinal - xInitial)/(2.0*iterationNumber) ;
100 for(
G4int i=0;i<iterationNumber;i++)
103 mean += (fFunction(x+delta) + fFunction(x-delta)) ;
111 G4int iterationNumber )
113 G4double Step = (xFinal - xInitial)/iterationNumber ;
115 G4double xPlus = xInitial + 0.5*Step ;
116 G4double mean = (fFunction(xInitial) + fFunction(xFinal))*0.5 ;
118 for(
G4int i=1;i<iterationNumber;i++)
122 mean += fFunction(x) ;
123 sum += fFunction(xPlus) ;
126 return mean*Step/3.0 ;
148 static const G4double root = 1.0/std::sqrt(3.0) ;
150 G4double xMean = (xInitial + xFinal)/2.0 ;
151 G4double Step = (xFinal - xInitial)/2.0 ;
153 G4double sum = (fFunction(xMean + delta) + fFunction(xMean - delta)) ;
167 G4Exception(
"G4SimpleIntegration::AdaptGauss()",
"Error",
170 G4double xMean = (xInitial + xFinal)/2.0 ;
174 if(std::fabs(leftHalf+rightHalf-full) < fTolerance)
G4double MidPoint(G4double xInitial, G4double xFinal, G4int iterationNumber)
G4SimpleIntegration(function pFunction)
G4double Gauss(G4double xInitial, G4double xFinal, G4int iterationNumber)
G4double AdaptGaussIntegration(G4double xInitial, G4double xFinal)
void AdaptGauss(G4double xInitial, G4double xFinal, G4double &sum, G4int &depth)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double Simpson(G4double xInitial, G4double xFinal, G4int iterationNumber)
G4double Trapezoidal(G4double xInitial, G4double xFinal, G4int iterationNumber)