35 : fFunction(pFunction)
40 : fFunction(pFunction)
41 , fTolerance(pTolerance)
47 G4int iterationNumber)
49 G4double Step = (xFinal - xInitial) / iterationNumber;
50 G4double mean = (fFunction(xInitial) + fFunction(xFinal)) * 0.5;
52 for(
G4int i = 1; i < iterationNumber; ++i)
61 G4int iterationNumber)
63 G4double Step = (xFinal - xInitial) / iterationNumber;
66 for(
G4int i = 1; i < iterationNumber; ++i)
75 G4int iterationNumber)
78 static const G4double root = 1.0 / std::sqrt(3.0);
79 G4double Step = (xFinal - xInitial) / (2.0 * iterationNumber);
82 for(
G4int i = 0; i < iterationNumber; ++i)
84 x = (2 * i + 1) * Step;
85 mean += (fFunction(x + delta) + fFunction(x - delta));
91 G4int iterationNumber)
93 G4double Step = (xFinal - xInitial) / iterationNumber;
95 G4double xPlus = xInitial + 0.5 * Step;
96 G4double mean = (fFunction(xInitial) + fFunction(xFinal)) * 0.5;
98 for(
G4int i = 1; i < iterationNumber; ++i)
102 mean += fFunction(x);
103 sum += fFunction(xPlus);
106 return mean * Step / 3.0;
122 static const G4double root = 1.0 / std::sqrt(3.0);
124 G4double xMean = (xInitial + xFinal) / 2.0;
125 G4double Step = (xFinal - xInitial) / 2.0;
127 G4double sum = (fFunction(xMean + delta) + fFunction(xMean - delta));
135 if(depth > fMaxDepth)
138 "Function varies too rapidly !");
140 G4double xMean = (xInitial + xFinal) / 2.0;
144 if(std::fabs(leftHalf + rightHalf - full) < fTolerance)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double(*)(G4double) function
G4double AdaptGaussIntegration(G4double xInitial, G4double xFinal)
G4double Gauss(G4double xInitial, G4double xFinal, G4int iterationNumber)
G4SimpleIntegration(function pFunction)
G4double Trapezoidal(G4double xInitial, G4double xFinal, G4int iterationNumber)
G4double Simpson(G4double xInitial, G4double xFinal, G4int iterationNumber)
void AdaptGauss(G4double xInitial, G4double xFinal, G4double &sum, G4int &depth)
G4double MidPoint(G4double xInitial, G4double xFinal, G4int iterationNumber)