Diploma Thesis Percolation Simulation
C++ Sourcecode Documentation

www.AndreasKrueger.de/thesis/code

Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

cluster.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class  cluson
struct  clusterneighbours

Functions

void add_spanning_dir_to_clusters (cluson *clusters, NUMLIST clnos, int direction)
void swapcluson (cluson &c1, cluson &c2)
void reset_clusters (cluson *array, NUMBER N)
void nonspanning_clusters (cluson *array, NUMBER N)
void make_clusterlist_array (sphere *spheres, NUMLIST &sphlist, cluson *clst)
void set_clusternumber (sphere *array, NUMLIST &sphlist, NUMBER clno)
void set_clustersize (sphere *array, NUMLIST &sphlist, NUMBER clsz)
void set_clustersizes (sphere *array, NUMLIST &sphlist, cluson *cluster)
void copy_array (sphere *array1, sphere *array2, NUMBER first, NUMBER last)
void compare_clustersizes (sphere *array1, sphere *array2, NUMBER first, NUMBER last)
void throw_spheres (sphere *array, NUMBER start, NUMBER end)
void throw_spheres (sphere *array, NUMLIST L_sph)
void set_dim (sphere *array, NUMBER first, NUMBER last, int setdim)
void set_clusternumber (sphere *array, NUMBER first, NUMBER last, NUMBER clno)
void set_radius (sphere *array, NUMBER first, NUMBER last, REAL radius)
void set_clustersize (sphere *array, NUMBER first, NUMBER last, NUMBER clsz)
bool same_array (sphere *array1, sphere *array2, NUMBER first, NUMBER last)
void set_clusternumber_l (sphere *array, NUMLIST &sphlist, NUMBER clno)
void increasing_integers (NUMLIST &sphlist, NUMBER N)
void increasing_integers (std::vector< NUMBER > &sphnumbers, NUMBER N)
REAL set_clustersize_to_each_sphere (NUMBER *tableofclusters, sphere *spherearray, NUMBER first, NUMBER last)
REAL set_clustersize_to_each_sphere_l (NUMBER *tableofclusters, sphere *spherearray, NUMLIST &sphlist)


Function Documentation

void add_spanning_dir_to_clusters cluson   clusters,
NUMLIST    clnos,
int    direction
 

Definition at line 45 of file cluster.h.

References cluson::add_spanning().

Referenced by spanning_dirs_and_clusters(), and analyze::spanning_dirs_and_clusters().

00045                                                                                  {
00046         NUMLIST::iterator clno;
00047         for (clno=clnos.begin();clno!=clnos.end();clno++){
00048                 clusters[*clno].add_spanning(direction);
00049         }
00050 }

void compare_clustersizes sphere   array1,
sphere   array2,
NUMBER    first,
NUMBER    last
 

Definition at line 134 of file cluster.h.

References sphere::c, sphere::clsz, and NUMBER.

00134                                                                                      {
00135         for (NUMBER i=first;i<=last;i++) {
00136                 if (array1[i].clsz != array2[i].clsz){
00137                         cout<<"\n"<<array1[i].c;
00138                         cout<<" clsz1="<<array1[i].clsz;
00139                         cout<<" clsz2="<<array2[i].clsz;
00140                 }
00141         }
00142         cout<<endl;
00143 }

void copy_array sphere   array1,
sphere   array2,
NUMBER    first,
NUMBER    last
 

Definition at line 128 of file cluster.h.

References NUMBER.

Referenced by starters::listcount(), optimize::new_vs_old_algo(), counters::sort_naivecount_and_analyze(), and starters::test_list().

00128                                                                           {
00129         for (NUMBER i=first;i<=last;i++) {
00130                 array2[i]=array1[i];
00131         }
00132 }

void increasing_integers std::vector< NUMBER > &    sphnumbers,
NUMBER    N
 

Definition at line 207 of file cluster.h.

References NUMBER.

