Skip to content
Snippets Groups Projects
Commit 80bf8d23 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

remap_bicubic: allocate and init srcGridMask (bug fix)

parent 47d55d9d
No related branches found
No related tags found
1 merge request!225M214003/develop
......@@ -61,12 +61,10 @@ renormalize_weights(const double (&srcLats)[4], double (&weights)[4][4])
}
static void
bicubic_sort_weights(size_t (&indices)[4], double (&weights)[4][4])
bicubic_sort_weights_by_index(size_t (&indices)[4], double (&weights)[4][4])
{
constexpr size_t numWeights = 4;
if (is_sorted_list(numWeights, indices)) return;
struct IndexWeightX
{
size_t index;
......@@ -90,6 +88,15 @@ bicubic_sort_weights(size_t (&indices)[4], double (&weights)[4][4])
}
}
static void
bicubic_sort_weights(size_t (&indices)[4], double (&weights)[4][4])
{
constexpr size_t numWeights = 4;
if (is_sorted_list(numWeights, indices)) return;
bicubic_sort_weights_by_index(indices, weights);
}
static void
bicubic_warning()
{
......@@ -238,7 +245,7 @@ remap_bicubic(RemapSearch &rsearch, const Varray<T> &srcArray, Varray<T> &tgtArr
auto tgtGridSize = tgtGrid->size;
auto srcGridSize = srcGrid->size;
Varray<short> srcGridMask;
Varray<short> srcGridMask(srcGridSize, 1);
if (numMissVals) remap_set_mask(srcGridSize, srcArray, numMissVals, missval, srcGridMask);
// Compute mappings from source to target grid
......
......@@ -135,7 +135,7 @@ bilinear_sort_weights_by_index_zip(size_t (&indices)[4], double (&weights)[4])
}
#endif
void
static void
bilinear_sort_weights_by_index(size_t (&indices)[4], double (&weights)[4])
{
constexpr size_t numWeights = 4;
......
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