Esempio n. 1
0
void ClusteringBase::calculate() {
  // All the clusters have zero size initially
  for(unsigned i=0; i<cluster_sizes.size(); ++i) { cluster_sizes[i].first=0; cluster_sizes[i].second=i; }
  // Do the clustering bit
  performClustering();
  // Order the clusters in the system by size (this returns ascending order )
  std::sort( cluster_sizes.begin(), cluster_sizes.end() );
}
Esempio n. 2
0
void DFSBasicWithSurface::calculate(){
   // Do the clustring
   performClustering();
   // Retrieve the atoms in the largest cluster
   std::vector<unsigned> myatoms; retrieveAtomsInCluster( clustr, myatoms );
   // The size of the cluster
   setValue( myatoms.size() );
}
Esempio n. 3
0
void DFSClusterDiameter::calculate(){
   // Do the clustring
   performClustering();
   // Retrieve the atoms in the largest cluster
   std::vector<unsigned> myatoms; retrieveAtomsInCluster( clustr, myatoms );
   // Activate the relevant tasks
   deactivateAllTasks(); std::vector<unsigned>  active_tasks( getFullNumberOfTasks(), 0 );
   for(unsigned i=1;i<myatoms.size();++i){
       for(unsigned j=0;j<i;++j) active_tasks[ myatoms[i]*getNumberOfNodes() + myatoms[j] ] = 1;  
   }
   activateTheseTasks( active_tasks );
   // Now do the calculation 
   runAllTasks();
}