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  

sphere.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  sphere

Functions

int getdim (const sphere &u)
REAL distance (sphere &sph1, sphere &sph2)
bool overlap (sphere &sph1, sphere &sph2)
bool overlap (sphere &sph1, sphere &sph2, sphere &temp)
bool overlap2 (sphere &sph1, sphere &sph2, sphere &temp)
ostream & operator<< (ostream &os, sphere &z)
REAL find_biggestradius (sphere *array, NUMLIST &sphlist)
double unitsphere (int dimension)
REAL give_fillingfactor (REAL radius, NUMBER numberofspheres, COORDFLOAT length, int dimension)
REAL ff_critical (NUMBER N, int dim)
REAL ff_critical_infinite_limit (int dim)
REAL ff_critical_guessed (NUMBER N, int dim)
REAL ff_critical_guessed (NUMBER N, int dim, REAL dummy)
REAL give_radius (REAL fillingfactor, NUMBER numberofspheres, COORDFLOAT length, int dimension)
REAL R_critical (NUMBER no_of_spheres, COORDFLOAT length, int dimension)
REAL R_critical_guessed (NUMBER no_of_spheres, COORDFLOAT length, int dimension)
REAL percolating_fillingfactor_for_two_spheres_verbose (int dim, COORDFLOAT length)
REAL percolating_fillingfactor_for_two_spheres (int dim)

Variables

double myPI = 2*acos(0.0)


Function Documentation

REAL distance sphere   sph1,
sphere   sph2
 

Definition at line 90 of file sphere.h.

References sphere::c, length(), and REAL.

Referenced by counters::neighbour_l(), and counters::neighbour_naive().

00090                                            {            // reference instead of copy --> faster
00091         return ( length((sph1.c - sph2.c)));
00092 }

REAL ff_critical NUMBER    N,
int    dim
 

Definition at line 152 of file sphere.h.

References critical_fillingfactor(), NUMBER, and REAL.

Referenced by ff_critical_guessed().

00152                                      {
00153         return critical_fillingfactor(dim,N);
00154 }

REAL ff_critical_guessed NUMBER    N,
int    dim,
REAL    dummy
 

Definition at line 164 of file sphere.h.

References NUMBER, and REAL.

Referenced by counters::choose_optimal_cuts(), ff::ffbig_guessed(), ff::ffmean1_guessed(), ff::ffnoc_guessed(), ff::find_ffc_scanning_N_and_dim(), and ff::find_mean_ffc().

00164                                                          {
00165         return ff_critical_guessed(N, dim) ;
00166 }

REAL ff_critical_guessed NUMBER    N,
int    dim
 

Definition at line 158 of file sphere.h.

References ff_critical(), ff_critical_infinite_limit(), NUMBER, and REAL.

00158                                              {
00159         REAL temp=ff_critical(N,dim);
00160         if (temp==-1) return ff_critical_infinite_limit(dim);
00161         return temp;
00162 }

REAL ff_critical_infinite_limit int    dim
 

Definition at line 155 of file sphere.h.

References pow(), and REAL.

Referenced by ff_critical_guessed(), and R_critical_guessed().

00155                                           {
00156         return pow(0.5,dim);    // good guess for high dimensions
00157 }

REAL find_biggestradius sphere   array,
NUMLIST   sphlist
 

Definition at line 118 of file sphere.h.

References sphere::r, and REAL.

Referenced by counters::combine(), and starters::test_list().

00118                                                            {
00119 
00120         NUMLIST::iterator iter1;
00121         REAL biggest=0;
00122 
00123         for (iter1 =  sphlist.begin(); iter1 != sphlist.end(); ++iter1){
00124                 if ( array[*iter1].r > biggest) 
00125                         biggest= array[*iter1].r;
00126         }
00127         return biggest;
00128 }

int getdim const sphere   u
 

Definition at line 62 of file sphere.h.

References sphere::c.

