62 , fSecondDerivative(new
G4double[number])
66 G4double p = 0.0, qn = 0.0, sig = 0.0, un = 0.0;
67 const G4double maxDerivative = 0.99e30;
75 if(pFirstDerStart > maxDerivative)
91 for(i = 1; i <
fNumber - 1; ++i)
103 if(pFirstDerFinish > maxDerivative)
152 G4int i = 0, j = 1, k = 0;
153 G4double mult = 0.0, difi = 0.0, deltaLow = 0.0, deltaUp = 0.0,
cd = 0.0,
172 for(i = 0; i <
fNumber - j; ++i)
176 cd = c[i + 1] - d[i];
177 mult = deltaLow - deltaUp;
180 G4Exception(
"G4DataInterpolation::PolynomInterpolation()",
"Error",
184 d[i] = deltaUp * mult;
185 c[i] = deltaLow * mult;
187 y += (deltaY = (2 * k < (
fNumber - j - 1) ? c[k + 1] : d[k--]));
207 G4double reducedY = 0.0, mult = 1.0;
212 tempArgument[i] = cof[i] = 0.0;
220 tempArgument[j] -=
fArgument[i] * tempArgument[j + 1];
227 for(j =
fNumber - 1; j >= 1; --j)
229 factor = j * tempArgument[j] + factor *
fArgument[i];
233 for(j =
fNumber - 1; j >= 0; --j)
235 cof[j] += mult * reducedY;
236 mult = tempArgument[j] + mult *
fArgument[i];
239 delete[] tempArgument;
252 G4int i = 0, j = 1, k = 0;
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)
282 cd = c[i + 1] - d[i];
285 mult = cof - c[i + 1];
288 G4Exception(
"G4DataInterpolation::RationalPolInterpolation()",
"Error",
292 d[i] = c[i + 1] * mult;
295 y += (deltaY = (2 * k < (
fNumber - j - 1) ? c[k + 1] : d[k--]));
317 while((kHigh - kLow) > 1)
319 k = (kHigh + kLow) >> 1;
330 if(!(deltaHL != 0.0))
332 G4Exception(
"G4DataInterpolation::CubicSplineInterpolation()",
"Error",
343 deltaHL * deltaHL / 6.0;
357 G4Exception(
"G4DataInterpolation::FastCubicSpline()",
"Error",
380 while((kHigh - kLow) > 1)
382 k = (kHigh + kLow) >> 1;
414 G4int kHigh = 0, k = 0, Increment = 0;
417 if(index < 0 || index >
fNumber - 1)
433 while((pX >=
fArgument[kHigh]) == ascend)
436 Increment += Increment;
437 kHigh = index + Increment;
457 if(Increment >= kHigh)
464 index = kHigh - Increment;
471 while((kHigh - index) != 1)
473 k = (kHigh + index) >> 1;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double RationalPolInterpolation(G4double pX, G4double &deltaY) const
void CorrelatedSearch(G4double pX, G4int &index) const
G4double FastCubicSpline(G4double pX, G4int index) const
G4DataInterpolation(G4double pX[], G4double pY[], G4int number)
G4double PolynomInterpolation(G4double pX, G4double &deltaY) const
G4int LocateArgument(G4double pX) const
G4double * fSecondDerivative
G4double CubicSplineInterpolation(G4double pX) const
void PolIntCoefficient(G4double cof[]) const