Referenced by optimize::choose_cuts_with_reference_algo(), optimize::choose_dividings(), optimize::compare_recursion_and_Stoddard_iteration(), optimize::double_N_and_run_all_faster_cuts(), optimize::double_N_and_run_specified_cuts(), ff::find_mean_ff_with_criterion(), ff::find_mean_ffc(), starters::into_file7_pt1(), starters::into_file8_pt1(), starters::listcount(), optimize::new_vs_old_algo(), counters::reference_test(), optimize::run_different_cuts(), optimize::test_average_time_for_specified_cuts(), starters::test_list(), starters::test_occuring_clusternumbers(), test_occuring_clusternumbers(), test_spanningclusters(), and grid::test_spheres2boxes().

00207                                                                   {
00208         for (NUMBER i=0;i<=N;i++){
00209                 sphnumbers[i]=i;
00210         }
00211 }

void increasing_integers NUMLIST   sphlist,
NUMBER    N
 

Definition at line 201 of file cluster.h.

References NUMBER.

00201                                                      {
00202         for (NUMBER i=1;i<=N;i++){
00203                 sphlist.insert(sphlist.end(), i);
00204         }
00205 }

void make_clusterlist_array sphere   spheres,
NUMLIST   sphlist,
cluson   clst
 

Definition at line 70 of file cluster.h.

References sphere::clno, NUMBER, and cluson::sphlist.

Referenced by grid::boxcount_analyze_and_return_clusters(), optimize::compare_recursion_and_Stoddard_iteration(), counters::divide_once_count_and_combine(), counters::dividecount(), optimize::new_vs_old_algo(), and counters::partcount().

00072                                                                        {
00073         NUMLIST::iterator iter;
00074         NUMBER clusno, sphno;
00075         for (iter=sphlist.begin(); iter!=sphlist.end();iter++){
00076                 sphno=*iter;
00077                 clusno=spheres[sphno].clno;
00078                 clst[clusno].sphlist.push_back(sphno);
00079         }
00080 }

void nonspanning_clusters cluson   array,
NUMBER    N
 

Definition at line 64 of file cluster.h.

References LONGBITS, NUMBER, and cluson::set_spanning_dirs().

00064                                                    {
00065         for (NUMBER i=0;i<=N;i++){
00066                 array[i].set_spanning_dirs((LONGBITS)0);
00067         }
00068 }

void reset_clusters cluson   array,
NUMBER    N
 

Definition at line 57 of file cluster.h.

References LONGBITS, NUMBER, cluson::set_spanning_dirs(), and cluson::sphlist.

Referenced by grid::boxcount_analyze_and_return_clusters(), optimize::compare_recursion_and_Stoddard_iteration(), and optimize::new_vs_old_algo().

00057                                              {
00058         for (NUMBER i=0;i<=N;i++){
00059                 array[i].sphlist.clear();
00060                 array[i].set_spanning_dirs((LONGBITS)0);
00061         }
00062 }

bool same_array sphere   array1,
sphere   array2,
NUMBER    first,
NUMBER    last
 

Definition at line 183 of file cluster.h.

References NUMBER.

Referenced by starters::listcount(), and starters::test_list().

00183                                                                             {
00184         for (NUMBER i=first;i<=last;i++){
00185                 if (array1[i]!=array2[i]) return 0;
00186         }
00187         return 1;
00188 }

void set_clusternumber sphere   array,
NUMBER    first,
NUMBER    last,
NUMBER    clno
 

Definition at line 166 of file cluster.h.

References sphere::clno, and NUMBER.

Referenced by optimize::choose_cuts_with_reference_algo(), optimize::choose_dividings(), counters::combine(), optimize::compare_recursion_and_Stoddard_iteration(), optimize::double_N_and_run_all_faster_cuts(), optimize::double_N_and_run_specified_cuts(), starters::into_file(), starters::into_file2(), starters::into_file7_pt1(), starters::into_screen(), starters::listcount(), optimize::new_vs_old_algo(), counters::reference_test(), optimize::run_different_cuts(), counters::setR_count_analyze_step(), optimize::test_average_time_for_specified_cuts(), starters::test_occuring_clusternumbers(), test_occuring_clusternumbers(), and test_spanningclusters().

00166                                                                               {
00167         for (NUMBER i=first;i<=last;i++) {
00168                 array[i].clno=clno;
00169         }
00170 }

void set_clusternumber sphere   array,
NUMLIST   sphlist,
NUMBER    clno
 

Definition at line 88 of file cluster.h.