Referenced by counters::count_analyze_and_return_clusters(), counters::count_clusters_iteratively(), counters::count_clusters_iteratively2(), counters::count_clusters_iteratively_only_selected_spherenumbers(), counters::divide_count_and_analyze(), counters::divide_d_times_count_and_analyze(), grid::divide_spheres_into_overlapping_boxes_and_conquer(), analyze::edgespheres(), grid::find_neighbours_in_a_box_recursion(), ff::find_one_ff_with_criterion(), ff::find_one_ffc(), counters::neighbour_l(), counters::neighbour_naive(), counters::neighbour_recursion(), grid::put_vector_into_boxes(), and counters::throw_dnc_count_analyze_step().

00062 {return getdim(u.c);}

REAL give_fillingfactor REAL    radius,
NUMBER    numberofspheres,
COORDFLOAT    length,
int    dimension
 

Definition at line 146 of file sphere.h.

References COORDFLOAT, length(), NUMBER, pow(), REAL, and unitsphere().

Referenced by starters::into_file(), starters::into_file2(), starters::into_file7_pt1(), and starters::into_file8_pt1().

00146                                                                                                 {
00147         double density=(REAL)numberofspheres/pow(length, dimension);
00148         return density*unitsphere(dimension)*pow(radius,dimension);
00149 }

REAL give_radius REAL    fillingfactor,
NUMBER    numberofspheres,
COORDFLOAT    length,
int    dimension
 

Definition at line 169 of file sphere.h.

References COORDFLOAT, length(), NUMBER, pow(), REAL, and unitsphere().

Referenced by counters::choose_optimal_cuts(), starters::into_file7_pt1(), starters::into_file8_pt1(), ff::is_the_biggestcluster_bigger_than_a_ratio(), ff::is_the_incl_meancluster_bigger_than_a_ratio(), ff::is_the_numberofcl_smaller_than_a_ratio(), ff::is_there_a_spanning_cluster(), ff::is_there_only_one_cluster(), R_critical(), R_critical_guessed(), datafiles::set_and_show_filename(), optimize::test_average_time_for_specified_cuts(), and datafiles::write_one_result().

00169                                                                                                 {
00170         double density=(REAL)numberofspheres/pow(length, dimension);
00171         return pow(( fillingfactor / density / unitsphere(dimension) ),(1/((double)dimension)));
00172 }

ostream& operator<< ostream &    os,
sphere   z
 

Definition at line 110 of file sphere.h.

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

00110                                             {
00111   return os<<"["<<z.c<<" radius="<<z.r<<" clno="<<z.clno<<" clsize=" << z.clsz<<"]";
00112 }

bool overlap sphere   sph1,
sphere   sph2,
sphere   temp
 

Definition at line 98 of file sphere.h.

References sphere::c, length(), and sphere::r.

Referenced by overlap(), and test_measureclass().

00098                                                         {               // reference instead of copy --> faster
00099         temp.c  = sph1.c;
00100         temp.c -= sph2.c;               // using -= instead of - is much faster
00101         return ( length (temp.c) < (sph1.r + sph2.r) );
00102 }

bool overlap sphere   sph1,
sphere   sph2
 

Definition at line 94 of file sphere.h.

References sphere::c, length(), and sphere::r.

00094                                           {             // reference instead of copy --> faster
00095         return ( length((sph1.c - sph2.c)) < (sph1.r + sph2.r) );
00096 }

bool overlap2 sphere   sph1,
sphere   sph2,
sphere   temp
 

Definition at line 104 of file sphere.h.

References sphere::c, sphere::r, and squarelength().

Referenced by counters::combine(), counters::count_clusters_iteratively(), counters::count_clusters_iteratively2(), counters::count_clusters_iteratively_only_selected_spherenumbers(), grid::find_neighbours_in_a_box_recursion(), and counters::neighbour_recursion().

00104                                                          {              // no SQRT but radii * radii
00105         temp.c  = sph1.c;
00106         temp.c -= sph2.c;               // using -= instead of - is much faster
00107         return ( squarelength (temp.c) < (sph1.r + sph2.r) * (sph1.r + sph2.r) );
00108 }

REAL percolating_fillingfactor_for_two_spheres int    dim
 

Definition at line 213 of file sphere.h.

References pow(), REAL, sqrt(), and unitsphere().

Referenced by starters::max_ff().

