Skip to content
Snippets Groups Projects

ENH: Allow `Splinterpolator` instances to be created from an existing set of spline coefficients, and extend extrapolation options

Merged Paul McCarthy requested to merge enh/splinterpolator into master
Compare and Show latest version
1 file
+ 11
3
Compare changes
  • Side-by-side
  • Inline
+ 11
3
@@ -812,10 +812,18 @@ unsigned int Splinterpolator<T>::get_start_indicies(const double *coord, int *si
@@ -812,10 +812,18 @@ unsigned int Splinterpolator<T>::get_start_indicies(const double *coord, int *si
{
{
unsigned int ni = _order+1;
unsigned int ni = _order+1;
for (unsigned int i=0; i<_ndim; i++) {
if (odd(ni)) {
sinds[i] = std::ceil(coord[i]) - ni/2;
for (unsigned int i=0; i<_ndim; i++) {
 
sinds[i] = static_cast<int>(coord[i]+0.5) - ni/2;
 
}
 
}
 
else {
 
for (unsigned int i=0; i<_ndim; i++) {
 
int ix = static_cast<int>(coord[i]+0.5);
 
if (ix < coord[i]) sinds[i] = ix - (ni-1)/2;
 
else sinds[i] = ix -ni/2;
 
}
}
}
for (unsigned int i=_ndim; i<5; i++) sinds[i] = 0;
for (unsigned int i=_ndim; i<5; i++) sinds[i] = 0;
return(ni);
return(ni);
Loading