src/stringmap/split_l.cpp
void RTreeSplitNode(struct Node *n, struct Branch *b, struct Node **nn)
{
	register struct PartitionVars *p;
	register int level;
	RectReal area;

	assert(n);
	assert(b);

	/* load all the branches into a buffer, initialize old node */
	level = n->level;
	RTreeGetBranches(n, b);

	/* find partition */
	p = &Partitions[0];

	/* Note: can't use MINFILL(n) below since n was cleared by GetBranches() */
	RTreeMethodZero(p, level>0 ? MinNodeFill : MinLeafFill);

	/* record how good the split was for statistics */
	area = p->area[0] + p->area[1];

	/* put branches from buffer in 2 nodes according to chosen partition */
	*nn = RTreeNewNode();
	(*nn)->level = n->level = level;
	RTreeLoadNodes(n, *nn, p);
	assert(n->count + (*nn)->count == NODECARD+1);
}
/*-----------------------------------------------------------------------------
| Split a node.
| Divides the nodes branches and the extra one between two nodes.
| Old node is one of the new ones, and one really new one is created.
-----------------------------------------------------------------------------*/
| Split a node.
| Divides the nodes branches and the extra one between two nodes.
| Old node is one of the new ones, and one really new one is created.
| Split a node . | Divides the nodes branches and the extra one between two nodes . | Old node is one of the new ones and one really new one is created .
void RTreeSplitNode(struct Node *n, struct Branch *b, struct Node **nn)
{
	register struct PartitionVars *p;
	register int level;
	RectReal area;
	assert(n);
	assert(b);
	level = n->level;
	RTreeGetBranches(n, b);
	p = &Partitions[0];
	RTreeMethodZero(p, level>0 ? MinNodeFill : MinLeafFill);
	area = p->area[0] + p->area[1];
	*nn = RTreeNewNode();
	(*nn)->level = n->level = level;
	RTreeLoadNodes(n, *nn, p);
	assert(n->count + (*nn)->count == NODECARD+1);
}
void RTreeSplitNode ( struct Node * n , struct Branch * b , struct Node * * nn ) { register struct PartitionVars * p ; register int level ; RectReal area ; assert ( n ) ; assert ( b ) ; level = n -> level ; RTreeGetBranches ( n , b ) ; p = & Partitions [ 0 ] ; RTreeMethodZero ( p , level > 0 ? MinNodeFill : MinLeafFill ) ; area = p -> area [ 0 ] + p -> area [ 1 ] ; * nn = RTreeNewNode ( ) ; ( * nn ) -> level = n -> level = level ; RTreeLoadNodes ( n , * nn , p ) ; assert ( n -> count + ( * nn ) -> count == NODECARD + 1 ) ; }
| Split a node.
| Split a node .
/* load all the branches into a buffer, initialize old node */ /* find partition */ /* Note: can't use MINFILL(n) below since n was cleared by GetBranches() */ /* record how good the split was for statistics */ /* put branches from buffer in 2 nodes according to chosen partition */