31 #ifndef G4NeutronHPInterpolator_h
32 #define G4NeutronHPInterpolator_h 1
54 if(x2-x1==0)
return (y2+y1)/2.;
55 slope = (y2-
y1)/(x2-x1);
89 G4int theScheme = aScheme;
96 result = LinearLinear(x, x1, x2, y1, y2);
99 result = LinearLinear(x, x1, x2, y1, y2);
102 result = LinearLogarithmic(x, x1, x2, y1, y2);
105 result = LogarithmicLinear(x, x1, x2, y1, y2);
108 result = LogarithmicLogarithmic(x, x1, x2, y1, y2);
111 result = Random(x, x1, x2, y1, y2);
115 throw G4HadronicException(__FILE__, __LINE__,
"G4NeutronHPInterpolator::Carthesian Invalid InterpolationScheme");
121 inline G4double G4NeutronHPInterpolator::
129 inline G4double G4NeutronHPInterpolator::
133 if(x2-x1==0)
return (y2+y1)/2.;
134 slope = (y2-
y1)/(x2-x1);
140 inline G4double G4NeutronHPInterpolator::
144 if(x==0) result = y1+y2/2.;
145 else if(x1==0) result =
y1;
146 else if(x2==0) result =
y2;
147 else result = LinearLinear(std::log(x), std::log(x1), std::log(x2), y1, y2);
151 inline G4double G4NeutronHPInterpolator::
155 if(y1==0||y2==0) result = 0;
158 result = LinearLinear(x, x1, x2, std::log(y1), std::log(y2));
159 result = std::exp(result);
164 inline G4double G4NeutronHPInterpolator::
168 if(x==0) result = y1+y2/2.;
169 else if(x1==0) result =
y1;
170 else if(x2==0) result =
y2;
171 if(y1==0||y2==0) result = 0;
174 result = LinearLinear(std::log(x), std::log(x1), std::log(x2), std::log(y1), std::log(y2));
175 result = std::exp(result);
180 inline G4double G4NeutronHPInterpolator::
~G4NeutronHPInterpolator()
G4double G4NeutronHPJENDLHEData::G4double result
G4double Interpolate(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
G4double GetWeightedBinIntegral(const G4InterpolationScheme &aScheme, const G4double x1, const G4double x2, const G4double y1, const G4double y2)
G4GLOB_DLL std::ostream G4cout
G4double GetBinIntegral(const G4InterpolationScheme &aScheme, const G4double x1, const G4double x2, const G4double y1, const G4double y2)
G4double Lin(G4double x, G4double x1, G4double x2, G4double y1, G4double y2)
G4NeutronHPInterpolator()