Commit 8722ae2a authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

bicubicRemap(): changed interface.

parent 2da6de93
......@@ -75,18 +75,20 @@ bicubicWarning()
}
}
static void
bicubicRemap(double *restrict tgt_point, const double *restrict src_array, double wgts[4][4], const size_t src_add[4],
static double
bicubicRemap(const double *restrict src_array, double wgts[4][4], const size_t src_add[4],
RemapGradients &gradients)
{
const auto &glat = gradients.grad_lat;
const auto &glon = gradients.grad_lon;
const auto &glatlon = gradients.grad_latlon;
*tgt_point = 0.;
double tgt_point = 0.;
for (unsigned n = 0; n < 4; ++n)
*tgt_point += src_array[src_add[n]] * wgts[n][0] + glat[src_add[n]] * wgts[n][1] + glon[src_add[n]] * wgts[n][2]
+ glatlon[src_add[n]] * wgts[n][3];
tgt_point += src_array[src_add[n]] * wgts[n][0] + glat[src_add[n]] * wgts[n][1] + glon[src_add[n]] * wgts[n][2]
+ glatlon[src_add[n]] * wgts[n][3];
return tgt_point;
}
/*
......@@ -280,7 +282,7 @@ remapBicubic(RemapSearch &rsearch, const double *restrict src_array, double *res
// Successfully found iw,jw - compute weights
bicubicSetWeights(iw, jw, wgts);
sort_add_and_wgts4(4, src_add, wgts);
bicubicRemap(&tgt_array[tgt_cell_add], src_array, wgts, src_add, gradients);
tgt_array[tgt_cell_add] = bicubicRemap(src_array, wgts, src_add, gradients);
}
else
{
......@@ -300,7 +302,7 @@ remapBicubic(RemapSearch &rsearch, const double *restrict src_array, double *res
tgt_grid->cell_frac[tgt_cell_add] = 1.;
renormalizeWeights(src_lats, wgts);
sort_add_and_wgts4(4, src_add, wgts);
bicubicRemap(&tgt_array[tgt_cell_add], src_array, wgts, src_add, gradients);
tgt_array[tgt_cell_add] = bicubicRemap(src_array, wgts, src_add, gradients);
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment