Changeset 3615 in Sophya for trunk/Cosmo
- Timestamp:
- May 1, 2009, 1:34:31 PM (16 years ago)
- Location:
- trunk/Cosmo/SimLSS
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/agnjackson.cc
r3325 r3615 1 #include "sopnamsp.h" 1 2 #include "machdefs.h" 2 3 #include <iostream> -
trunk/Cosmo/SimLSS/cmvobserv3d.cc
r3594 r3615 7 7 #include <math.h> 8 8 #include <unistd.h> 9 #include "sophyainit.h" 9 10 #include "timing.h" 10 11 #include "ntuple.h" 11 12 #include "matharr.h" 13 #include "randfmt.h" 14 //#include "randr48.h" 15 #include "srandgen.h" 12 16 13 17 #include "constcosmo.h" … … 71 75 int main(int narg,char *arg[]) 72 76 { 77 SophyaInit(); 73 78 InitTim(); 74 79 … … 146 151 system("date -u"); 147 152 153 // --- Choix du generateur aleatoire (a faire ICI imperativement avant AutoInitRand) 154 FMTRandGen *RandGen = new FMTRandGen; 155 RandGen->SelectGaussianAlgo(C_Gaussian_RandLibSNorm); 156 RandGen->SelectPoissonAlgo(C_Poisson_Ahrens); 157 RandomGeneratorInterface::SetGlobalRandGenP(RandGen); 158 159 // --- Decodage des arguments 148 160 char c; 149 161 while((c = getopt(narg,arg,"ha0PWSV2U:G:F:x:y:z:s:Z:M:A:T:N:Q:R:8:O:o:")) != -1) { … … 151 163 switch (c) { 152 164 case 'a' : 153 Auto _Ini_Ranf(5);165 AutoInitRand(5); 154 166 break; 155 167 case '0' : … … 262 274 <<whattowrt[4]<<endl; 263 275 cout<<"rootnameout="<<rootnameout<<endl; 276 ShowRandom(); 277 cout<<" First random is: "<<drand01()<<endl; 264 278 265 279 string tagobs = rootnameout + ".ppf"; … … 772 786 } 773 787 788 //----------------------------------------------------------------- 789 delete RandGen; 774 790 PrtTim(">>>> End Of Job"); 791 775 792 return 0; 776 793 } -
trunk/Cosmo/SimLSS/cmvschdist.cc
r3344 r3615 17 17 #include <math.h> 18 18 #include <unistd.h> 19 #include "sophyainit.h" 19 20 #include "timing.h" 20 21 #include "histos.h" 21 22 #include "ntuple.h" 23 //#include "randr48.h" 24 #include "randfmt.h" 22 25 #include "srandgen.h" 23 26 #include "perandom.h" … … 46 49 int main(int narg,char *arg[]) 47 50 { 51 SophyaInit(); 48 52 double h75 = 0.71 / 0.75; 49 53 double nstar = 0.006*pow(h75,3.); // … … 62 66 string nametoppf = ""; 63 67 68 // --- Choix du generateur aleatoire (a faire ICI imperativement avant AutoInitRand) 69 FMTRandGen *RandGen = new FMTRandGen; 70 RandGen->SelectGaussianAlgo(C_Gaussian_RandLibSNorm); 71 RandGen->SelectPoissonAlgo(C_Poisson_Ahrens); 72 RandomGeneratorInterface::SetGlobalRandGenP(RandGen); 73 74 // --- decodage des arguments 64 75 char c; 65 76 while((c = getopt(narg,arg,"h0avm:N:n:r:R:W:")) != -1) { … … 99 110 break; 100 111 case 'a' : 101 Auto _Ini_Ranf(5);112 AutoInitRand(5); 102 113 break; 103 114 case 'h' : … … 201 212 } 202 213 214 delete RandGen; 215 203 216 PrtTim("End of Job"); 204 217 -
trunk/Cosmo/SimLSS/cmvtstagn.cc
r3572 r3615 8 8 #include <math.h> 9 9 #include <unistd.h> 10 #include "sophyainit.h" 10 11 #include "timing.h" 11 12 #include "ntuple.h" … … 13 14 #include "geneutils.h" 14 15 #include "agnjackson.h" 16 #include "srandgen.h" 15 17 16 18 void usage(void); … … 27 29 int main(int narg,char *arg[]) 28 30 { 31 SophyaInit(); 29 32 double angsol = 1.; // sr 30 33 double lxmin=-3.,lxmax=4.; int nbinlx = -100; … … 100 103 for(long i=0;i<npix;i++) { 101 104 if(i%l==0) cout<<"...trial: "<<i<<endl; 102 u nsigned long n = PoissRandLimit(mu,10.);105 uint_8 n = Poisson(mu,10.); 103 106 hnobj.Add((double)n); 104 107 sumn += n; sumn2 += n*n; -
trunk/Cosmo/SimLSS/cmvtstsch.cc
r3572 r3615 7 7 #include <math.h> 8 8 #include <unistd.h> 9 #include "sophyainit.h" 9 10 #include "timing.h" 10 11 #include "histos.h" … … 35 36 int main(int narg,char *arg[]) 36 37 { 38 SophyaInit(); 37 39 double h75 = 0.71 / 0.75; 38 40 double nstar = 0.006*pow(h75,3.); // … … 66 68 break; 67 69 case 'a' : 68 Auto _Ini_Ranf(5);70 AutoInitRand(5); 69 71 break; 70 72 case 'h' : -
trunk/Cosmo/SimLSS/genefluct3d.cc
r3594 r3615 1 #include "sopnamsp.h" 1 2 #include "machdefs.h" 2 3 #include <iostream> … … 693 694 // Explication de la division par 2: voir perandom.cc 694 695 // ou egalement Coles & Lucchin, Cosmology formula 13.7.2 p279 695 T_(l,j,i) = ComplexGauss Ran(sqrt(pk/2.));696 T_(l,j,i) = ComplexGaussian(sqrt(pk/2.)); 696 697 } 697 698 } … … 1346 1347 double v = data_[ip]; 1347 1348 if(v>0.) { 1348 u nsigned long dn = PoissRandLimit(v,10.);1349 uint_8 dn = Poisson(v,10.); 1349 1350 data_[ip] = (double)dn; 1350 1351 sum += (double)dn; -
trunk/Cosmo/SimLSS/geneutils.cc
r3595 r3615 1 #include "sopnamsp.h" 1 2 #include "machdefs.h" 2 3 #include <iostream>
Note:
See TracChangeset
for help on using the changeset viewer.