References sphere::clno, and NUMBER.

00088                                                                      {
00089         NUMLIST::iterator iter;
00090 
00091         // first run for error detection
00092         // for (iter =  sphlist.begin(); iter != sphlist.end(); ++iter){
00093         //      array[*iter].clno=0;
00094         // }//error detection end
00095 
00096         for (iter =  sphlist.begin(); iter != sphlist.end(); ++iter){
00097                 // this is error detection
00098                 // if (array[*iter].clno != 0) {
00099                 //         errorout ("sphere twice mentioned in cluster");
00100                 //         cout <<" clno="<<clno<<" sphere #"<<*iter<<" sphlist.size()="<<sphlist.size()<<endl;
00101                 //      exit(1);
00102                 // }// error detection end
00103                 array[*iter].clno=clno;
00104         }
00105 }

void set_clusternumber_l sphere   array,
NUMLIST   sphlist,
NUMBER    clno
 

Definition at line 192 of file cluster.h.

References sphere::clno, and NUMBER.

Referenced by starters::test_list().

00192                                                                        {
00193         NUMLIST::iterator iter;
00194         for (iter =  sphlist.begin(); iter != sphlist.end(); ++iter){
00195                 array[*iter].clno=clno;
00196         }
00197 }

void set_clustersize sphere   array,
NUMBER    first,
NUMBER    last,
NUMBER    clsz
 

Definition at line 176 of file cluster.h.

References sphere::clsz, and NUMBER.

Referenced by starters::listcount(), and starters::test_list().

00176                                                                             {
00177         for (NUMBER i=first;i<=last;i++) {
00178                 array[i].clsz=clsz;
00179         }
00180 }

void set_clustersize sphere   array,
NUMLIST   sphlist,
NUMBER    clsz
 

Definition at line 107 of file cluster.h.

References sphere::clsz, and NUMBER.

00109                                                       {                 // one clustersize for all spheres
00110         NUMLIST::iterator iter;
00111         for (iter =  sphlist.begin(); iter != sphlist.end(); ++iter){
00112                 array[*iter].clsz=clsz;
00113         }
00114 }

REAL set_clustersize_to_each_sphere NUMBER *    tableofclusters,
sphere   spherearray,
NUMBER    first,
NUMBER    last
 

Definition at line 214 of file cluster.h.

References sphere::clno, sphere::clsz, NUMBER, and REAL.

Referenced by counters::naive_arraycount_and_analyze(), and counters::naive_count_and_analyze().

00216                                                                                                    {
00217         NUMBER size;
00218         REAL sum=0;
00219 
00220         for (NUMBER i=first;i<=last;i++){
00221                 size=tableofclusters[spherearray[i].clno];
00222                 spherearray[i].clsz=size;
00223                 sum+=size;
00224         }
00225         return sum/(last-first+1);    //returns the average clustersize
00226 }

REAL set_clustersize_to_each_sphere_l NUMBER *    tableofclusters,
sphere   spherearray,
NUMLIST   sphlist
 

Definition at line 229 of file cluster.h.

References sphere::clno, sphere::clsz, NUMBER, and REAL.

Referenced by counters::naive_listcount_and_analyze().

00231                                                                                             {
00232         NUMBER size;
00233         REAL sum=0;
00234 
00235         NUMLIST::iterator k;
00236     for (k =  sphlist.begin(); k != sphlist.end(); k++){
00237 
00238                 size=tableofclusters[spherearray[*k].clno];
00239                 spherearray[*k].clsz=size;
00240                 sum+=size;
00241         }
00242         return sum/(sphlist.size());    //returns the average clustersize
00243 }

void set_clustersizes sphere   array,
NUMLIST   sphlist,
cluson   cluster
 

Definition at line 116 of file cluster.h.

References sphere::clno, and sphere::clsz.

Referenced by grid::boxcount_and_analyze(), and optimize::new_vs_old_algo().

00118                                                            {    // get the size of cluster[clno]
00119                                                                                         // and assign to each sphere in that cluster
00120         NUMLIST::iterator iter;
00121         for (iter =  sphlist.begin(); iter != sphlist.end(); ++iter){
00122                 array[*iter].clsz=cluster[array[*iter].clno].sphlist.size();
00123         }
00124 }

