35 : fFunction(pFunction)
40 : fFunction(pFunction)
41 , fTolerance(pTolerance)
49 G4int iterationNumber)
51 G4double Step = (xFinal - xInitial) / iterationNumber;
52 G4double mean = (fFunction(xInitial) + fFunction(xFinal)) * 0.5;
54 for(
G4int i = 1; i < iterationNumber; ++i)
63 G4int iterationNumber)
65 G4double Step = (xFinal - xInitial) / iterationNumber;
68 for(
G4int i = 1; i < iterationNumber; ++i)
77 G4int iterationNumber)
80 static const G4double root = 1.0 / std::sqrt(3.0);
81 G4double Step = (xFinal - xInitial) / (2.0 * iterationNumber);
84 for(
G4int i = 0; i < iterationNumber; ++i)
86 x = (2 * i + 1) * Step;
87 mean += (fFunction(x + delta) + fFunction(x - delta));
93 G4int iterationNumber)
95 G4double Step = (xFinal - xInitial) / iterationNumber;
97 G4double xPlus = xInitial + 0.5 * Step;
98 G4double mean = (fFunction(xInitial) + fFunction(xFinal)) * 0.5;
100 for(
G4int i = 1; i < iterationNumber; ++i)
104 mean += fFunction(x);
105 sum += fFunction(xPlus);
108 return mean * Step / 3.0;
124 static const G4double root = 1.0 / std::sqrt(3.0);
126 G4double xMean = (xInitial + xFinal) / 2.0;
127 G4double Step = (xFinal - xInitial) / 2.0;
129 G4double sum = (fFunction(xMean + delta) + fFunction(xMean - delta));
137 if(depth > fMaxDepth)
140 "Function varies too rapidly !");
142 G4double xMean = (xInitial + xFinal) / 2.0;
146 if(std::fabs(leftHalf + rightHalf - full) < fTolerance)
G4double(* function)(G4double)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
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)