Ejemplo n.º 1
0
void ANNkd_leaf::getStats(			// get subtree statistics
    int			dim,			// dimension of space
    ANNkdStats		&st,			// stats (modified)
    ANNorthRect		&bnd_box)		// bounding box
{
    st.reset();
    if (this == KD_TRIVIAL) st.n_tl = 1;	// trivial leaf?
    else st.n_lf = 1;				// else increment leaf count
    double ar = annAspectRatio(dim, bnd_box);	// aspect ratio of leaf
    st.sum_ar += (ar < 100 ? ar : 100);		// increment (set outlier=100)
}
Ejemplo n.º 2
0
void ANNkd_leaf::getStats(						// get subtree statistics
	int					dim,					// dimension of space
	ANNkdStats			&st,					// stats (modified)
	ANNorthRect			&bnd_box)				// bounding box
{
	st.reset();
	st.n_lf = 1;								// count this leaf
	if (this == KD_TRIVIAL) st.n_tl = 1;		// count trivial leaf
	double ar = annAspectRatio(dim, bnd_box);	// aspect ratio of leaf
												// incr sum (ignore outliers)
	st.sum_ar += float(ar < ANN_AR_TOOBIG ? ar : ANN_AR_TOOBIG);
}