src/thirdparty/acg_localizer/flann_modification/kmeans_index.h
/**
     * Helper function that computes the nearest childs of a node to a given query point.
     * Params:
     *     node = the node
     *     q = the query point
     *     distances = array with the distances to each child node.
     * Returns: Nothing
     * Modified by Torsten to make it faster when searching only for the first neighbor
     * and also checking only 1 leaf node
     */
Helper function that computes the nearest childs of a node to a given query point.
Params:
node = the node
q = the query point
distances = array with the distances to each child node.
Returns: Nothing
Modified by Torsten to make it faster when searching only for the first neighbor
and also checking only 1 leaf node
Helper function that computes the nearest childs of a node to a given query point . Params : node = the node q = the query point distances = array with the distances to each child node . Returns : Nothing Modified by Torsten to make it faster when searching only for the first neighbor and also checking only 1 leaf node
int exploreNodeBranches2(KMeansNodePtr node, const ElementType* q)
    {
        int best_index = 0;
        float best_dist = distance(q, node->childs[best_index]->pivot, veclen_);
        float dist = 0.0f;
        for (int i=1; i<branching; ++i) {
            dist = distance(q, node->childs[i]->pivot, veclen_);
            if (dist<best_dist) {
                best_dist = dist;
                best_index = i;
            }
        }
        return best_index;
    }
int exploreNodeBranches2 ( KMeansNodePtr node , const ElementType * q ) { int best_index = 0 ; float best_dist = distance ( q , node -> childs [ best_index ] -> pivot , veclen_ ) ; float dist = 0.0f ; for ( int i = 1 ; i < branching ; ++ i ) { dist = distance ( q , node -> childs [ i ] -> pivot , veclen_ ) ; if ( dist < best_dist ) { best_dist = dist ; best_index = i ; } } return best_index ; }
Helper function that computes the nearest childs of a node to a given query point.
Helper function that computes the nearest childs of a node to a given query point .