Skip to content
GitLab
Menu
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
a2ec60a8
Commit
a2ec60a8
authored
Oct 13, 2015
by
Uwe Schulzweida
Browse files
remap_distwgt.c: allocate dist and adds on the stack
parent
e2ef3895
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/remap_distwgt.c
View file @
a2ec60a8
...
...
@@ -290,8 +290,8 @@ void grid_search_nbr(struct gridsearch *gs, int num_neighbors, int *restrict nbr
int
ndist
=
num_neighbors
;
ndist
=
ndist
*
2
;
// check some more points if distance is the same use the smaller index (nadd)
double
*
dist
=
(
double
*
)
Malloc
(
ndist
*
sizeof
(
double
))
;
int
*
adds
=
(
int
*
)
Malloc
(
ndist
*
sizeof
(
int
))
;
double
dist
[
ndist
]
;
int
adds
[
ndist
]
;
const
double
range0
=
SQR
(
2
*
search_radius
);
double
range
=
range0
;
...
...
@@ -341,9 +341,6 @@ void grid_search_nbr(struct gridsearch *gs, int num_neighbors, int *restrict nbr
for
(
j
=
0
;
j
<
ndist
;
++
j
)
nbr_store_distance
(
adds
[
j
],
dist
[
j
],
num_neighbors
,
nbr_add
,
nbr_dist
);
Free
(
adds
);
Free
(
dist
);
nbr_check_distance
(
num_neighbors
,
nbr_add
,
nbr_dist
);
}
/* grid_search_nbr */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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