diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-10-09 05:18:04 +0000 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-10-09 05:18:04 +0000 |
commit | b8d713bbecb7ed54c78d37eb4ec1414a15bfbf6b (patch) | |
tree | 80dce70188c9af9ad4a193149e16f2e89d8f0171 /libdimension/kD_splay_tree.h | |
parent | a9c5e1caf089c8b6fd77beb4452fbb6049fc8d9e (diff) | |
download | dimension-b8d713bbecb7ed54c78d37eb4ec1414a15bfbf6b.tar.xz |
kD splay tree fixes, and new dmnsn_kD_splay_tree type.
Diffstat (limited to 'libdimension/kD_splay_tree.h')
-rw-r--r-- | libdimension/kD_splay_tree.h | 18 |
1 files changed, 11 insertions, 7 deletions
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 */ |