From b8d713bbecb7ed54c78d37eb4ec1414a15bfbf6b Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 9 Oct 2009 05:18:04 +0000 Subject: kD splay tree fixes, and new dmnsn_kD_splay_tree type. --- libdimension/kD_splay_tree.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'libdimension/kD_splay_tree.h') diff --git a/libdimension/kD_splay_tree.h b/libdimension/kD_splay_tree.h index b64be35..eac47d8 100644 --- a/libdimension/kD_splay_tree.h +++ b/libdimension/kD_splay_tree.h @@ -32,8 +32,13 @@ #ifndef DIMENSION_IMPL_KD_SPLAY_TREE_H #define DIMENSION_IMPL_KD_SPLAY_TREE_H +typedef struct dmnsn_kD_splay_tree dmnsn_kD_splay_tree; typedef struct dmnsn_kD_splay_node dmnsn_kD_splay_node; +struct dmnsn_kD_splay_tree { + dmnsn_kD_splay_node *root; +}; + struct dmnsn_kD_splay_node { /* Tree children */ dmnsn_kD_splay_node *contains, *container; @@ -48,15 +53,14 @@ struct dmnsn_kD_splay_node { dmnsn_object *object; }; -dmnsn_kD_splay_node *dmnsn_new_kD_splay_tree(); -dmnsn_kD_splay_node *dmnsn_kD_splay_copy(dmnsn_kD_splay_node *root); -void dmnsn_delete_kD_splay_tree(dmnsn_kD_splay_node *root); +dmnsn_kD_splay_tree *dmnsn_new_kD_splay_tree(); +dmnsn_kD_splay_tree *dmnsn_kD_splay_copy(dmnsn_kD_splay_tree *tree); +void dmnsn_delete_kD_splay_tree(dmnsn_kD_splay_tree *tree); -dmnsn_kD_splay_node *dmnsn_kD_splay_insert(dmnsn_kD_splay_node *root, - dmnsn_object *object); -void dmnsn_kD_splay(dmnsn_kD_splay_node *node); +void dmnsn_kD_splay_insert(dmnsn_kD_splay_tree *tree, dmnsn_object *object); +void dmnsn_kD_splay(dmnsn_kD_splay_tree *tree, dmnsn_kD_splay_node *node); -dmnsn_intersection *dmnsn_kD_splay_search(dmnsn_kD_splay_node *root, +dmnsn_intersection *dmnsn_kD_splay_search(dmnsn_kD_splay_tree *tree, dmnsn_line ray); #endif /* DIMENSION_IMPL_KD_SPLAY_TREE_H */ -- cgit v1.2.3