Changeset 3615 in Sophya for trunk/Cosmo/SimLSS


Ignore:
Timestamp:
May 1, 2009, 1:34:31 PM (16 years ago)
Author:
cmv
Message:

Modifs relatives a l'introduction de RandomGeneratorInterface + delete de srandgen.c, cmv 01/05/2009

Location:
trunk/Cosmo/SimLSS
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cosmo/SimLSS/agnjackson.cc

    r3325 r3615  
     1#include "sopnamsp.h"
    12#include "machdefs.h"
    23#include <iostream>
  • trunk/Cosmo/SimLSS/cmvobserv3d.cc

    r3594 r3615  
    77#include <math.h>
    88#include <unistd.h>
     9#include "sophyainit.h"
    910#include "timing.h"
    1011#include "ntuple.h"
    1112#include "matharr.h"
     13#include "randfmt.h"
     14//#include "randr48.h"
     15#include "srandgen.h"
    1216
    1317#include "constcosmo.h"
     
    7175int main(int narg,char *arg[])
    7276{
     77 SophyaInit();
    7378 InitTim();
    7479
     
    146151 system("date -u");
    147152
     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
    148160 char c;
    149161 while((c = getopt(narg,arg,"ha0PWSV2U:G:F:x:y:z:s:Z:M:A:T:N:Q:R:8:O:o:")) != -1) {
     
    151163  switch (c) {
    152164  case 'a' :
    153     Auto_Ini_Ranf(5);
     165    AutoInitRand(5);
    154166    break;
    155167  case '0' :
     
    262274     <<whattowrt[4]<<endl;
    263275 cout<<"rootnameout="<<rootnameout<<endl;
     276 ShowRandom();
     277 cout<<"   First random is: "<<drand01()<<endl;
    264278
    265279 string tagobs = rootnameout + ".ppf";
     
    772786 }
    773787
     788 //-----------------------------------------------------------------
     789 delete RandGen;
    774790 PrtTim(">>>> End Of Job");
     791
    775792 return 0;
    776793}
  • trunk/Cosmo/SimLSS/cmvschdist.cc

    r3344 r3615  
    1717#include <math.h>
    1818#include <unistd.h>
     19#include "sophyainit.h"
    1920#include "timing.h"
    2021#include "histos.h"
    2122#include "ntuple.h"
     23//#include "randr48.h"
     24#include "randfmt.h"
    2225#include "srandgen.h"
    2326#include "perandom.h"
     
    4649int main(int narg,char *arg[])
    4750{
     51SophyaInit();
    4852 double h75 = 0.71 / 0.75;
    4953 double nstar = 0.006*pow(h75,3.);  // 
     
    6266 string nametoppf = "";
    6367
     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
    6475 char c;
    6576 while((c = getopt(narg,arg,"h0avm:N:n:r:R:W:")) != -1) {
     
    99110     break;
    100111   case 'a' :
    101      Auto_Ini_Ranf(5);
     112     AutoInitRand(5);
    102113     break;
    103114   case 'h' :
     
    201212 }
    202213
     214 delete RandGen;
     215
    203216 PrtTim("End of Job");
    204217
  • trunk/Cosmo/SimLSS/cmvtstagn.cc

    r3572 r3615  
    88#include <math.h>
    99#include <unistd.h>
     10#include "sophyainit.h"
    1011#include "timing.h"
    1112#include "ntuple.h"
     
    1314#include "geneutils.h"
    1415#include "agnjackson.h"
     16#include "srandgen.h"
    1517
    1618void usage(void);
     
    2729int main(int narg,char *arg[])
    2830{
     31SophyaInit();
    2932 double angsol = 1.;  // sr
    3033 double lxmin=-3.,lxmax=4.; int nbinlx = -100;
     
    100103   for(long i=0;i<npix;i++) {
    101104     if(i%l==0) cout<<"...trial: "<<i<<endl;
    102      unsigned long n = PoissRandLimit(mu,10.);
     105     uint_8 n = Poisson(mu,10.);
    103106     hnobj.Add((double)n);
    104107     sumn += n; sumn2 += n*n;
  • trunk/Cosmo/SimLSS/cmvtstsch.cc

    r3572 r3615  
    77#include <math.h>
    88#include <unistd.h>
     9#include "sophyainit.h"
    910#include "timing.h"
    1011#include "histos.h"
     
    3536int main(int narg,char *arg[])
    3637{
     38SophyaInit();
    3739 double h75 = 0.71 / 0.75;
    3840 double nstar = 0.006*pow(h75,3.);  // 
     
    6668     break;
    6769   case 'a' :
    68      Auto_Ini_Ranf(5);
     70     AutoInitRand(5);
    6971     break;
    7072   case 'h' :
  • trunk/Cosmo/SimLSS/genefluct3d.cc

    r3594 r3615  
     1#include "sopnamsp.h"
    12#include "machdefs.h"
    23#include <iostream>
     
    693694       // Explication de la division par 2: voir perandom.cc
    694695       // ou egalement Coles & Lucchin, Cosmology formula 13.7.2 p279
    695        T_(l,j,i) = ComplexGaussRan(sqrt(pk/2.));
     696       T_(l,j,i) = ComplexGaussian(sqrt(pk/2.));
    696697     }
    697698   }
     
    13461347   double v = data_[ip];
    13471348   if(v>0.) {
    1348      unsigned long dn = PoissRandLimit(v,10.);
     1349     uint_8 dn = Poisson(v,10.);
    13491350     data_[ip] = (double)dn;
    13501351     sum += (double)dn;
  • trunk/Cosmo/SimLSS/geneutils.cc

    r3595 r3615  
     1#include "sopnamsp.h"
    12#include "machdefs.h"
    23#include <iostream>
Note: See TracChangeset for help on using the changeset viewer.