14 #ifndef INCLUDED_basic_interpolate_hh
15 #define INCLUDED_basic_interpolate_hh
32 double const binrange,
50 double const binrange,
66 double const binrange,
88 double const binrange,
109 double const binrange,
159 double const binrange,
168 int const nbins =
static_cast< int >( 360.0 / binrange );
180 ObjexxFCL::mod( (x-(0.5*binrange))/binrange, static_cast< double >(nbins) ) + nbins,
181 static_cast< double >(nbins) );
185 xbin =
static_cast< int >( xbin_real );
193 xd = xbin_real - xbin;
204 if ( xbin == nbins + 1 ) {
267 int const xbin_count,
268 int const ybin_count,
269 double const binrange,
276 xy_func.
dimension( xbin_count, ybin_count );
279 double const x0y0 = xy_func(xbin,ybin);
280 double const x1y0 = xy_func(xbin_next,ybin);
281 double const x0y1 = xy_func(xbin,ybin_next);
282 double const x1y1 = xy_func(xbin_next,ybin_next);
301 int const xbin_count,
302 int const ybin_count,
303 int const zbin_count,
304 double const binrange,
312 xyz_func.
dimension( xbin_count, ybin_count, zbin_count );
314 double const x0y0z0 = xyz_func( xbin, ybin, zbin );
315 double const x1y0z0 = xyz_func( xbin_next, ybin, zbin );
316 double const x0y1z0 = xyz_func( xbin, ybin_next, zbin );
317 double const x1y1z0 = xyz_func( xbin_next,ybin_next, zbin );
318 double const x0y0z1 = xyz_func( xbin, ybin, zbin_next );
319 double const x1y0z1 = xyz_func( xbin_next, ybin, zbin_next );
320 double const x0y1z1 = xyz_func( xbin, ybin_next, zbin_next );
321 double const x1y1z1 = xyz_func( xbin_next, ybin_next, zbin_next );
324 x0y0z0, x1y0z0, x0y1z0, x1y1z0,
325 x0y0z1, x1y0z1, x0y1z1, x1y1z1,
326 xd, yd, zd, binrange, angles,
327 val, dval_dx, dval_dy, dval_dz );
374 int const nbins = { 36 };
378 double const binrange = { 10.0f };
381 int xbin,ybin,xbin_next,ybin_next;
388 bool const treat_as_angles =
false;
391 binrange,treat_as_angles,val,dval_dx,dval_dy);
FArray3A: Fortran-Compatible 3D Argument Array.
FArray2A: Fortran-Compatible 2D Argument Array.
void interpolate_trilinear(int const xbin, int const xbin_next, double const xd, int const ybin, int const ybin_next, double const yd, int const zbin, int const zbin_next, double const zd, ObjexxFCL::FArray3A< double > xyz_func, int const xbin_count, int const ybin_count, int const zbin_count, double const binrange, bool const angles, double &val, double &dval_dx, double &dval_dy, double &dval_dz)
void interpolate_trilinear_by_value(double const x0y0z0, double const x1y0z0, double const x0y1z0, double const x1y1z0, double const x0y0z1, double const x1y0z1, double const x0y1z1, double const x1y1z1, double const xd, double const yd, double const zd, double const binrange, bool const angles, double &val, double &dval_dx, double &dval_dy, double &dval_dz)
paraphazed from above for three dimentions Without additional scaling this will only work if the bin ...
FArray3A & dimension(IR const &I1_a, IR const &I2_a, IR const &I3_a)
Dimension by IndexRange.
FArray2A & dimension(IR const &I1_a, IR const &I2_a)
Dimension by IndexRange.
void interpolate_bilinear_by_value(double const x0y0, double const x1y0, double const x0y1, double const x1y1, double const xd, double const yd, double const binrange, bool const angles, double &val, double &dval_dx, double &dval_dy)
get bilinear interpolate, given four points of a 2d periodic function
void interpolate_bilinear(int const xbin, int const xbin_next, double const xd, int const ybin, int const ybin_next, double const yd, ObjexxFCL::FArray2A< double > xy_func, int const xbin_count, int const ybin_count, double const binrange, bool const angles, double &val, double &dval_dx, double &dval_dy)
get bilinear interpolate of a 2d periodic function
void interpolate_get_angle_bins(double const x, double const binrange, int &xbin, int &xbin_next, double &xd)
get bin information for a periodic value w/ periodic bins
T mod(T const &x, T const &y)
x(mod y) computational modulo returning magnitude < | y | and sign of x
void interpolate_2d_func_of_angles(double const x, double const y, ObjexxFCL::FArray2A< double > xy_func, double &val, double &dval_dx, double &dval_dy)
get bilinear interpolate of a 2d function with degree angle arguments