00214 { 
00215         return ( (2 * unitsphere(dim)* pow(0.5*sqrt(dim),dim) ) ) ;
00216 }

REAL percolating_fillingfactor_for_two_spheres_verbose int    dim,
COORDFLOAT    length
 

Definition at line 190 of file sphere.h.

References COORDFLOAT, length(), pow(), REAL, sqrt(), and unitsphere().

Referenced by starters::max_ff().

00192 { 
00193         REAL diagonal=sqrt(dim)*length;  // Pythargoras:
00194                                                                          // sqrt (L*L + L*L)    
00195                                                                      // = sqrt(2)*L for 2dim, 
00196                                                                          //
00197                                                                          // sqrt(  sqrt(2)*L * sqrt(2)*L + L * L ) 
00198                                                                          // = sqrt(3)*L for 3dim;
00199                                                                          //
00200                                                                          // sqrt(  sqrt(3)*L * sqrt(3)*L + L * L ) 
00201                                                                          // = sqrt (4) * L = 2*L  for 4dim
00202                                                                          
00203         REAL radius = 0.5 * diagonal;                   // two touching spheres in opposite corners
00204 
00205         REAL vol_one_sphere=unitsphere(dim)*pow(radius, dim);
00206 
00207         REAL vol_space= pow(length, dim);
00208 
00209         return ( (2 * vol_one_sphere) / vol_space) ;
00210 }

REAL R_critical NUMBER    no_of_spheres,
COORDFLOAT    length,
int    dimension
 

Definition at line 175 of file sphere.h.

References COORDFLOAT, critical_fillingfactor(), give_radius(), length(), NUMBER, and REAL.

Referenced by optimize::choose_cuts_with_reference_algo(), optimize::choose_dividings(), optimize::double_N_and_run_all_faster_cuts(), optimize::double_N_and_run_specified_cuts(), frontend::introduction(), starters::listcount(), optimize::new_vs_old_algo(), counters::reference_test(), and optimize::run_different_cuts().

00175                                                                          {
00176         REAL ffc=critical_fillingfactor(dimension,no_of_spheres);
00177         if (ffc==-1) return -1;
00178         return give_radius(ffc, no_of_spheres, length, dimension);
00179 }

REAL R_critical_guessed NUMBER    no_of_spheres,
COORDFLOAT    length,
int    dimension
 

Definition at line 181 of file sphere.h.

References COORDFLOAT, critical_fillingfactor(), ff_critical_infinite_limit(), give_radius(), length(), NUMBER, 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(), frontend::introduction(), starters::listcount(), optimize::new_vs_old_algo(), counters::reference_test(), optimize::run_different_cuts(), frontend::svg_frontend(), optimize::test_average_time_for_specified_cuts(), and test_spanningclusters().

00181                                                                                  {
00182         REAL ffc=critical_fillingfactor(dimension,no_of_spheres);
00183         if (ffc!=-1) return give_radius(ffc, no_of_spheres, length, dimension);
00184         else return give_radius(ff_critical_infinite_limit(dimension), no_of_spheres, length, dimension);
00185 }

double unitsphere int    dimension
 

Definition at line 133 of file sphere.h.

References myPI, and pow().

Referenced by give_fillingfactor(), give_radius(), percolating_fillingfactor_for_two_spheres(), percolating_fillingfactor_for_two_spheres_verbose(), starters::unitspheredimensions(), datafiles::write_averaged_cuts_intro(), datafiles::write_cuts_intro(), datafiles::write_intro(), datafiles::write_intro7(), datafiles::write_intro8(), and datafiles::write_intro_square().

00133                                  {                                      // Otto Forster, Analysis 3, p. 52
00134         double halfdim=.5*dimension;
00135         double nominator=pow(myPI, (int)halfdim );
00136         double denominator=1;
00137         do {
00138                 denominator*=halfdim;
00139                 halfdim-=1;
00140         }while (halfdim>0);
00141         return (nominator/denominator);
00142 }


Variable Documentation

double myPI = 2*acos(0.0)
 

Definition at line 131 of file sphere.h.

Referenced by unitsphere().




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

www.AndreasKrueger.de/thesis/code