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  

constants.h

Go to the documentation of this file.
00001 // constants.h
00002 // for the clustercounter
00003 //
00004 // a) the critical fillingfactors
00005 // b) the optimal cuts for the algorithm
00006 //
00007 // (c) 2000 Andreas Krueger (cpp__at__AndreasKrueger__dot__de)
00008 // version 1.0 last change: 10.1.2001
00009 
00010 #ifndef LOADED_CONSTANTS
00011 #define LOADED_CONSTANTS
00012 #endif
00013 
00014 const int MAXDIM=11;                    // maximal number of dimensions, e.g. 20
00015 #define MAXNUMBER 320001
00016 
00017 
00018 REAL critical_fillingfactor(int dim, NUMBER N);
00019 REAL saturating_fillingfactor(int dim, NUMBER N);
00020 REAL fillingfactor_noc1percent(int dim, NUMBER N);
00021 COUNTER choose_optimal_cuts_ffc (int dim, NUMBER N);
00022 COUNTER choose_optimal_cuts_ffs (int dim, NUMBER N);
00023 
00024 // Critical fillingfactor
00025 
00026 // The following are approximate results for 
00027 // the critical fillingfactor fitted by  ffc= a+ b* N^c
00028 //
00029 // a= FFC_N_LIMIT               for the limit N->infinity
00030 // b= FFC_N_FACTOR      
00031 // c= FFC_N_EXPONENT
00032 
00033 const int DEFDIM=11;
00034 
00035 const REAL FFC_N_LIMIT[DEFDIM+1]={-1, 
00036 33.18634, 1.1282, 0.3416 , 0.13, 0.0543, // 5dim
00037                                                                   0.02346, 0.0105, 0.00481, 0.00227, 0.00106, // 10dim
00038                                                                   0.000505}; //,0.0002};//,-1,-1,-1,-1,-1,-1,-1,-1,-1}; 
00039                                                                    // -1 if not known, Gandolfo: 2dim: 1.16, 3dim: 0.35
00040 
00041 const REAL FFC_N_FACTOR[DEFDIM+1]={0, 
00042 -34.26936, 1.96, 0.738, 0.614, 0.433, // 5dim
00043                                                                    0.235, 0.122, 0.0714, 0.0489, 0.0273, // 10dim
00044                                                                    0.0161};
00045 
00046 const REAL FFC_N_EXPONENT[DEFDIM+1]={0, 
00047 -0.04169, -0.734, -0.462, -0.520, -0.560, // 5dim
00048                                                                          -0.534, -0.519, -0.524, -0.564, -0.567, // 10dim
00049                                                                          -0.588};
00050 
00051 
00052 REAL critical_fillingfactor(int dim, NUMBER N){
00053         if (dim==1) return saturating_fillingfactor(dim, N);
00054         REAL a,b,c;
00055         a=FFC_N_LIMIT[dim];
00056         b=FFC_N_FACTOR[dim];
00057         c=FFC_N_EXPONENT[dim];
00058         if (a==-1) return -1;
00059         return (a + b* pow((REAL)N,c));
00060 }
00061 
00062 // Saturation fillingfactor
00063 
00064 // The following are approximate results (4.12.2001) for 
00065 // the saturating fillingfactor fitted by  ffs = b + m * Log10(N)
00066 // valid for dim = {1,2}
00067 // b= FFS_B_OFFSET
00068 // m= FFS_M_FACTOR
00069 const REAL FFS_B_OFFSET[3]={0, 0.4886, 1.18622};
00070 const REAL FFS_M_FACTOR[3]={0, 2.31157, 0.46472};
00071 
00072 // For dim >= 3, the saturating fillingfactor can be fitted by  
00073 // ffs(N,dim) = c^dim (d + e * Log10(N))
00074 // c= 
00075 // d=
00076 // e=
00077 const REAL FFS_C_DIMBASIS=0.74046;
00078 const REAL FFS_D_OFFSET=1.91307;
00079 const REAL FFS_E_LOGFACTOR=0.69157;
00080 
00081 REAL saturating_fillingfactor(int dim, NUMBER N){
00082         REAL result;
00083         if (dim==1 || dim==2){
00084                 result=FFS_B_OFFSET[dim] + FFS_M_FACTOR[dim]*log10(N);
00085                 return result;
00086         }
00087         if (dim>=3){
00088                 result=pow(FFS_C_DIMBASIS,dim)*(FFS_D_OFFSET+FFS_E_LOGFACTOR*log10(N));
00089                 return result;
00090         }
00091         return -1;
00092 }
00093 
00094 // The almost-all fillingfactor (99% clustering)
00095 
00096 // The following numerical results are (not quite satisfying) 
00097 // attempts to fit the position of the fillingfactor ffnoc1%
00098 // - the ff, at which the number-of-clusters = 1% * number-of-spheres
00099 //
00100 // The fit is ffnoc1% (N,dim) = a + b * ( N - N0) ^ c
00101 // with a, b, N0, c functions of dim
00102 // so that the resulting fitfunction is
00103 //
00104 // ffnoc1% (N, dim) = d*e^dim + (f*g^dim) * (N-k-l*dim)^(m+dim^n)
00105 //
00106 // The deviations are mostly < 10 % 
00107 // but for 1dim and >10dim up to 50%
00108 //
00109 // This is then used in ff:ffnoc_guessed
00110 
00111 const REAL noc1_d=6.25188;
00112 const REAL noc1_e=0.46828;
00113 const REAL noc1_f=8.40778;
00114 const REAL noc1_g=0.70916;
00115 const REAL noc1_k=115.74947;
00116 const REAL noc1_l=3.10626;
00117 const REAL noc1_m=-1.53707;
00118 const REAL noc1_n=0.13135;
00119 
00120 #include <iostream>             // for cout
00121 using std::cout;
00122 REAL fillingfactor_noc1percent(int dim, NUMBER N){
00123         std::cout <<"fillingfactor_noc1percent ACCESSED\n";
00124         REAL a=noc1_d*pow(noc1_e,dim);
00125         REAL b=noc1_f*pow(noc1_g,dim);
00126         REAL N0=noc1_k+noc1_l*dim;
00127         REAL c=noc1_m+pow(dim, noc1_n);
00128         return a+b*pow((N-N0),c);
00129 }
00130 
00131 
00132 COUNTER choose_optimal_cuts_ffc (int dim, NUMBER N) {
00133 
00134         switch(dim) {
00135                 case 1: switch (N) {                            // not tested!
00136                                                 case 39: return 0; 
00137                                                 case 78: return 0; // not tested
00138                                                 case 156: return 0; // not tested
00139                                                 case 312: return 2; // ??
00140                                                 case 625: return 4; // ??
00141                                                 case 1250: return 5; // ??
00142                                                 case 2500: return 5; // ??
00143                                                 case 5000: return 6; // ??
00144                                                 case 10000: return 7; // ??
00145                                                 case 20000: return 7; // ??
00146                                                 case 40000: return 9; // ??
00147                                                 case 80000: return 9;    // ??
00148                                                 case 160000: return 11; // ??
00149                                                 case 320000: return 11; // ??
00150                                                 case 480000: return 11; // ??
00151                                                 default: return 8;      // ??
00152                                   }
00153 
00154                 case 2: switch (N) {                            // for maxdim=4:
00155                                                 case 39: return 0; 
00156                                                 // tested on pc_uni
00157                                                 case 78: return 0; // not tested
00158                                                 case 156: return 0; // not tested
00159                                                 case 312: return 2;
00160                                                 case 625: return 4;
00161                                                 case 1250: return 5;
00162                                                 case 2500: return 5;
00163                                                 case 5000: return 6;
00164                                                 case 10000: return 7;
00165                                                 case 20000: return 7;
00166                                                 case 40000: return 9;
00167                                                 case 80000: return 9;   
00168                                                 case 160000: return 11; 
00169                                                 case 320000: return 11; 
00170                                                 case 480000: return 11; 
00171                                                 default: return 8;
00172                                   }
00173 
00174                 case 3: switch (N) {                            // for maxdim=4:
00175                                                 case 39: return 0; 
00176                                                 case 78: return 0; // not tested
00177                                                 case 156: return 0; // not tested
00178                                                 // tested on pc_uni                                                                     
00179                                                 case 312: return 3;
00180                                                 case 625: return 4;
00181                                                 case 1250: return 5;
00182                                                 case 2500: return 5;
00183                                                 case 5000: return 6;
00184                                                 case 10000: return 7;
00185                                                 case 20000: return 7;
00186                                                 case 40000: return 8;
00187                                                 case 80000: return 8; 
00188                                                 case 160000: return 8;  
00189                                                 case 320000: return 8;
00190                                                 case 480000: return 8;   // ?? evtl. niedriger
00191                                                 default: return 7;
00192                                                                                                                 
00193                                   }
00194                 case 4: switch (N) {                            // for maxdim=4:
00195                                                 case 39: return 0; 
00196                                                 case 78: return 0; // not tested
00197                                                 case 156: return 0; // not tested
00198                                                 // tested on pc_uni
00199                                                 case 312: return 2;                     
00200                                                 case 625: return 4;
00201                                                 case 1250: return 4;
00202                                                 case 2500: return 5;
00203                                                 case 5000: return 5;
00204                                                 case 10000: return 6;
00205                                                 case 20000: return 6;
00206                                                 case 40000: return 6;
00207                                                 case 80000: return 6; 
00208                                                 case 160000: return 7;  // evtl. lower
00209                                                 case 320000: return 7;  // evtl. lower
00210                                                 case 480000: return 7; //evtl. 10
00211                                                 default: return 6;
00212                                   }
00213 
00214                 case 5: switch (N) {                            // for maxdim=6;
00215                                                 case 39: return 0; 
00216                                                 case 78: return 0; // not tested
00217                                                 case 156: return 0; // not tested
00218                                                 // tested on pc_uni
00219                                                 case 312: return 2;                     
00220                                                 case 625: return 3;
00221                                                 case 1250: return 4;
00222                                                 case 2500: return 5;
00223                                                 case 5000: return 5;
00224                                                 case 10000: return 6;
00225                                                 case 20000: return 6;
00226                                                 case 40000: return 6;  // ??
00227                                                 case 80000: return 6;  // ??
00228                                                 case 160000: return 7;  // ??
00229                                                 case 320000: return 7;  // ??
00230                                                 case 480000: return 7; // ??
00231                                                 default: return 6;
00232                                   }
00233 
00234                 case 6: switch (N) {                            // for maxdim=6;
00235                                                 case 39: return 0; 
00236                                                 case 78: return 0; // not tested
00237                                                 case 156: return 0; // not tested
00238                                                 // tested on pc_uni
00239                                                 case 312: return 0;                     
00240                                                 case 625: return 1;
00241                                                 case 1250: return 3;
00242                                                 case 2500: return 5;
00243                                                 case 5000: return 5;
00244                                                 case 10000: return 6;
00245                                                 case 20000: return 6;
00246                                                 case 40000: return 6;  
00247                                                 case 80000: return 7;  
00248                                                 case 160000: return 7; 
00249                                                 case 320000: return 7; // ??
00250                                                 case 480000: return 7; // ??
00251                                                 default: return 6;
00252                                   }
00253 
00254                 case 7: switch (N) {                            // tested on PC_uni for maxdim=11
00255                                                 case 39: return 0; 
00256                                                 case 78: return 0; // not tested
00257                                                 case 156: return 0; // not tested
00258                                                 case 312: return 0;
00259                                                 case 625: return 0;
00260                                                 case 1250: return 1;
00261                                                 case 2500: return 6;
00262                                                 case 5000: return 5;
00263                                                 case 10000: return 6;
00264                                                 case 20000: return 7;
00265                                                 case 40000: return 7;
00266                                                 case 80000: return 7;  
00267                                                 case 160000: return 7; // ??
00268                                                 case 320000: return 7; // ??
00269                                                 case 480000: return 7; // ??
00270                                                 default: return 6;
00271                                   }
00272                 case 8: switch (N) {                            // tested on PC_uni for maxdim=11
00273                                                 case 39: return 0; 
00274                                                 case 78: return 0; // not tested
00275                                                 case 156: return 0; // not tested
00276                                                 case 312: return 0;
00277                                                 case 625: return 0;
00278                                                 case 1250: return 1;
00279                                                 case 2500: return 3;
00280                                                 case 5000: return 4;
00281                                                 case 10000: return 5;
00282                                                 case 20000: return 7;
00283                                                 case 40000: return 7;
00284                                                 case 80000: return 7;  
00285                                                 case 160000: return 7; // ??
00286                                                 case 320000: return 7; // ??
00287                                                 case 480000: return 7; // ??
00288                                                 default: return 6;
00289                                   }
00290                 case 9: switch (N) {                            // tested on PC_uni for maxdim=11
00291                                                 case 39: return 0; 
00292                                                 case 78: return 0; // not tested
00293                                                 case 156: return 0; // not tested
00294                                 
00295                                                 case 312: return 0;
00296                                                 case 625: return 0;
00297                                                 case 1250: return 1;
00298                                                 case 2500: return 3;
00299                                                 case 5000: return 4;
00300                                                 case 10000: return 8;
00301                                                 case 20000: return 8;
00302                                                 case 40000: return 8;
00303                                                 case 80000: return 8;  
00304                                                 case 160000: return 8; // ??
00305                                                 case 320000: return 8; // ??
00306                                                 case 480000: return 8; // ??
00307                                                 default: return 6;
00308                                   }
00309                 case 10: switch (N) {                           // tested on PC_uni for maxdim=11
00310                                                 case 39: return 0; 
00311                                                 case 78: return 0; // not tested
00312                                                 case 156: return 0; // not tested
00313                 
00314                                                 case 312: return 0;
00315                                                 case 625: return 0;
00316                                                 case 1250: return 1;
00317                                                 case 2500: return 3;
00318                                                 case 5000: return 3;
00319                                                 case 10000: return 4;
00320                                                 case 20000: return 4;
00321                                                 case 40000: return 5;
00322                                                 case 80000: return 6;  
00323                                                 case 160000: return 6; // ??
00324                                                 case 320000: return 6; // ??
00325                                                 case 480000: return 6; // ??
00326                                                 default: return 6;
00327                                   }
00328                         case 11: switch (N) {                           // tested on PC_uni for maxdim=11
00329                                                 case 39: return 0; 
00330                                                 case 78: return 0; // not tested
00331                                                 case 156: return 0; // not tested
00332                                                 case 312: return 0;
00333                                                 case 625: return 0;
00334                                                 case 1250: return 1;
00335                                                 case 2500: return 3;
00336                                                 case 5000: return 3;
00337                                                 case 10000: return 4;
00338                                                 case 20000: return 4;
00339                                                 case 40000: return 4;
00340                                                 case 80000: return 8;  
00341                                                 case 160000: return 8; // ??
00342                                                 case 320000: return 8; // ??
00343                                                 case 480000: return 8; // ??
00344                                                 default: return 6;
00345                                   }
00346                 default: return 6;
00347         }
00348 }
00349 
00350 
00351 
00352 COUNTER choose_optimal_cuts_ffs (int dim, NUMBER N) {
00353         // This is for radii around the saturation point
00354         // (all in one cluster)
00355         // for MAXDIM = 11
00356 
00357         switch(dim) {
00358                 case 1: switch (N) {
00359                                                 case 39: return 0; 
00360                                                 case 78: return 0; 
00361                                                 case 156: return 0;
00362                                                 case 312: return 3;
00363                                                 case 625: return 3;
00364                                                 case 1250: return 5; 
00365                                                 case 2500: return 5; 
00366                                                 case 5000: return 6; 
00367                                                 case 10000: return 7;
00368                                                 case 20000: return 8;
00369                                                 case 40000: return 9;
00370                                                 case 80000: return 10;
00371                                                 case 160000: return 11; 
00372                                                 case 320000: return 11; 
00373                                                 case 480000: return 12; 
00374                                                 default: return 5;      
00375                                   }
00376 
00377                 case 2: switch (N) {                    
00378                                                 case 39: return 0; 
00379                                                 case 78: return 0; 
00380                                                 case 156: return 0;
00381                                                 case 312: return 3;
00382                                                 case 625: return 4;
00383                                                 case 1250: return 4;
00384                                                 case 2500: return 5;
00385                                                 case 5000: return 5;
00386                                                 case 10000: return 7;
00387                                                 case 20000: return 7;
00388                                                 case 40000: return 9;
00389                                                 case 80000: return 9;   
00390                                                 case 160000: return 9; 
00391                                                 case 320000: return 9; 
00392                                                 case 480000: return 9; 
00393                                                 default: return 5;
00394                                   }
00395 
00396                 case 3: switch (N) {                    
00397                                                 case 39: return 0; 
00398                                                 case 78: return 0; 
00399                                                 case 156: return 0; 
00400                                                 case 312: return 3;
00401                                                 case 625: return 3;
00402                                                 case 1250: return 3;
00403                                                 case 2500: return 3; //?
00404                                                 case 5000: return 4;
00405                                                 case 10000: return 4; //?
00406                                                 case 20000: return 5; //?
00407                                                 case 40000: return 5; //?
00408                                                 case 80000: return 7;  //?
00409                                                 case 160000: return 7;  
00410                                                 case 320000: return 7;
00411                                                 case 480000: return 7;   // ?
00412                                                 default: return 4;
00413                                                                                                                 
00414                                   }
00415                 case 4: switch (N) {                    
00416                                                 case 39: return 0; 
00417                                                 case 78: return 0; 
00418                                                 case 156: return 0; 
00419                                                 case 312: return 0;                     
00420                                                 case 625: return 0;
00421                                                 case 1250: return 0;
00422                                                 case 2500: return 2;
00423                                                 case 5000: return 4;
00424                                                 case 10000: return 4; 
00425                                                 case 20000: return 4;
00426                                                 case 40000: return 5;
00427                                                 case 80000: return 5; 
00428                                                 case 160000: return 5;  
00429                                                 case 320000: return 6;
00430                                                 case 480000: return 7; //? 
00431                                                 default: return 4;
00432                                   }
00433 
00434                 case 5: switch (N) {                            
00435                                                 case 39: return 0; 
00436                                                 case 78: return 0; 
00437                                                 case 156: return 0;
00438                                                 case 312: return 0;                     
00439                                                 case 625: return 0; 
00440                                                 case 1250: return 0;
00441                                                 case 2500: return 0;
00442                                                 case 5000: return 0;
00443                                                 case 10000: return 3;
00444                                                 case 20000: return 4;
00445                                                 case 40000: return 5;  
00446                                                 case 80000: return 5; 
00447                                                 case 160000: return 5;  
00448                                                 case 320000: return 6;  // ??
00449                                                 case 480000: return 7; // ??
00450                                                 default: return 3;
00451                                   }
00452 
00453                 case 6: switch (N) {                            
00454                                                 case 39: return 0; 
00455                                                 case 78: return 0; 
00456                                                 case 156: return 0;
00457                                                 case 312: return 0;                     
00458                                                 case 625: return 0;
00459                                                 case 1250: return 0;
00460                                                 case 2500: return 0; 
00461                                                 case 5000: return 0; 
00462                                                 case 10000: return 0; 
00463                                                 case 20000: return 0; 
00464                                                 case 40000: return 3;  
00465                                                 case 80000: return 5;  
00466                                                 case 160000: return 5;
00467                                                 case 320000: return 5; // ??
00468                                                 case 480000: return 6; // not measured
00469                                                 default: return 2;
00470                                   }
00471 
00472                 case 7: switch (N) {                            
00473                                                 case 39: return 0; 
00474                                                 case 78: return 0; 
00475                                                 case 156: return 0;
00476                                                 case 312: return 0;
00477                                                 case 625: return 0;
00478                                                 case 1250: return 0;
00479                                                 case 2500: return 0; 
00480                                                 case 5000: return 0; 
00481                                                 case 10000: return 0;
00482                                                 case 20000: return 0; 
00483                                                 case 40000: return 0; 
00484                                                 case 80000: return 0; 
00485                                                 case 160000: return 3; // ?
00486                                                 case 320000: return 3; // ?
00487                                                 case 480000: return 3; // ?
00488                                                 default: return 0;
00489                                   }
00490 
00491                 case 8: switch (N) {                            
00492                                                 case 39: return 0; 
00493                                                 case 78: return 0; 
00494                                                 case 156: return 0;
00495                                                 case 312: return 0;
00496                                                 case 625: return 0;
00497                                                 case 1250: return 0;
00498                                                 case 2500: return 0;// ?
00499                                                 case 5000: return 1; // ?
00500                                                 case 10000: return 1;// ?
00501                                                 case 20000: return 2;// ?
00502                                                 case 40000: return 2; // ?
00503                                                 case 80000: return 3;  // ?
00504                                                 case 160000: return 3; // ?
00505                                                 case 320000: return 3; // ?
00506                                                 case 480000: return 3; 
00507                                                 default: return 1;
00508                                   }
00509                 case 9: switch (N) {                            
00510                                                 case 39: return 0; 
00511                                                 case 78: return 0; 
00512                                                 case 156: return 0;
00513                                                 case 312: return 0;
00514                                                 case 625: return 0;
00515                                                 case 1250: return 0;
00516                                                 case 2500: return 0;
00517                                                 case 5000: return 1; // ??
00518                                                 case 10000: return 1; // ??
00519                                                 case 20000: return 1;// ??
00520                                                 case 40000: return 2;// ??
00521                                                 case 80000: return 2;  // ??
00522                                                 case 160000: return 2; // ??
00523                                                 case 320000: return 2; // ??
00524                                                 case 480000: return 2; // ??
00525                                                 default: return 1;
00526                                   }
00527                 case 10: switch (N) {                           
00528                                                 case 39: return 0; 
00529                                                 case 78: return 0; 
00530                                                 case 156: return 0;
00531                                                 case 312: return 0;
00532                                                 case 625: return 0;
00533                                                 case 1250: return 0;
00534                                                 case 2500: return 0;
00535                                                 case 5000: return 0;  // ??
00536                                                 case 10000: return 1;  // ??
00537                                                 case 20000: return 1;  // ??
00538                                                 case 40000: return 1;  // ??
00539                                                 case 80000: return 1;   // ??
00540                                                 case 160000: return 2; // ??
00541                                                 case 320000: return 2; // ??
00542                                                 case 480000: return 2; // ??
00543                                                 default: return 1;
00544                                   }
00545                         case 11: switch (N) {                           
00546                                                 case 39: return 0; 
00547                                                 case 78: return 0; 
00548                                                 case 156: return 0;
00549                                                 case 312: return 0;
00550                                                 case 625: return 0;
00551                                                 case 1250: return 0;
00552                                                 case 2500: return 0;
00553                                                 case 5000: return 0;  // ??
00554                                                 case 10000: return 1;  // ??
00555                                                 case 20000: return 1;  // ??
00556                                                 case 40000: return 1;  // ??
00557                                                 case 80000: return 1;   // ??
00558                                                 case 160000: return 2; // ??
00559                                                 case 320000: return 2; // ??
00560                                                 case 480000: return 2; // ??
00561                                                 default: return 0;
00562                                   }
00563                 default: return 6;
00564         }
00565 }
00566 




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

www.AndreasKrueger.de/thesis/code