55 if ((rtp = calloc(1,
sizeof(
RTree_t))))
101void PrintIndex(
Node_t * n)
105 assert(n->
level >= 0);
108 for (
size_t i = 0; i <
NODECARD; i++) {
123 assert(n->
level >= 0);
128 for (
size_t i = 0; i <
NODECARD; i++) {
145 assert(n->
level >= 0);
149 for (
size_t i = 0; i <
NODECARD; i++)
161 for (
size_t i = 0; i <
NODECARD; i++) {
190 assert(level >= 0 && level <= (*n)->level);
191 for (
size_t i = 0; i <
NUMDIMS; i++)
195 fprintf(stderr,
"RTreeInsert level=%d\n", level);
201 newroot->
level = (*n)->level + 1;
230 assert(r && n &&
new);
231 assert(level >= 0 && level <= n->level);
234 if (n->
level > level) {
245 }
else if (n->
level == level) {
static Agnode_t * newnode(Agraph_t *g, IDTYPE id, uint64_t seq)
static int RTreeClose2(RTree_t *rtp, Node_t *n)
LeafList_t * RTreeSearch(RTree_t *rtp, Node_t *n, Rect_t *r)
LeafList_t * RTreeLeafListAdd(LeafList_t *llp, Leaf_t *lp)
void RTreeLeafListFree(LeafList_t *llp)
RTree_t * RTreeOpen(void)
int RTreeClose(RTree_t *rtp)
Node_t * RTreeNewIndex(void)
LeafList_t * RTreeNewLeafList(Leaf_t *lp)
int RTreeInsert(RTree_t *rtp, Rect_t *r, void *data, Node_t **n, int level)
static int RTreeInsert2(RTree_t *, Rect_t *, void *, Node_t *, Node_t **, int)
Node_t * RTreeNewNode(void)
int AddBranch(RTree_t *rtp, Branch_t *b, Node_t *n, Node_t **new)
Rect_t NodeCover(Node_t *n)
int PickBranch(Rect_t *r, Node_t *n)
void DisconBranch(Node_t *n, int i)
bool Overlap(const Rect_t *r, const Rect_t *s)
Rect_t CombineRect(const Rect_t *r, const Rect_t *rr)
struct Branch branch[NODECARD]