vector get_p_connection_lst()

in GraphSampling/meshPooler.h [315:358]


    vector<Int2> get_p_connection_lst(int p, int radius)
    {
        vector<int> interest_lst;
        interest_lst.push_back(p);

        set<int> visited;
        visited.insert(p);

        vector<Int2> p_connection_lst;
        Int2 connection=Int2(p,0);
        p_connection_lst.push_back(connection);

        int r = 0;
        while (r < radius) {
            vector<int> new_interest_lst;
            //cout<<interest_lst.size()<<"\n";
            for (int i = 0; i < interest_lst.size(); i++) {
                int interest_p = interest_lst[i];
                vector<int> interest_p_connection_map = _connection_map[interest_p];
                for (int j = 0; j < interest_p_connection_map.size(); j++) {
                    int neighbor_p = interest_p_connection_map[j];

                    set<int>::iterator it = visited.find(neighbor_p);
                    if (it == visited.end()) { //not visited
                        //cout<<"neighbor ";

                        visited.insert(neighbor_p);
                        new_interest_lst.push_back(neighbor_p);
                        Int2 connection=Int2(neighbor_p,r+1);
                        p_connection_lst.push_back(connection);

                    }
                }
            }
            interest_lst = new_interest_lst;
            r=r+1;
        }




        return p_connection_lst;

    }