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

BF: Fix bug in code that controls which adjacent spline coefficients to

include when interpolating
parent bc2d8fd8
No related branches found
No related tags found
No related merge requests found
Pipeline #25436 skipped
This commit is part of merge request !17. Comments created here will be created in the context of that merge request.
......@@ -812,18 +812,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