43 result = 0.5*(y2+y1)*(x2-x1);
47 if(x1==0) result = y1;
48 else if(x2==0) result = y2;
51 G4double b = (y2-y1)/(std::log(x2)-std::log(x1));
53 result = (a-b)*(x2-x1) + b*(x2*std::log(x2)-x1*std::log(x1));
68 result = (x2-x1)*(y2-y1)/std::log(y2/y1);
77 if(x1==0) result = y1;
78 else if(x2==0) result = y2;
79 else if(y1==0||y2==0) result =0;
82 G4double b = (std::log(y2)-std::log(y1))/(std::log(x2)-std::log(x1));
83 G4double a = std::log(y1) - b*std::log(x1);;
84 result = (std::exp(a)/(b+1))*(std::pow(x2,b+1)-std::pow(x1,b+1));
89 throw G4HadronicException(__FILE__, __LINE__,
"Unknown interpolation scheme in G4NeutronHPVector::Integrate");
100 result = 0.5*y1*(x2*x2-x1*x1);
109 result = (y1*x2 - y2*x1)*(x2 + x1)/2. + (y2-y1)*(x2*x2 + x2*x1 + x1*x1)/3.;
113 if(x1==0) result = y1;
114 else if(x2==0) result = y2;
117 G4double b = (y2-y1)/(std::log(x2)-std::log(x1));
119 result = ( x2*x2/2. * (a-b/2.+b*std::log(x2)) )
120 -( x1*x1/2. * (a-b/2.+b*std::log(x1)) );
125 if(y1==0||y2==0) result = 0;
128 G4double b = (std::log(y2)-std::log(y1))/(x2-x1);
130 result = std::exp(a)/(b*b)*( std::exp(b*x2)*(b*x2-1.) - std::exp(b*x1)*(b*x1-1.) );
135 if(x1==0) result = y1;
136 else if(x2==0) result = y2;
137 if(y1==0||y2==0) result = 0;
140 G4double b = (std::log(y2)-std::log(y1))/(std::log(x2)-std::log(x1));
141 G4double a = std::log(y1) - b*std::log(x1);;
142 result = std::exp(a)/(b+2.)*( std::pow(x2, b+2.) - std::pow(x1, b+2) );
147 throw G4HadronicException(__FILE__, __LINE__,
"Unknown interpolation scheme in G4NeutronHPVector::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)