45 numberOfXNodes(0), numberOfYNodes(0),
46 verboseLevel(0), useBicubic(false)
53 numberOfXNodes(nx), numberOfYNodes(ny),
54 verboseLevel(0), useBicubic(false)
89 if (&right==
this) {
return *
this; }
148 size_t& idx,
size_t& idy)
const
181 return ((y2 - y)*(v11*(x2 - x) + v12*(x - x1)) +
182 ((y - y1)*(v21*(x2 - x) + v22*(x - x1))))/((x2 - x1)*(y2 - y1));
190 size_t idx,
size_t idy)
const
238 f1 + f1y*h2 + (3*(f4-
f1) - 2*f1y - f4y)*h22 + (2*(f1 -
f4) + f1y + f4y)*h23
239 + f1x*h1 + f1xy*h1*h2 +(3*(f4x - f1x) - 2*f1xy - f4xy)*h1*h22
240 + (2*(f1x - f4x) + f1xy + f4xy)*h1*h23
241 + (3*(f2 -
f1) - 2*f1x - f2x)*h12 + (3*f2y - 3*f1y - 2*f1xy - f2xy)*h12*h2
242 + (9*(f1 - f2 + f3 - f4) + 6*f1x + 3*f2x - 3*f3x - 6*f4x + 6*f1y - 6*f2y
243 - 3*f3y + 3*f4y + 4*f1xy + 2*f2xy + f3xy + 2*f4xy)*h12*h22
244 + (6*(-f1 + f2 - f3 + f4) - 4*f1x - 2*f2x + 2*f3x + 4*f4x - 3*f1y
245 + 3*f2y + 3*f3y - 3*f4y - 2*f1xy - f2xy - f3xy - 2*f4xy)*h12*h23
246 + (2*(f1 - f2) + f1x + f2x)*h13 + (2*(f1y - f2y) + f1xy + f2xy)*h13*h2
247 + (6*(-f1 + f2 -f3 + f4) + 3*(-f1x - f2x + f3x + f4x) - 4*f1y
248 + 4*f2y + 2*f3y - 2*f4y - 2*f1xy - 2*f2xy - f3xy - f4xy)*h13*h22
249 + (4*(f1 - f2 + f3 -
f4) + 2*(f1x + f2x - f3x - f4x)
250 + 2*(f1y - f2y - f3y + f4y) + f1xy + f2xy + f3xy + f4xy)*h13*h23;
257 const std::vector<G4double>& vecY)
279 out << std::setprecision(5);
291 for(
size_t i = 0; i<numberOfXNodes-1; ++i) {
315 if( 0 >= numberOfYNodes || numberOfYNodes >=
INT_MAX) {
327 if (in.fail()) {
return false; }
331 if (in.fail()) {
return false; }
336 if (in.fail()) {
return false; }
364 size_t lowerBound = 0;
365 size_t upperBound = v.size() - 2;
367 while (lowerBound <= upperBound)
369 size_t midBin = (lowerBound + upperBound)/2;
370 if( z < v[midBin] ) { upperBound = midBin-1; }
371 else { lowerBound = midBin+1; }
399 res += (x2 - x1)*(y - yVector[idy])/del;
409 size_t nn = v.size();
410 if(1 >= nn) {
return 0.0; }
421 n2 = (n3 + n1 + 1)/2;
426 res += (y - v[n1])*(
xVector[n3] - res)/del;
std::vector< G4double > G4PV2DDataVector
G4double DerivativeX(size_t idx, size_t idy, G4double fac) const
G4double GetValue(size_t idx, size_t idy) const
G4double InterpolateLinearX(G4PV2DDataVector &v, G4double rand) const
void Store(std::ofstream &fOut)
size_t FindBinLocation(G4double z, const G4PV2DDataVector &) const
size_t FindBinLocationX(G4double x, size_t lastidx) const
void CopyData(const G4Physics2DVector &vec)
std::vector< G4PV2DDataVector * > value
void PutValue(size_t idx, size_t idy, G4double value)
G4double Value(G4double x, G4double y, size_t &lastidx, size_t &lastidy) const
G4double DerivativeY(size_t idx, size_t idy, G4double fac) const
G4Physics2DVector & operator=(const G4Physics2DVector &)
G4double DerivativeXY(size_t idx, size_t idy, G4double fac) const
static const G4double factor
G4bool Retrieve(std::ifstream &fIn)
G4double BicubicInterpolation(G4double x, G4double y, size_t idx, size_t idy) const
size_t FindBinLocationY(G4double y, size_t lastidy) const
void PutVectors(const std::vector< G4double > &vecX, const std::vector< G4double > &vecY)
void ScaleVector(G4double factor)
G4double FindLinearX(G4double rand, G4double y, size_t &lastidy) const