Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
0e2fe293
Commit
0e2fe293
authored
Oct 16, 2020
by
Uwe Schulzweida
Browse files
Renamed storeWeightLinks4 to store_weightlinks_bicubic
parent
0d2e877d
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/remap_bicubic.cc
View file @
0e2fe293
...
...
@@ -170,7 +170,7 @@ remapBicubicWeights(RemapSearch &rsearch, RemapVars &rv)
{
// Successfully found iw,jw - compute weights
bicubicSetWeights
(
iw
,
jw
,
wgts
);
store
W
eight
L
inks
4
(
src_add
,
wgts
,
tgt_cell_add
,
weightLinks
);
store
_w
eight
l
inks
_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
);
store
W
eight
L
inks
4
(
src_add
,
wgts
,
tgt_cell_add
,
weightLinks
);
store
_w
eight
l
inks
_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_bic
ubic
(
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_bic
ubic
(
src_add
,
wgts
);
tgt_array
[
tgt_cell_add
]
=
bicubicRemap
(
src_array
,
wgts
,
src_add
,
gradients
);
}
}
...
...
src/remap_store_link.cc
View file @
0e2fe293
...
...
@@ -74,7 +74,7 @@ sortAddweights4(Addweight4 *addweights)
}
void
sort_add_and_4wgts
(
size_t
*
src_add
,
double
*
w
g
ts
)
sort_add_and_4wgts
(
size_t
*
src_add
,
double
*
w
eigh
ts
)
{
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
=
w
g
ts
[
n
];
addweights
[
n
].
weight
=
w
eigh
ts
[
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
;
w
g
ts
[
n
]
=
addweights
[
n
].
weight
;
w
eigh
ts
[
n
]
=
addweights
[
n
].
weight
;
}
}
void
sort_add_and_wgts
(
size_t
numWeights
,
size_t
*
src_add
,
double
*
w
g
ts
)
sort_add_and_wgts
(
size_t
numWeights
,
size_t
*
src_add
,
double
*
w
eigh
ts
)
{
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
=
w
g
ts
[
n
];
addweights
[
n
].
weight
=
w
eigh
ts
[
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
;
w
g
ts
[
n
]
=
addweights
[
n
].
weight
;
w
eigh
ts
[
n
]
=
addweights
[
n
].
weight
;
}
}
}
void
sort_add_and_wgts_bic
(
size_t
*
src_add
,
double
(
&
w
g
ts
)[
4
][
4
])
sort_add_and_wgts_bic
ubic
(
size_t
*
src_add
,
double
(
&
w
eigh
ts
)[
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
]
=
w
g
ts
[
n
][
k
];
for
(
unsigned
k
=
0
;
k
<
4
;
++
k
)
addweights
[
n
].
weight
[
k
]
=
w
eigh
ts
[
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
)
w
g
ts
[
n
][
k
]
=
addweights
[
n
].
weight
[
k
];
for
(
unsigned
k
=
0
;
k
<
4
;
++
k
)
w
eigh
ts
[
n
][
k
]
=
addweights
[
n
].
weight
[
k
];
}
}
...
...
@@ -183,7 +183,7 @@ storeWeightLinks(int lalloc, size_t numWeights, size_t *srch_add, double *weight
}
void
store
W
eight
L
inks
4
(
size_t
*
srch_add
,
double
weights
[
4
][
4
],
size_t
cell_add
,
std
::
vector
<
WeightLinks4
>
&
weightLinks
)
store
_w
eight
l
inks
_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
;
...
...
src/remap_store_link.h
View file @
0e2fe293
...
...
@@ -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
store
W
eight
L
inks
4
(
size_t
*
srch_add
,
double
weights
[
4
][
4
],
size_t
cell_add
,
std
::
vector
<
WeightLinks4
>
&
weightLinks
);
void
store
_w
eight
l
inks
_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
*
w
g
ts
);
void
sort_add_and_4wgts
(
size_t
*
src_add
,
double
*
w
g
ts
);
void
sort_add_and_wgts_bic
(
size_t
*
src_add
,
double
(
&
w
g
ts
)[
4
][
4
]);
void
sort_add_and_wgts
(
size_t
numWeights
,
size_t
*
src_add
,
double
*
w
eigh
ts
);
void
sort_add_and_4wgts
(
size_t
*
src_add
,
double
*
w
eigh
ts
);
void
sort_add_and_wgts_bic
ubic
(
size_t
*
src_add
,
double
(
&
w
eigh
ts
)[
4
][
4
]);
#endif
/* REMAP_STORE_LINK */
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment