#include <G4DataInterpolation.hh>
|
| G4DataInterpolation (G4double pX[], G4double pY[], G4int number) |
|
| G4DataInterpolation (G4double pX[], G4double pY[], G4int number, G4double pFirstDerStart, G4double pFirstDerFinish) |
|
| ~G4DataInterpolation () |
|
G4double | PolynomInterpolation (G4double pX, G4double &deltaY) const |
|
void | PolIntCoefficient (G4double cof[]) const |
|
G4double | RationalPolInterpolation (G4double pX, G4double &deltaY) const |
|
G4double | CubicSplineInterpolation (G4double pX) const |
|
G4double | FastCubicSpline (G4double pX, G4int index) const |
|
G4int | LocateArgument (G4double pX) const |
|
void | CorrelatedSearch (G4double pX, G4int &index) const |
|
Definition at line 116 of file G4DataInterpolation.hh.
◆ G4DataInterpolation() [1/3]
◆ G4DataInterpolation() [2/3]
Definition at line 58 of file G4DataInterpolation.cc.
69 G4double p=0.0, qn=0.0, sig=0.0, un=0.0 ;
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--)
G4double * fSecondDerivative
◆ ~G4DataInterpolation()
G4DataInterpolation::~G4DataInterpolation |
( |
| ) |
|
◆ G4DataInterpolation() [3/3]
◆ CorrelatedSearch()
void G4DataInterpolation::CorrelatedSearch |
( |
G4double |
pX, |
|
|
G4int & |
index |
|
) |
| const |
Definition at line 414 of file G4DataInterpolation.cc.
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 ;
◆ CubicSplineInterpolation()
Definition at line 311 of file G4DataInterpolation.cc.
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 ;
G4double * fSecondDerivative
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
◆ FastCubicSpline()
Definition at line 353 of file G4DataInterpolation.cc.
359 G4Exception(
"G4DataInterpolation::FastCubicSpline()",
G4double * fSecondDerivative
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
◆ LocateArgument()
◆ operator=()
◆ PolIntCoefficient()
void G4DataInterpolation::PolIntCoefficient |
( |
G4double |
cof[] | ) |
const |
Definition at line 202 of file G4DataInterpolation.cc.
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 ;
static const G4double factor
◆ PolynomInterpolation()
Definition at line 148 of file G4DataInterpolation.cc.
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--] )) ;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
◆ RationalPolInterpolation()
Definition at line 249 of file G4DataInterpolation.cc.
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++)
285 mult = cof - c[i+1] ;
288 G4Exception(
"G4DataInterpolation::RationalPolInterpolation()",
295 y += (deltaY = (2*k < (fNumber - j - 1) ? c[k+1] : d[k--] )) ;
static const G4double tolerance
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
◆ fArgument
G4double* G4DataInterpolation::fArgument |
|
private |
◆ fFunction
G4double* G4DataInterpolation::fFunction |
|
private |
◆ fNumber
G4int G4DataInterpolation::fNumber |
|
private |
◆ fSecondDerivative
G4double* G4DataInterpolation::fSecondDerivative |
|
private |
The documentation for this class was generated from the following files: