36 G4int G4SimpleIntegration::fMaxDepth = 100 ;
40 : fFunction(pFunction),
47 : fFunction(pFunction),
48 fTolerance(pTolerance)
62 G4int iterationNumber )
65 G4double mean = (fFunction(xInitial) + fFunction(xFinal))*0.5 ;
67 for(
G4int i=1;i<iterationNumber;i++)
70 mean += fFunction(x) ;
78 G4int iterationNumber )
83 for(
G4int i=1;i<iterationNumber;i++)
86 mean += fFunction(x) ;
94 G4int iterationNumber )
97 static G4double root = 1.0/std::sqrt(3.0) ;
98 G4double Step = (xFinal - xInitial)/(2.0*iterationNumber) ;
101 for(
G4int i=0;i<iterationNumber;i++)
104 mean += (fFunction(x+delta) + fFunction(x-delta)) ;
112 G4int iterationNumber )
116 G4double xPlus = xInitial + 0.5*Step ;
117 G4double mean = (fFunction(xInitial) + fFunction(xFinal))*0.5 ;
119 for(
G4int i=1;i<iterationNumber;i++)
123 mean += fFunction(x) ;
124 sum += fFunction(xPlus) ;
127 return mean*Step/3.0 ;
149 static G4double root = 1.0/std::sqrt(3.0) ;
151 G4double xMean = (xInitial + xFinal)/2.0 ;
154 G4double sum = (fFunction(xMean + delta) + fFunction(xMean - delta)) ;
168 G4Exception(
"G4SimpleIntegration::AdaptGauss()",
"Error",
171 G4double xMean = (xInitial + xFinal)/2.0 ;
175 if(std::fabs(leftHalf+rightHalf-full) < fTolerance)