bool is_connection_map_good()

in GraphSampling/meshPooler.h [82:117]


    bool is_connection_map_good()
    {
        int p_num = _connection_map.size();
        if(p_num<3)
        {
            cout<<"ERROR: connection map receives less than 3 points.\n";
            return false;
        }

        //check symmetry
        for (int i=0;i<p_num;i++)
        {
            int p=i;
            vector<int> p_connection_lst = _connection_map[i];
            for(int j =0; j<p_connection_lst.size();j++)
            {
                int q = p_connection_lst[j];
                vector<int> q_connection_lst = _connection_map[q];
                bool find_p = false;
                for(int k=0;k<q_connection_lst.size();k++)
                {
                    if(q_connection_lst[k]==p)
                    {
                        find_p =true;
                        break;
                    }
                }
                if(find_p==false) {
                    cout<<"ERROR: the connection map is not symmetric.\n";
                    return false;
                }
            }
        }

        return true;
    }