65 fSecondDerivative(new
G4double[number]),
70 const G4double maxDerivative = 0.99e30 ;
78 if(pFirstDerStart > maxDerivative)
94 for(i=1;i<fNumber-1;i++)
103 if(pFirstDerFinish > maxDerivative)
121 for(
G4int k=fNumber-2;k>=0;k--)
151 G4int i=0, j=1, k=0 ;
152 G4double mult=0.0, difi=0.0, deltaLow=0.0, deltaUp=0.0,
cd=0.0,
y=0.0 ;
170 for(i=0;i<fNumber-j;i++)
175 mult = deltaLow - deltaUp ;
178 G4Exception(
"G4DataInterpolation::PolynomInterpolation()",
182 d[i] = deltaUp*mult ;
183 c[i] = deltaLow*mult ;
185 y += (deltaY = (2*k < (fNumber - j -1) ? c[k+1] : d[k--] )) ;
211 tempArgument[i] = cof[i] = 0.0 ;
213 tempArgument[fNumber-1] = -
fArgument[0] ;
217 for(j=fNumber-1-i;j<fNumber-1;j++)
219 tempArgument[j] -=
fArgument[i]*tempArgument[j+1] ;
221 tempArgument[fNumber-1] -=
fArgument[i] ;
226 for(j=fNumber-1;j>=1;j--)
228 factor = j*tempArgument[j] + factor*
fArgument[i] ;
232 for(j=fNumber-1;j>=0;j--)
234 cof[j] += mult*reducedY ;
235 mult = tempArgument[j] + mult*
fArgument[i] ;
238 delete[] tempArgument ;
252 G4int i=0, j=1, k=0 ;
253 const G4double tolerance = 1.6e-24 ;
254 G4double mult=0.0, difi=0.0,
cd=0.0,
y=0.0, cof=0.0 ;
280 for(i=0;i<fNumber-j;i++)
285 mult = cof - c[i+1] ;
288 G4Exception(
"G4DataInterpolation::RationalPolInterpolation()",
295 y += (deltaY = (2*k < (fNumber - j - 1) ? c[k+1] : d[k--] )) ;
318 while((kHigh - kLow) > 1)
320 k = (kHigh + kLow) >> 1 ;
331 if (!(deltaHL != 0.0))
333 G4Exception(
"G4DataInterpolation::CubicSplineInterpolation()",
336 G4double a = (fArgument[kHigh] - pX)/deltaHL ;
337 G4double b = (pX - fArgument[kLow])/deltaHL ;
359 G4Exception(
"G4DataInterpolation::FastCubicSpline()",
362 G4double a = (fArgument[index+1] - pX)/delta ;
363 G4double b = (pX - fArgument[index])/delta ;
382 while((kHigh - kLow) > 1)
384 k = (kHigh + kLow) >> 1 ;
417 G4int kHigh=0, k=0, Increment=0 ;
420 if(index < 0 || index >
fNumber-1)
436 while((pX >=
fArgument[kHigh]) == ascend)
439 Increment += Increment ;
440 kHigh = index + Increment ;
460 if(Increment >= kHigh)
467 index = kHigh - Increment ;
474 while((kHigh - index) != 1)
476 k = (kHigh + index) >> 1 ;
std::vector< ExP01TrackerHit * > a
G4int LocateArgument(G4double pX) const
void PolIntCoefficient(G4double cof[]) const
G4double RationalPolInterpolation(G4double pX, G4double &deltaY) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double CubicSplineInterpolation(G4double pX) const
G4double FastCubicSpline(G4double pX, G4int index) const
G4double * fSecondDerivative
void CorrelatedSearch(G4double pX, G4int &index) const
G4DataInterpolation(G4double pX[], G4double pY[], G4int number)
G4double PolynomInterpolation(G4double pX, G4double &deltaY) const