42 : fFunction(pFunction)
44 , fChebyshevCof(new
G4double[fNumber])
45 , fMean(0.5 * (b + a))
46 , fDiff(0.5 * (b - a))
56 rootSum = std::cos(cof * (i + 0.5));
66 rootSum += tempFunction[i] * std::cos(cofj * (i + 0.5));
70 delete[] tempFunction;
83 : fFunction(pFunction)
85 , fChebyshevCof(new
G4double[fNumber])
86 , fMean(0.5 * (b + a))
87 , fDiff(0.5 * (b - a))
91 G4Exception(
"G4ChebyshevApproximation::G4ChebyshevApproximation()",
102 rootSum = std::cos(cof * (i + 0.5));
112 rootSum += tempFunction[i] * std::cos(cofj * (i + 0.5));
118 for(i = 1; i <= mx; ++i)
127 delete[] tempFunction;
138 : fFunction(pFunction)
140 , fChebyshevCof(new
G4double[fNumber])
141 , fMean(0.5 * (b + a))
142 , fDiff(0.5 * (b - a))
152 rootSum = std::cos(cof * (i + 0.5));
162 rootSum += tempFunction[i] * std::cos(cofj * (i + 0.5));
173 delete[] tempFunction;
192 if(number < 0 && number >=
fNumber)
194 G4Exception(
"G4ChebyshevApproximation::GetChebyshevCof()",
"InvalidCall",
207 G4double evaluate = 0.0, evaluate2 = 0.0, temp = 0.0, xReduced = 0.0,
212 G4Exception(
"G4ChebyshevApproximation::ChebyshevEvaluation()",
216 xReduced2 = 2.0 * xReduced;
220 evaluate = xReduced2 * evaluate - evaluate2 +
fChebyshevCof[i];
223 return xReduced * evaluate - evaluate2 + 0.5 *
fChebyshevCof[0];
238 derCof[i] = derCof[i + 2] + 2 * (i + 1) *
fChebyshevCof[i + 1];
262 sum += factor * integralCof[i];
266 sum += factor * integralCof[
fNumber - 1];
267 integralCof[0] = 2.0 * sum;
G4double(* function)(G4double)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
static constexpr double pi
~G4ChebyshevApproximation()
G4double GetChebyshevCof(G4int number) const
G4ChebyshevApproximation(function pFunction, G4int n, G4double a, G4double b)
void DerivativeChebyshevCof(G4double derCof[]) const
void IntegralChebyshevCof(G4double integralCof[]) const
G4double ChebyshevEvaluation(G4double x) const