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));
58 if(y1==0||y2==0) result =0;
61 G4double b = (std::log(y2)-std::log(y1))/(x2-x1);
68 result = (std::exp(a)/b)*(std::exp(b*x2)-std::exp(b*x1));
78 if(x1==0) result = y1;
79 else if(x2==0) result = y2;
80 else if(y1==0||y2==0) result =0;
83 G4double b = (std::log(y2)-std::log(y1))/(std::log(x2)-std::log(x1));
84 G4double a = std::log(y1) - b*std::log(x1);;
85 result = (std::exp(a)/(b+1))*(std::pow(x2,b+1)-std::pow(x1,b+1));
90 throw G4HadronicException(__FILE__, __LINE__,
"Unknown interpolation scheme in G4NeutronHPVector::Integrate");
101 result = 0.5*y1*(x2*x2-x1*x1);
110 result = (y1*x2 - y2*x1)*(x2 + x1)/2. + (y2-y1)*(x2*x2 + x2*x1 + x1*x1)/3.;
114 if(x1==0) result = y1;
115 else if(x2==0) result = y2;
118 G4double b = (y2-y1)/(std::log(x2)-std::log(x1));
120 result = ( x2*x2/2. * (a-b/2.+b*std::log(x2)) )
121 -( x1*x1/2. * (a-b/2.+b*std::log(x1)) );
126 if(y1==0||y2==0) result = 0;
129 G4double b = (std::log(y2)-std::log(y1))/(x2-x1);
131 result = std::exp(a)/(b*b)*( std::exp(b*x2)*(b*x2-1.) - std::exp(b*x1)*(b*x1-1.) );
136 if(x1==0) result = y1;
137 else if(x2==0) result = y2;
138 if(y1==0||y2==0) result = 0;
141 G4double b = (std::log(y2)-std::log(y1))/(std::log(x2)-std::log(x1));
142 G4double a = std::log(y1) - b*std::log(x1);;
143 result = std::exp(a)/(b+2.)*( std::pow(x2, b+2.) - std::pow(x1, b+2) );
148 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)