Commit 0e2fe293 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Renamed storeWeightLinks4 to store_weightlinks_bicubic

parent 0d2e877d
......@@ -170,7 +170,7 @@ remapBicubicWeights(RemapSearch &rsearch, RemapVars &rv)
{
// Successfully found iw,jw - compute weights
bicubicSetWeights(iw, jw, wgts);
storeWeightLinks4(src_add, wgts, tgt_cell_add, weightLinks);
store_weightlinks_bicubic(src_add, wgts, tgt_cell_add, weightLinks);
}
else
{
......@@ -187,7 +187,7 @@ remapBicubicWeights(RemapSearch &rsearch, RemapVars &rv)
{
tgt_grid->cell_frac[tgt_cell_add] = 1.;
renormalizeWeights(src_lats, wgts);
storeWeightLinks4(src_add, wgts, tgt_cell_add, weightLinks);
store_weightlinks_bicubic(src_add, wgts, tgt_cell_add, weightLinks);
}
}
}
......@@ -282,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_wgts_bic(src_add, wgts);
sort_add_and_wgts_bicubic(src_add, wgts);
tgt_array[tgt_cell_add] = bicubicRemap(src_array, wgts, src_add, gradients);
}
else
......@@ -300,7 +300,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_wgts_bic(src_add, wgts);
sort_add_and_wgts_bicubic(src_add, wgts);
tgt_array[tgt_cell_add] = bicubicRemap(src_array, wgts, src_add, gradients);
}
}
......
......@@ -74,7 +74,7 @@ sortAddweights4(Addweight4 *addweights)
}
void
sort_add_and_4wgts(size_t *src_add, double *wgts)
sort_add_and_4wgts(size_t *src_add, double *weights)
{
constexpr size_t numWeights = 4;
size_t n;
......@@ -87,7 +87,7 @@ sort_add_and_4wgts(size_t *src_add, double *wgts)
for (n = 0; n < numWeights; ++n)
{
addweights[n].add = src_add[n];
addweights[n].weight = wgts[n];
addweights[n].weight = weights[n];
}
std::sort(addweights.begin(), addweights.end(), compareAdds);
......@@ -95,12 +95,12 @@ sort_add_and_4wgts(size_t *src_add, double *wgts)
for (n = 0; n < numWeights; ++n)
{
src_add[n] = addweights[n].add;
wgts[n] = addweights[n].weight;
weights[n] = addweights[n].weight;
}
}
void
sort_add_and_wgts(size_t numWeights, size_t *src_add, double *wgts)
sort_add_and_wgts(size_t numWeights, size_t *src_add, double *weights)
{
size_t n;
for (n = 1; n < numWeights; ++n)
......@@ -114,7 +114,7 @@ sort_add_and_wgts(size_t numWeights, size_t *src_add, double *wgts)
for (n = 0; n < numWeights; ++n)
{
addweights[n].add = src_add[n];
addweights[n].weight = wgts[n];
addweights[n].weight = weights[n];
}
std::sort(addweights.begin(), addweights.end(), compareAdds);
......@@ -122,13 +122,13 @@ sort_add_and_wgts(size_t numWeights, size_t *src_add, double *wgts)
for (n = 0; n < numWeights; ++n)
{
src_add[n] = addweights[n].add;
wgts[n] = addweights[n].weight;
weights[n] = addweights[n].weight;
}
}
}
void
sort_add_and_wgts_bic(size_t *src_add, double (&wgts)[4][4])
sort_add_and_wgts_bicubic(size_t *src_add, double (&weights)[4][4])
{
constexpr size_t numWeights = 4;
size_t n;
......@@ -141,7 +141,7 @@ sort_add_and_wgts_bic(size_t *src_add, double (&wgts)[4][4])
for (n = 0; n < numWeights; ++n)
{
addweights[n].add = src_add[n];
for (unsigned k = 0; k < 4; ++k) addweights[n].weight[k] = wgts[n][k];
for (unsigned k = 0; k < 4; ++k) addweights[n].weight[k] = weights[n][k];
}
std::sort(addweights.begin(), addweights.end(), compareAdds4);
......@@ -149,7 +149,7 @@ sort_add_and_wgts_bic(size_t *src_add, double (&wgts)[4][4])
for (n = 0; n < numWeights; ++n)
{
src_add[n] = addweights[n].add;
for (unsigned k = 0; k < 4; ++k) wgts[n][k] = addweights[n].weight[k];
for (unsigned k = 0; k < 4; ++k) weights[n][k] = addweights[n].weight[k];
}
}
......@@ -183,7 +183,7 @@ storeWeightLinks(int lalloc, size_t numWeights, size_t *srch_add, double *weight
}
void
storeWeightLinks4(size_t *srch_add, double weights[4][4], size_t cell_add, std::vector<WeightLinks4> &weightLinks)
store_weightlinks_bicubic(size_t *srch_add, double (&weights)[4][4], size_t cell_add, std::vector<WeightLinks4> &weightLinks)
{
weightLinks[cell_add].nlinks = 0;
weightLinks[cell_add].offset = 0;
......
......@@ -52,11 +52,11 @@ void weightLinksAlloc(size_t numNeighbors, size_t gridSize, std::vector<WeightLi
void weightLinks4Alloc(size_t gridSize, std::vector<WeightLinks4> &weightLinks);
void storeWeightLinks(int lalloc, size_t numWeights, size_t *srch_add, double *weights, size_t cell_add,
std::vector<WeightLinks> &weightLinks);
void storeWeightLinks4(size_t *srch_add, double weights[4][4], size_t cell_add, std::vector<WeightLinks4> &weightLinks);
void store_weightlinks_bicubic(size_t *srch_add, double (&weights)[4][4], size_t cell_add, std::vector<WeightLinks4> &weightLinks);
void weightLinksToRemapLinks(int lalloc, size_t gridSize, std::vector<WeightLinks> &weightLinks, RemapVars &rv);
void weightLinks4ToRemapLinks(size_t gridSize, std::vector<WeightLinks4> &weightLinks, RemapVars &rv);
void sort_add_and_wgts(size_t numWeights, size_t *src_add, double *wgts);
void sort_add_and_4wgts(size_t *src_add, double *wgts);
void sort_add_and_wgts_bic(size_t *src_add, double (&wgts)[4][4]);
void sort_add_and_wgts(size_t numWeights, size_t *src_add, double *weights);
void sort_add_and_4wgts(size_t *src_add, double *weights);
void sort_add_and_wgts_bicubic(size_t *src_add, double (&weights)[4][4]);
#endif /* REMAP_STORE_LINK */
Markdown is supported
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