45 result = 0.5*(y2+y1)*(x2-x1);
49 if(x1==0) result = y1;
50 else if(x2==0) result = y2;
53 G4double b = (y2-y1)/(std::log(x2)-std::log(x1));
55 result = (a-b)*(x2-x1) + b*(x2*std::log(x2)-x1*std::log(x1));
70 result = (x2-x1)*(y2-y1)/std::log(y2/y1);
79 if(x1==0) result = y1;
80 else if(x2==0) result = y2;
81 else if(y1==0||y2==0) result =0;
84 G4double b = (std::log(y2)-std::log(y1))/(std::log(x2)-std::log(x1));
85 G4double a = std::log(y1) - b*std::log(x1);;
86 result = (std::exp(a)/(b+1))*(std::pow(x2,b+1)-std::pow(x1,b+1));
91 throw G4HadronicException(__FILE__, __LINE__,
"Unknown interpolation scheme in G4ParticleHPVector::Integrate");
102 result = 0.5*y1*(x2*x2-x1*x1);
111 result = (y1*x2 - y2*x1)*(x2 + x1)/2. + (y2-y1)*(x2*x2 + x2*x1 + x1*x1)/3.;
115 if(x1==0) result = y1;
116 else if(x2==0) result = y2;
119 G4double b = (y2-y1)/(std::log(x2)-std::log(x1));
121 result = ( x2*x2/2. * (a-b/2.+b*std::log(x2)) )
122 -( x1*x1/2. * (a-b/2.+b*std::log(x1)) );
127 if(y1==0||y2==0) result = 0;
130 G4double b = (std::log(y2)-std::log(y1))/(x2-x1);
132 result = std::exp(a)/(b*b)*( std::exp(b*x2)*(b*x2-1.) - std::exp(b*x1)*(b*x1-1.) );
137 if(x1==0) result = y1;
138 else if(x2==0) result = y2;
139 if(y1==0||y2==0) result = 0;
142 G4double b = (std::log(y2)-std::log(y1))/(std::log(x2)-std::log(x1));
143 G4double a = std::log(y1) - b*std::log(x1);;
144 result = std::exp(a)/(b+2.)*( std::pow(x2, b+2.) - std::pow(x1, b+2) );
149 throw G4HadronicException(__FILE__, __LINE__,
"Unknown interpolation scheme in G4ParticleHPVector::Integrate");
G4double GetWeightedBinIntegral(const G4InterpolationScheme &aScheme, const G4double x1, const G4double x2, const G4double y1, const G4double y2)
G4double GetBinIntegral(const G4InterpolationScheme &aScheme, const G4double x1, const G4double x2, const G4double y1, const G4double y2)