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
aaa05e54
Commit
aaa05e54
authored
Nov 01, 2017
by
Uwe Schulzweida
Browse files
kdtree: changed unsigned long to size_t.
parent
2536df0f
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/kdtreelib/kdtree.h
View file @
aaa05e54
...
...
@@ -115,7 +115,7 @@ typedef struct kd_thread_data {
struct
kd_point
*
points
;
kdata_t
min
[
KD_MAX_DIM
];
kdata_t
max
[
KD_MAX_DIM
];
unsigned
long
nPoints
;
size_t
nPoints
;
int
max_threads
;
int
depth
;
int
dim
;
...
...
@@ -153,18 +153,18 @@ void kd_printTree(struct kdNode *node);
/* Functions for building and destroying trees */
void
kd_freeNode
(
kdNode
*
node
);
struct
kdNode
*
kd_allocNode
(
struct
kd_point
*
points
,
unsigned
long
pivot
,
struct
kdNode
*
kd_allocNode
(
struct
kd_point
*
points
,
size_t
pivot
,
kdata_t
*
min
,
kdata_t
*
max
,
int
dim
,
int
axis
);
void
kd_destroyTree
(
struct
kdNode
*
node
);
struct
kd_thread_data
*
kd_buildArg
(
struct
kd_point
*
points
,
unsigned
long
nPoints
,
size_t
nPoints
,
kdata_t
*
min
,
kdata_t
*
max
,
int
depth
,
int
max_threads
,
int
dim
);
struct
kdNode
*
kd_buildTree
(
struct
kd_point
*
points
,
unsigned
long
nPoints
,
struct
kdNode
*
kd_buildTree
(
struct
kd_point
*
points
,
size_t
nPoints
,
kdata_t
*
min
,
kdata_t
*
max
,
int
dim
,
int
max_threads
);
void
*
kd_doBuildTree
(
void
*
threadarg
);
struct
kdNode
*
kd_sph_buildTree
(
struct
kd_point
*
points
,
unsigned
long
nPoints
,
struct
kdNode
*
kd_sph_buildTree
(
struct
kd_point
*
points
,
size_t
nPoints
,
kdata_t
*
min
,
kdata_t
*
max
,
int
max_threads
);
void
*
kd_sph_doBuildTree
(
void
*
threadarg
);
...
...
src/kdtreelib/kdtree_cartesian.cc
View file @
aaa05e54
...
...
@@ -70,14 +70,11 @@ kdata_t kd_min(kdata_t x, kdata_t y)
* \return root node of the tree
*/
struct
kdNode
*
kd_buildTree
(
struct
kd_point
*
points
,
unsigned
long
nPoints
,
kd_buildTree
(
struct
kd_point
*
points
,
size_t
nPoints
,
kdata_t
*
min
,
kdata_t
*
max
,
int
dim
,
int
max_threads
)
{
struct
kd_thread_data
*
my_data
;
struct
kdNode
*
tree
;
my_data
=
kd_buildArg
(
points
,
nPoints
,
min
,
max
,
0
,
max_threads
,
dim
);
tree
=
(
kdNode
*
)
kd_doBuildTree
(
my_data
);
struct
kd_thread_data
*
my_data
=
kd_buildArg
(
points
,
nPoints
,
min
,
max
,
0
,
max_threads
,
dim
);
struct
kdNode
*
tree
=
(
kdNode
*
)
kd_doBuildTree
(
my_data
);
free
(
my_data
);
return
tree
;
}
...
...
src/kdtreelib/kdtree_common.cc
View file @
aaa05e54
...
...
@@ -95,7 +95,7 @@ void *kd_doBuildTree(void *threadarg)
struct
kd_thread_data
*
my_data
=
(
struct
kd_thread_data
*
)
threadarg
;
struct
kd_point
*
points
=
my_data
->
points
;
unsigned
long
nPoints
=
my_data
->
nPoints
;
size_t
nPoints
=
my_data
->
nPoints
;
kdata_t
*
min
=
my_data
->
min
;
kdata_t
*
max
=
my_data
->
max
;
int
depth
=
my_data
->
depth
;
...
...
@@ -120,7 +120,7 @@ void *kd_doBuildTree(void *threadarg)
*/
pmergesort
(
points
,
nPoints
,
sortaxis
,
max_threads
);
unsigned
long
pivot
=
nPoints
/
2
;
size_t
pivot
=
nPoints
/
2
;
if
((
node
=
kd_allocNode
(
points
,
pivot
,
min
,
max
,
sortaxis
,
dim
))
==
NULL
)
return
NULL
;
...
...
@@ -192,7 +192,7 @@ kd_freeNode(kdNode *node)
struct
kd_thread_data
*
kd_buildArg
(
struct
kd_point
*
points
,
unsigned
long
nPoints
,
size_t
nPoints
,
kdata_t
*
min
,
kdata_t
*
max
,
int
depth
,
int
max_threads
,
int
dim
)
{
...
...
@@ -219,7 +219,7 @@ struct kdNode *mem_pool = NULL;
#endif
struct
kdNode
*
kd_allocNode
(
struct
kd_point
*
points
,
unsigned
long
pivot
,
kd_allocNode
(
struct
kd_point
*
points
,
size_t
pivot
,
kdata_t
*
min
,
kdata_t
*
max
,
int
axis
,
int
dim
)
{
struct
kdNode
*
node
;
...
...
src/kdtreelib/kdtree_spherical.cc
View file @
aaa05e54
...
...
@@ -128,14 +128,11 @@ kd_sph_orth_dist(kdata_t *p1, kdata_t *p2, int split)
* \return root node of the tree
*/
struct
kdNode
*
kd_sph_buildTree
(
struct
kd_point
*
points
,
unsigned
long
nPoints
,
kd_sph_buildTree
(
struct
kd_point
*
points
,
size_t
nPoints
,
kdata_t
*
min
,
kdata_t
*
max
,
int
max_threads
)
{
struct
kd_thread_data
*
my_data
;
struct
kdNode
*
tree
;
my_data
=
kd_buildArg
(
points
,
nPoints
,
min
,
max
,
0
,
max_threads
,
2
);
tree
=
(
kdNode
*
)
kd_doBuildTree
(
my_data
);
struct
kd_thread_data
*
my_data
=
kd_buildArg
(
points
,
nPoints
,
min
,
max
,
0
,
max_threads
,
2
);
struct
kdNode
*
tree
=
(
kdNode
*
)
kd_doBuildTree
(
my_data
);
free
(
my_data
);
return
tree
;
}
...
...
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