void set_dim sphere   array,
NUMBER    first,
NUMBER    last,
int    setdim
 

Definition at line 160 of file cluster.h.

References sphere::c, NUMBER, and myVector::set_dim().

Referenced by optimize::choose_cuts_with_reference_algo(), optimize::choose_dividings(), optimize::compare_recursion_and_Stoddard_iteration(), optimize::double_N_and_run_all_faster_cuts(), optimize::double_N_and_run_specified_cuts(), ff::find_mean_ff_with_criterion(), ff::find_mean_ffc(), starters::into_file(), starters::into_file2(), starters::into_file7_pt1(), starters::into_file8_pt1(), starters::into_screen(), starters::listcount(), optimize::new_vs_old_algo(), counters::reference_test(), optimize::run_different_cuts(), optimize::test_average_time_for_specified_cuts(), starters::test_list(), starters::test_occuring_clusternumbers(), test_occuring_clusternumbers(), test_spanningclusters(), and grid::test_spheres2boxes().

00160                                                                   {
00161         for (NUMBER i=first;i<=last;i++) {
00162                 array[i].c.set_dim(setdim);
00163         }
00164 }

void set_radius sphere   array,
NUMBER    first,
NUMBER    last,
REAL    radius
 

Definition at line 171 of file cluster.h.

References NUMBER, sphere::r, and REAL.

Referenced by optimize::choose_cuts_with_reference_algo(), optimize::choose_dividings(), optimize::compare_recursion_and_Stoddard_iteration(), optimize::double_N_and_run_all_faster_cuts(), optimize::double_N_and_run_specified_cuts(), starters::into_file(), starters::into_file2(), starters::into_file7_pt1(), starters::into_screen(), starters::listcount(), optimize::new_vs_old_algo(), counters::reference_test(), optimize::run_different_cuts(), counters::setR_count_analyze_step(), optimize::test_average_time_for_specified_cuts(), starters::test_list(), starters::test_occuring_clusternumbers(), test_occuring_clusternumbers(), and test_spanningclusters().

00171                                                                         {
00172         for (NUMBER i=first;i<=last;i++) {
00173                 array[i].r=radius;
00174         }
00175 }

void swapcluson cluson   c1,
cluson   c2
 

Definition at line 52 of file cluster.h.

Referenced by counters::combine().

00052                                          {
00053                 cluson temp=c1;
00054                 c1=c2; c2=temp;
00055 }

void throw_spheres sphere   array,
NUMLIST    L_sph
 

Definition at line 153 of file cluster.h.

References sphere::c, GRIDSIZE, and myVector::randomvect().

Referenced by optimize::choose_cuts_with_reference_algo(), optimize::choose_dividings(), optimize::compare_recursion_and_Stoddard_iteration(), optimize::double_N_and_run_all_faster_cuts(), optimize::double_N_and_run_specified_cuts(), ff::find_mean_ff_with_criterion(), ff::find_mean_ffc(), starters::into_file(), starters::into_file2(), starters::into_file7_pt1(), starters::into_screen(), starters::listcount(), optimize::new_vs_old_algo(), counters::reference_test(), optimize::run_different_cuts(), optimize::test_average_time_for_specified_cuts(), starters::test_list(), starters::test_occuring_clusternumbers(), test_occuring_clusternumbers(), test_spanningclusters(), grid::test_spheres2boxes(), and counters::throw_dnc_count_analyze_step().

00153                                                  {
00154         NUMLIST::iterator sph;
00155         for (sph=L_sph.begin();sph!=L_sph.end(); sph++) {
00156                 array[*sph].c.randomvect(GRIDSIZE);  // random coordinate
00157         }
00158 }

void throw_spheres sphere   array,
NUMBER    start,
NUMBER    end
 

Definition at line 147 of file cluster.h.

References sphere::c, GRIDSIZE, NUMBER, and myVector::randomvect().

00147                                                             {
00148         for ( NUMBER i=start; i<=end; i++) {
00149                 array[i].c.randomvect(GRIDSIZE);  // random coordinate
00150         }
00151 }




Diploma Thesis Sourcecode Documentation
check out the text and the executable binaries

www.AndreasKrueger.de/thesis/code