void FoF::find_friends (const Zbin &zbin, Galaxy &gal, double rfriend) {
  //! Function to find galaxies linked to the galaxy in question.
  /**< Loop through kd-tree nodes */
  for(int j = 0; j < tree.node_list.size(); j++) {
    /**< Check if galaxy is compatible with kd-tree node */
    if(node_check(gal, tree.node_list[j], rfriend)) {
      /**< Loop through node members */
      for(int k = 0; k < tree.node_list[j].members.size(); k++) {
	/**< Check if galaxies are friends */
	int gal_now = tree.node_list[j].members[k].num;
	if(friendship(zbin, gal, gal_list[gal_now], rfriend)) {
	  /**< Create new cluster */
	  if(!gal.in_cluster[zbin.num]) 
	    new_cluster(zbin, gal, gal_list[gal_now]);
	  /**< Add new member to existing cluster */
	  else 
	    add_member(zbin, gal_list[gal_now], list_of_clusters[cluster_count]);
	}
      } // end of node member loop
    }
  } // end of node loop
}
Beispiel #2
0
 Graph<int,int> butterfly(std::vector<int> /*args*/, int start=1)
 {
     return friendship({2},start);
 }