Skip to content
Snippets Groups Projects
Commit 37d81a52 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

BF: Fix bug in code controlling which adjacent spline coefficients to use when interpolating

parent 7824d74c
No related branches found
No related tags found
1 merge request!18BF: Fix bug in code controlling which adjacent spline coefficients to use when interpolating
Pipeline #25438 skipped
......@@ -759,18 +759,10 @@ unsigned int Splinterpolator<T>::get_start_indicies(const double *coord, int *si
{
unsigned int ni = _order+1;
if (odd(ni)) {
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=0; i<_ndim; i++) {
sinds[i] = std::ceil(coord[i]) - ni/2;
}
for (unsigned int i=_ndim; i<5; i++) sinds[i] = 0;
return(ni);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment