35 {
if(theInstance == 0) {
37 theInstance = &interpolator;
44 {
if(theInstance == 0) {
46 theInstance = &interpolator;
53 G4AdjointInterpolator::G4AdjointInterpolator()
72 G4double B=std::log(y2/y1)/std::log(x2/x1);
82 {
G4double B=(std::log(y2)-std::log(y1));
92 if (InterPolMethod ==
"Log" ){
95 else if (InterPolMethod ==
"Lin" ){
98 else if (InterPolMethod ==
"Exp" ){
113 size_t ndim = x_vec.size();
115 size_t ind2 = ndim - 1;
127 if (x_vec[0] < x_vec[1] ) {
129 size_t midBin = (ind1 + ind2)/2;
130 if (x < x_vec[midBin])
134 }
while (ind2 - ind1 > 1);
138 size_t midBin = (ind1 + ind2)/2;
139 if (x < x_vec[midBin])
143 }
while (ind2 - ind1 > 1);
181 return Interpolation( x,x_vec[i],x_vec[i+1],y_vec[i],y_vec[i+1],InterPolMethod);
189 if (x>x0) ind=
int((x-x0)/dx);
190 if (ind >= index_vec.size()-1) ind= index_vec.size()-2;
191 size_t ind1 = index_vec[ind];
192 size_t ind2 = index_vec[ind+1];
201 return Interpolation( x,x_vec[ind],x_vec[ind+1],y_vec[ind],y_vec[ind+1],
"Lin");