42 : fFunction(pFunction), fNumber(n),
43 fChebyshevCof(new
G4double[fNumber]),
44 fMean(0.5*(b+a)), fDiff(0.5*(b-a))
54 rootSum = std::cos(cof*(i+0.5)) ;
64 rootSum += tempFunction[i]*std::cos(cofj*(i+0.5)) ;
68 delete[] tempFunction ;
82 : fFunction(pFunction), fNumber(nx),
83 fChebyshevCof(new
G4double[fNumber]),
84 fMean(0.5*(b+a)), fDiff(0.5*(b-a))
88 G4Exception(
"G4ChebyshevApproximation::G4ChebyshevApproximation()",
99 rootSum = std::cos(cof*(i+0.5)) ;
109 rootSum += tempFunction[i]*std::cos(cofj*(i+0.5)) ;
124 delete[] tempFunction ;
136 : fFunction(pFunction), fNumber(n),
137 fChebyshevCof(new
G4double[fNumber]),
138 fMean(0.5*(b+a)), fDiff(0.5*(b-a))
148 rootSum = std::cos(cof*(i+0.5)) ;
158 rootSum += tempFunction[i]*std::cos(cofj*(i+0.5)) ;
169 delete[] tempFunction ;
192 if(number < 0 && number >=
fNumber)
194 G4Exception(
"G4ChebyshevApproximation::GetChebyshevCof()",
208 G4double evaluate = 0.0, evaluate2 = 0.0, temp = 0.0,
209 xReduced = 0.0, xReduced2 = 0.0 ;
213 G4Exception(
"G4ChebyshevApproximation::ChebyshevEvaluation()",
217 xReduced2 = 2.0*xReduced ;
221 evaluate = xReduced2*evaluate - evaluate2 +
fChebyshevCof[i] ;
224 return xReduced*evaluate - evaluate2 + 0.5*
fChebyshevCof[0] ;
264 sum += factor*integralCof[i] ;
267 integralCof[fNumber-1] = cof*
fChebyshevCof[fNumber-2]/(fNumber-1) ;
268 sum += factor*integralCof[fNumber-1] ;
269 integralCof[0] = 2.0*
sum ;