Exemplo n.º 1
0
    void recurse_filter_kruskal(WspIter begin, WspIter end, int THold)
    {

        WspIter part,fpart, part1, part2;

        if(end-begin < 1000)
        {
            Kruskal(begin, end);
        }
        else
        {
            findPivot(begin, end, bdpredmin, bdpredmax);

            do
            {
                MyTimer A;
                part1 = partition(begin, end, bdpredmin);
                std::cout << "Part1 size: " << end-begin << " Time: " << A << std::endl;
                if(part1==begin) bdpredmin.minBccp*=2;
            }
            while(part1==begin);

            bdpredmax.maxBccp = bdpredmin.minBccp;
            part2 = partition(part1, end, bdpredmax);
            do_bccp(part1, part2);
            bccppred.maxBccp = bdpredmin.minBccp;
            part  = partition(part1, part2, bccppred);
            Kruskal(begin, part);
            fpart = partition(part, end, ufpred);
            recurse_filter_kruskal(part, fpart, THold);
        }
    }
Exemplo n.º 2
0
    /*! BCCP
      \brief computes the BCCP if it has not been
      For WSPs of small size (<32) this computes the BCCP by brute force.
      Otherwise it calls a recursive algorithm.
    */
    void bccp()
    {
        if(bccp_done())
            return;
        //Note: After BCCP is computed, the void* first and second
        //point to Points, not comp_quad_tree_nodes

        //For small sized quad-tree boxes,
        //Brute force computation of BCCP is faster
        if(size() < 32)
        {
            brute_force_bccp((index)first, (index)second);
            return;
        }

        //For small sized boxes, compute using
        //recursive algorithm
        do_bccp();
        return;
    };