Changeset 3615 in Sophya for trunk/SophyaLib
- Timestamp:
- May 1, 2009, 1:34:31 PM (16 years ago)
- Location:
- trunk/SophyaLib
- Files:
-
- 1 deleted
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/BaseTools/Makefile
r3602 r3615 4 4 5 5 clean: 6 rm -f $(SOPHYAOBJP)datatype.o $(SOPHYAOBJP)dvlist.o $(SOPHYAOBJP)fiondblock.o $(SOPHYAOBJP)mutyv.o $(SOPHYAOBJP)ndatablock.o $(SOPHYAOBJP)pexceptions.o $(SOPHYAOBJP)ppersist.o $(SOPHYAOBJP)ppfbinstream.o $(SOPHYAOBJP)ppftpointerio.o $(SOPHYAOBJP)randfmt.o $(SOPHYAOBJP)randinterf.o $(SOPHYAOBJP)randr48.o $(SOPHYAOBJP)rawstream.o $(SOPHYAOBJP)sophyainit.o $(SOPHYAOBJP)stsrand.o $(SOPHYAOBJP)timestamp.o $(SOPHYAOBJP)dSFMT.o $(SOPHYAOBJP)gnumd5.o $(SOPHYAOBJP)srandgen.o6 rm -f $(SOPHYAOBJP)datatype.o $(SOPHYAOBJP)dvlist.o $(SOPHYAOBJP)fiondblock.o $(SOPHYAOBJP)mutyv.o $(SOPHYAOBJP)ndatablock.o $(SOPHYAOBJP)pexceptions.o $(SOPHYAOBJP)ppersist.o $(SOPHYAOBJP)ppfbinstream.o $(SOPHYAOBJP)ppftpointerio.o $(SOPHYAOBJP)randfmt.o $(SOPHYAOBJP)randinterf.o $(SOPHYAOBJP)randr48.o $(SOPHYAOBJP)rawstream.o $(SOPHYAOBJP)sophyainit.o $(SOPHYAOBJP)stsrand.o $(SOPHYAOBJP)timestamp.o $(SOPHYAOBJP)dSFMT.o $(SOPHYAOBJP)gnumd5.o 7 7 rm -f $(SOPHYALIBP)libBaseTools.a 8 8 9 $(SOPHYALIBP)libBaseTools.a : $(SOPHYAOBJP)datatype.o $(SOPHYAOBJP)dSFMT.o $(SOPHYAOBJP)dvlist.o $(SOPHYAOBJP)fiondblock.o $(SOPHYAOBJP)gnumd5.o $(SOPHYAOBJP)mutyv.o $(SOPHYAOBJP)ndatablock.o $(SOPHYAOBJP)pexceptions.o $(SOPHYAOBJP)ppersist.o $(SOPHYAOBJP)ppfbinstream.o $(SOPHYAOBJP)ppftpointerio.o $(SOPHYAOBJP)randfmt.o $(SOPHYAOBJP)randinterf.o $(SOPHYAOBJP)randr48.o $(SOPHYAOBJP)rawstream.o $(SOPHYAOBJP)sophyainit.o $(SOPHYAOBJP)s randgen.o $(SOPHYAOBJP)stsrand.o $(SOPHYAOBJP)timestamp.o9 $(SOPHYALIBP)libBaseTools.a : $(SOPHYAOBJP)datatype.o $(SOPHYAOBJP)dSFMT.o $(SOPHYAOBJP)dvlist.o $(SOPHYAOBJP)fiondblock.o $(SOPHYAOBJP)gnumd5.o $(SOPHYAOBJP)mutyv.o $(SOPHYAOBJP)ndatablock.o $(SOPHYAOBJP)pexceptions.o $(SOPHYAOBJP)ppersist.o $(SOPHYAOBJP)ppfbinstream.o $(SOPHYAOBJP)ppftpointerio.o $(SOPHYAOBJP)randfmt.o $(SOPHYAOBJP)randinterf.o $(SOPHYAOBJP)randr48.o $(SOPHYAOBJP)rawstream.o $(SOPHYAOBJP)sophyainit.o $(SOPHYAOBJP)stsrand.o $(SOPHYAOBJP)timestamp.o 10 10 $(AR) $(ARFLAGS) $@ $? 11 11 touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist … … 84 84 pexceptions.h ppersist.h gnumd5.h ppfbinstream.h rawstream.h \ 85 85 ppfnametag.h fiondblock.h ndatablock.h anydataobj.h dvlist.h objfio.h \ 86 mutyv.h timestamp.h stsrand.h randr48.h randinterf.h randfmt.h \87 d sfmtflags.h dSFMT.h fiosegdb.h segdatablock.h thsafeop.h \88 ppf tpointerio.h ppfwrapstlv.h sversion.h86 mutyv.h timestamp.h randr48.h randinterf.h randfmt.h dsfmtflags.h \ 87 dSFMT.h fiosegdb.h segdatablock.h thsafeop.h ppftpointerio.h \ 88 ppfwrapstlv.h sversion.h 89 89 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ sophyainit.cc 90 90 … … 107 107 $(CCOMPILE) -o $@ gnumd5.c 108 108 109 $(SOPHYAOBJP)srandgen.o: srandgen.c $(SOPHYAINCP)machdefs.h \110 srandgen.h smathconst.h111 $(CCOMPILE) -o $@ srandgen.c112 -
trunk/SophyaLib/BaseTools/objlist.list
r3602 r3615 15 15 rawstream.o 16 16 sophyainit.o 17 srandgen.o18 17 stsrand.o 19 18 timestamp.o -
trunk/SophyaLib/BaseTools/randfmt.cc
r3603 r3615 19 19 FMTRandGen::~FMTRandGen() 20 20 { 21 } 22 23 void FMTRandGen::ShowRandom() 24 { 25 cout<<"RandomGenerator is FMTRandGen"<<endl; 21 26 } 22 27 -
trunk/SophyaLib/BaseTools/randfmt.h
r3602 r3615 30 30 virtual void SetSeed(vector<uint_4> seed); 31 31 virtual void AutoInit(int lp=0); 32 virtual void ShowRandom(); 32 33 33 34 friend class ObjFileIO<FMTRandGen> ; -
trunk/SophyaLib/BaseTools/randinterf.cc
r3611 r3615 28 28 29 29 \sa frand01 drand01 frandpm1 drandpm1 30 \sa Gau Rnd PoissRand30 \sa Gaussian Poisson 31 31 32 32 */ … … 62 62 } 63 63 64 void RandomGeneratorInterface::ShowRandom() 65 { 66 cout<<"RandomGenerator is RandomGeneratorInterface i.e. UNDEFINED"<<endl; 67 } 64 68 65 69 ///////////////////////////////////////////////////////////////////////// … … 172 176 } 173 177 178 void RandomGeneratorInterface::AutoInit(int lp) 179 { 180 printf("RandomGeneratorInterface::AutoInit(): undefined code !!!\n"); 181 throw MathExc("RandomGeneratorInterface::AutoInit(): undefined code !!!"); 182 } 183 174 184 ///////////////////////////////////////////////////////////////////////// 175 185 ///////////////////////////////////////////////////////////////////////// … … 773 783 } 774 784 785 ///////////////////////////////////////////////////////////////////////// 786 ///////////////////////////////////////////////////////////////////////// 787 ///////////////////////////////////////////////////////////////////////// 788 789 int RandomGeneratorInterface::Gaussian2DRho(double &x,double &y,double mx,double my,double sx,double sy,double ro) 790 /* 791 ++ 792 | Tirage de 2 nombres aleatoires x et y distribues sur une gaussienne 2D 793 | de centre (mx,my), de coefficient de correlation rho (ro) et telle que 794 | les sigmas finals des variables x et y soient sx,sy (ce sont 795 | les valeurs des distributions marginales des variables aleatoires x et y 796 | c'est a dire les sigmas des projections x et y de l'histogramme 2D 797 | de la gaussienne). Retourne 0 si ok. 798 | 799 | - La densite de probabilite (normalisee a 1) sur laquelle on tire est: 800 | N*exp[-0.5*{[(dx/sx)^2-2*ro/(sx*sy)*dx*dy+(dy/sy)^2]/(1-ro^2)}] 801 | avec dx = x-mx, dy = y-my et N = 1/[2Pi*sx*sy*sqrt(1-ro^2)] 802 | - Dans ce cas la distribution marginale est (ex en X): 803 | 1/(sqrt(2Pi)*sx) * exp[-0.5*{dx^2/sx^2}] 804 | - La matrice des covariances C des variables x,y est: 805 | | sx^2 ro*sx*sy | 806 | | | et det(C) = (1-ro^2)*sx^2*sy^2 807 | | ro*sx*sy sy^2 | 808 | - La matrice inverse C^(-1) est: 809 | | 1/sx^2 -ro/(sx*sy) | 810 | | | * 1/(1-ro^2) 811 | | -ro/(sx*sy) 1/sy^2 | 812 | 813 | - Remarque: 814 | le sigma que l'on obtient quand on fait une coupe de la gaussienne 2D 815 | en y=0 (ou x=0) est: SX0(y=0) = sx*sqrt(1-ro^2) different de sx 816 | SY0(x=0) = sy*sqrt(1-ro^2) different de sy 817 | La distribution qui correspond a des sigmas SX0,SY0 818 | pour les coupes en y=0,x=0 de la gaussienne 2D serait: 819 | N*exp[-0.5*{ (dx/SX0)^2-2*ro/(SX0*SY0)*dx*dy+(dy/SY0)^2 }] 820 | avec N = sqrt(1-ro^2)/(2Pi*SX0*SY0) et les variances 821 | des variables x,y sont toujours 822 | sx=SX0/sqrt(1-ro^2), sy=SY0/sqrt(1-ro^2) 823 -- 824 */ 825 { 826 double a,b,sa; 827 828 if( ro <= -1. || ro >= 1. ) return 1; 829 830 while( (b=Flat01()) == 0. ); 831 b = sqrt(-2.*log(b)); 832 a = 2.*M_PI * Flat01(); 833 sa = sin(a); 834 835 x = mx + sx*b*(sqrt(1.-ro*ro)*cos(a)+ro*sa); 836 y = my + sy*b*sa; 837 838 return 0; 839 } 840 841 void RandomGeneratorInterface::Gaussian2DAng(double &x,double &y,double mx,double my,double sa,double sb,double teta) 842 /* 843 ++ 844 | Tirage de 2 nombres aleatoires x et y distribues sur une gaussienne 2D 845 | de centre (x=mx,y=my), de sigmas grand axe et petit axe (sa,sb) 846 | et dont le grand axe fait un angle teta (radian) avec l'axe des x. 847 | 848 | - La densite de probabilite (normalisee a 1) sur laquelle on tire est: 849 | N*exp[-0.5*{ (A/sa)**2+(C/sc)**2 }], N=1/(2Pi*sa*sc) 850 | ou A et B sont les coordonnees selon le grand axe et le petit axe 851 | et teta = angle(x,A), le resultat subit ensuite une rotation d'angle teta. 852 | - La matrice des covariances C des variables A,B est: 853 | | sa^2 0 | 854 | | | et det(C) = (1-ro^2)*sa^2*sb^2 855 | | 0 sb^2 | 856 | - La distribution x,y resultante est: 857 | N*exp[-0.5*{[(dx/sx)^2-2*ro/(sx*sy)*dx*dy+(dy/sy)^2]/(1-ro^2)}] 858 | ou N est donne dans NormCo et sx,sy,ro sont calcules a partir 859 | de sa,sc,teta (voir fonctions paramga ou gaparam). La matrice des 860 | covariances des variables x,y est donnee dans la fonction NormCo. 861 -- 862 */ 863 { 864 double c,s,X,Y; 865 866 while( (s = Flat01()) == 0. ); 867 s = sqrt(-2.*log(s)); 868 c = 2.*M_PI * Flat01(); 869 870 X = sa*s*cos(c); 871 Y = sb*s*sin(c); 872 873 c = cos(teta); s = sin(teta); 874 x = mx + c*X - s*Y; 875 y = my + s*X + c*Y; 876 } 775 877 776 878 } /* namespace SOPHYA */ … … 780 882 ///////////////////////////////////////////////////////////////// 781 883 /* 782 **** Remarques sur complex< r_8 > ComplexGauss Ran(double sig) ****884 **** Remarques sur complex< r_8 > ComplexGaussian(double sig) **** 783 885 784 886 --- variables gaussiennes x,y independantes -
trunk/SophyaLib/BaseTools/randinterf.h
r3612 r3615 110 110 111 111 // --- Le tirage gaussien complexe (cf texte a la fin du .cc) 112 inline complex< r_8 > ComplexGauss Ran(void)112 inline complex< r_8 > ComplexGaussian(void) 113 113 {return complex< r_8 >(Gaussian(),Gaussian());} 114 inline complex< r_8 > ComplexGauss Ran(double sig)114 inline complex< r_8 > ComplexGaussian(double sig) 115 115 {return complex< r_8 >(sig*Gaussian(),sig*Gaussian());} 116 116 /*! \brief Returns the module of a random complex number generated by ComplexGaussRan */ 117 inline double ModComplexGauss Ran(double sig=1.)117 inline double ModComplexGaussian(double sig=1.) 118 118 {double r=-log(1.-Next()); return sig*sqrt(2.*r);} 119 119 120 //! Return the pointer to the default global RandomGenerator object 120 // --- Le tirage sur une distribution gaussienne a 2D 121 /*! \brief Return 2 random numbers following a gaussian 2D distribution */ 122 virtual int Gaussian2DRho(double &x,double &y,double mx,double my,double sx,double sy,double ro); 123 virtual void Gaussian2DAng(double &x,double &y,double mx,double my,double sa,double sb,double teta); 124 125 //! Return the pointer to the default global RandomGenerator object 121 126 static inline RandomGeneratorInterface* GetGlobalRandGenP() 122 127 { return gl_rndgen_p; } 123 128 124 // Permet de definir l'instance global du generateur aleatoire 129 //! Initialisation automatique 130 virtual void AutoInit(int lp=0); 131 132 //! Print 133 virtual void ShowRandom(); 134 135 // Permet de definir l'instance global du generateur aleatoire 125 136 static void SetGlobalRandGenP(RandomGeneratorInterface* rgp); 126 137 -
trunk/SophyaLib/BaseTools/randr48.cc
r3604 r3615 16 16 DR48RandGen::~DR48RandGen() 17 17 { 18 } 19 20 void DR48RandGen::ShowRandom() 21 { 22 cout<<"RandomGenerator is DR48RandGen"<<endl; 18 23 } 19 24 … … 112 117 } 113 118 119 120 void ThSDR48RandGen::ShowRandom() 121 { 122 cout<<"RandomGenerator is ThSDR48RandGen"<<endl; 123 } 114 124 115 125 void ThSDR48RandGen::SetSeed(long int seed) -
trunk/SophyaLib/BaseTools/randr48.h
r3612 r3615 14 14 #include "randinterf.h" 15 15 16 17 /* ------- SPECIFIQUE Mac Darwin OSX <= 10.2 (gcc < 3.x) -------- */ 18 #if defined(Darwin) && defined(__GNUC__) && (__GNUC__ < 3) 19 #include "osx_values.h" 20 /* Declaration de drand48 et srand48 etc , mis ds SysSpec, Reza 11/02/2003 */ 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 unsigned short int * seed48(unsigned short int seed16v[3]); 25 void srand48(long seedval); 26 #ifdef __cplusplus 27 } 28 #endif 29 #define drand48() ((double)(random())/LONG_MAX) 30 #endif 31 /* ------- FIN SPECIFIQUE Mac OSX / Darwin V <= 10.2 --------- */ 32 33 16 34 namespace SOPHYA { 17 35 … … 27 45 virtual void GetSeed(uint_2 seed[3]); 28 46 virtual void AutoInit(int lp=0); 47 virtual void ShowRandom(); 29 48 30 49 friend class ObjFileIO<DR48RandGen> ; … … 54 73 virtual void GetSeed(uint_2 seed[3]); 55 74 virtual void AutoInit(int lp=0); 75 virtual void ShowRandom(); 56 76 57 77 friend class ObjFileIO<ThSDR48RandGen> ; -
trunk/SophyaLib/BaseTools/smakefile
r3602 r3615 4 4 5 5 clean: 6 rm -f $(SOPHYAOBJP)datatype.o $(SOPHYAOBJP)dvlist.o $(SOPHYAOBJP)fiondblock.o $(SOPHYAOBJP)mutyv.o $(SOPHYAOBJP)ndatablock.o $(SOPHYAOBJP)pexceptions.o $(SOPHYAOBJP)ppersist.o $(SOPHYAOBJP)ppfbinstream.o $(SOPHYAOBJP)ppftpointerio.o $(SOPHYAOBJP)randfmt.o $(SOPHYAOBJP)randinterf.o $(SOPHYAOBJP)randr48.o $(SOPHYAOBJP)rawstream.o $(SOPHYAOBJP)sophyainit.o $(SOPHYAOBJP)stsrand.o $(SOPHYAOBJP)timestamp.o $(SOPHYAOBJP)dSFMT.o $(SOPHYAOBJP)gnumd5.o $(SOPHYAOBJP)srandgen.o6 rm -f $(SOPHYAOBJP)datatype.o $(SOPHYAOBJP)dvlist.o $(SOPHYAOBJP)fiondblock.o $(SOPHYAOBJP)mutyv.o $(SOPHYAOBJP)ndatablock.o $(SOPHYAOBJP)pexceptions.o $(SOPHYAOBJP)ppersist.o $(SOPHYAOBJP)ppfbinstream.o $(SOPHYAOBJP)ppftpointerio.o $(SOPHYAOBJP)randfmt.o $(SOPHYAOBJP)randinterf.o $(SOPHYAOBJP)randr48.o $(SOPHYAOBJP)rawstream.o $(SOPHYAOBJP)sophyainit.o $(SOPHYAOBJP)stsrand.o $(SOPHYAOBJP)timestamp.o $(SOPHYAOBJP)dSFMT.o $(SOPHYAOBJP)gnumd5.o 7 7 rm -f $(SOPHYALIBP)libBaseTools.a 8 8 9 $(SOPHYALIBP)libBaseTools.a : $(SOPHYAOBJP)datatype.o $(SOPHYAOBJP)dSFMT.o $(SOPHYAOBJP)dvlist.o $(SOPHYAOBJP)fiondblock.o $(SOPHYAOBJP)gnumd5.o $(SOPHYAOBJP)mutyv.o $(SOPHYAOBJP)ndatablock.o $(SOPHYAOBJP)pexceptions.o $(SOPHYAOBJP)ppersist.o $(SOPHYAOBJP)ppfbinstream.o $(SOPHYAOBJP)ppftpointerio.o $(SOPHYAOBJP)randfmt.o $(SOPHYAOBJP)randinterf.o $(SOPHYAOBJP)randr48.o $(SOPHYAOBJP)rawstream.o $(SOPHYAOBJP)sophyainit.o $(SOPHYAOBJP)s randgen.o $(SOPHYAOBJP)stsrand.o $(SOPHYAOBJP)timestamp.o9 $(SOPHYALIBP)libBaseTools.a : $(SOPHYAOBJP)datatype.o $(SOPHYAOBJP)dSFMT.o $(SOPHYAOBJP)dvlist.o $(SOPHYAOBJP)fiondblock.o $(SOPHYAOBJP)gnumd5.o $(SOPHYAOBJP)mutyv.o $(SOPHYAOBJP)ndatablock.o $(SOPHYAOBJP)pexceptions.o $(SOPHYAOBJP)ppersist.o $(SOPHYAOBJP)ppfbinstream.o $(SOPHYAOBJP)ppftpointerio.o $(SOPHYAOBJP)randfmt.o $(SOPHYAOBJP)randinterf.o $(SOPHYAOBJP)randr48.o $(SOPHYAOBJP)rawstream.o $(SOPHYAOBJP)sophyainit.o $(SOPHYAOBJP)stsrand.o $(SOPHYAOBJP)timestamp.o 10 10 $(AR) $(ARFLAGS) $@ $? 11 11 touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist … … 84 84 pexceptions.h ppersist.h gnumd5.h ppfbinstream.h rawstream.h \ 85 85 ppfnametag.h fiondblock.h ndatablock.h anydataobj.h dvlist.h objfio.h \ 86 mutyv.h timestamp.h stsrand.h randr48.h randinterf.h randfmt.h \87 d sfmtflags.h dSFMT.h fiosegdb.h segdatablock.h thsafeop.h \88 ppf tpointerio.h ppfwrapstlv.h sversion.h86 mutyv.h timestamp.h randr48.h randinterf.h randfmt.h dsfmtflags.h \ 87 dSFMT.h fiosegdb.h segdatablock.h thsafeop.h ppftpointerio.h \ 88 ppfwrapstlv.h sversion.h 89 89 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ sophyainit.cc 90 90 … … 107 107 $(CCOMPILE) -o $@ gnumd5.c 108 108 109 $(SOPHYAOBJP)srandgen.o: srandgen.c $(SOPHYAINCP)machdefs.h \110 srandgen.h smathconst.h111 $(CCOMPILE) -o $@ srandgen.c112 -
trunk/SophyaLib/BaseTools/srandgen.h
r3597 r3615 1 /* fonctions pour generateurs aleatoires 2 /* cmv 23/06/94*/3 /* R.Ansari 04/2000 Copie de nbrand.h .c*/1 /* fonctions pour generateurs aleatoires cmv 23/06/94 */ 2 /* Copie de nbrand.h .c .Ansari 04/2000 */ 3 /* interface avec RandomGeneratorInterface cmv 04/2009 */ 4 4 5 5 #ifndef SRANDGEN_H_SEEN … … 8 8 #include "machdefs.h" 9 9 #include <stdlib.h> 10 #include <complex> 11 #include "randinterf.h" 10 12 11 /* ------- SPECIFIQUE Mac Darwin OSX <= 10.2 (gcc < 3.x) -------- */ 12 #if defined(Darwin) && defined(__GNUC__) && (__GNUC__ < 3) 13 #include "osx_values.h" 14 /* Declaration de drand48 et srand48 etc , mis ds SysSpec 15 Reza 11/02/2003 */ 16 #ifdef __cplusplus 17 extern "C" { 18 #endif 19 unsigned short int * seed48(unsigned short int seed16v[3]); 20 void srand48(long seedval); 21 /* Faute de mieux pour le moment : */ 22 #ifdef __cplusplus 23 } 24 #endif 25 #define drand48() ((double)(random())/LONG_MAX) 26 #endif 27 /* ------- FIN SPECIFIQUE Mac OSX / Darwin V <= 10.2 --------- */ 13 /* Declaration en fonctions inline interface avec RandomGeneratorInterface global*/ 28 14 29 #ifdef __cplusplus 30 /* Declaration en fonctions inlines pour du C++ */ 31 inline float frand01() { return ( (float) drand48() ); } 32 inline double drand01() { return ( drand48() ); } 33 inline double ranf01() { return ( drand48() ); } 15 namespace SOPHYA { 34 16 35 inline float frandpm1() { return ( 2. * (float) drand48() - 1.); }36 inline double drandpm1() { return ( 2. * drand48() - 1.); }37 inline double ranfpm1() { return ( 2. * drand48() - 1.); }38 #else39 /* les memes en define pour du C */40 #define frand01() ( (float) drand48() )41 #define drand01() ( drand48() )42 #define ranf01() drand01()43 17 44 #define frandpm1() ( 2. * frand01() - 1.) 45 #define drandpm1() ( 2. * drand01() - 1.) 46 #define ranfpm1() drandpm1() 47 #endif 18 inline double drand01() 19 {return RandomGeneratorInterface::GetGlobalRandGenP()->Flat01();} 20 inline double drandpm1() 21 {return RandomGeneratorInterface::GetGlobalRandGenP()->Flatpm1();} 48 22 49 struct tirage_alea { 50 int Nbin; 51 double Min,Max,Lbin; 52 double *Tab; 53 }; 54 typedef struct tirage_alea TIREALEA; 23 inline double NorRand() 24 {return RandomGeneratorInterface::GetGlobalRandGenP()->Gaussian();} 25 inline double Gaussian(double sigma,double mu) 26 {return RandomGeneratorInterface::GetGlobalRandGenP()->Gaussian(sigma,mu);} 55 27 56 #ifdef __cplusplus 57 extern "C" { 58 #endif 28 inline complex< r_8 > ComplexGaussian() 29 {return RandomGeneratorInterface::GetGlobalRandGenP()->ComplexGaussian();} 30 inline complex< r_8 > ComplexGaussian(double sig) 31 {return RandomGeneratorInterface::GetGlobalRandGenP()->ComplexGaussian(sig);} 32 inline double ModComplexGaussian(double sig=1.) 33 {return RandomGeneratorInterface::GetGlobalRandGenP()->ModComplexGaussian(sig);} 59 34 60 void Ini_Ranf_Quick(long seed_val, int lp); 61 void Ini_Ranf(unsigned short seed_16v[3], int lp); 62 void Get_Ranf(unsigned short seed_16v[3], int lp); 63 void Auto_Ini_Ranf(int lp); 35 inline double Poisson(double mu, double mumax=-1) 36 {return RandomGeneratorInterface::GetGlobalRandGenP()->Poisson(mu,mumax);} 64 37 65 void SetGauRange(double range); 66 double NorRand1(void); 67 double GauRnd1(double am, double s); 68 double NorRand(void); 69 double GauRnd(double am, double s); 70 int NormCo(double *a,double *b 71 ,double mx,double my,double sx,double sy,double ro); 72 void NormGau(double *x,double *y 73 ,double mx,double my,double sa,double sb,double teta); 38 inline double Exponential() 39 {return RandomGeneratorInterface::GetGlobalRandGenP()->Exponential();} 74 40 75 int PoissRand(double mu); 76 unsigned long PoissRandLimit(double mu,double mumax /* =10. */ ); 41 inline int Gaussian2DRho(double &x,double &y,double mx,double my,double sx,double sy,double ro) 42 {return RandomGeneratorInterface::GetGlobalRandGenP()->Gaussian2DRho(x,y,mx,my,sx,sy,ro);} 43 inline void Gaussian2DAng(double &x,double &y,double mx,double my,double sa,double sb,double teta) 44 {return RandomGeneratorInterface::GetGlobalRandGenP()->Gaussian2DAng(x,y,mx,my,sa,sb,teta);} 77 45 78 TIREALEA *init_tirage_alea(int nbin,double xmin,double xmax,double (*fonc) (double)); 79 double tirage_alea(TIREALEA *alea); 80 int end_tirage_alea(TIREALEA *alea); 46 inline void AutoInitRand(int lp) 47 {return RandomGeneratorInterface::GetGlobalRandGenP()->AutoInit(lp);} 81 48 82 #ifdef __cplusplus 83 } 84 #endif 49 inline void ShowRandom() 50 {return RandomGeneratorInterface::GetGlobalRandGenP()->ShowRandom();} 51 52 } /* namespace SOPHYA */ 85 53 86 54 #endif 87 -
trunk/SophyaLib/BuildMgr/change_smake2make.csh
r3073 r3615 10 10 #--- Recherche des repertoires sous CVS 11 11 if( $#argv > 0 ) then 12 set dcvs = $112 set dcvs = ( $* ) 13 13 else 14 14 set dcvs = -
trunk/SophyaLib/HiStats/Makefile
r3572 r3615 34 34 $(SOPHYAINCP)ndatablock.h \ 35 35 $(SOPHYAINCP)utilarr.h \ 36 $(SOPHYAINCP)randinterf.h \ 36 37 $(SOPHYAINCP)tmatrix_tsnl.h \ 37 38 $(SOPHYAINCP)tvector_tsnl.h \ … … 63 64 $(SOPHYAINCP)ndatablock.h \ 64 65 $(SOPHYAINCP)utilarr.h \ 66 $(SOPHYAINCP)randinterf.h \ 65 67 $(SOPHYAINCP)tmatrix_tsnl.h \ 66 68 $(SOPHYAINCP)tvector_tsnl.h \ … … 97 99 $(SOPHYAINCP)ndatablock.h \ 98 100 $(SOPHYAINCP)utilarr.h \ 101 $(SOPHYAINCP)randinterf.h \ 99 102 $(SOPHYAINCP)tmatrix_tsnl.h \ 100 103 $(SOPHYAINCP)tvector_tsnl.h \ … … 132 135 $(SOPHYAINCP)ndatablock.h \ 133 136 $(SOPHYAINCP)utilarr.h \ 137 $(SOPHYAINCP)randinterf.h \ 134 138 $(SOPHYAINCP)tmatrix_tsnl.h \ 135 139 $(SOPHYAINCP)tvector_tsnl.h \ … … 159 163 $(SOPHYAINCP)ndatablock.h \ 160 164 $(SOPHYAINCP)utilarr.h \ 165 $(SOPHYAINCP)randinterf.h \ 161 166 $(SOPHYAINCP)tmatrix.h \ 162 167 $(SOPHYAINCP)tmatrix_tsnl.h \ … … 186 191 $(SOPHYAINCP)ndatablock.h \ 187 192 $(SOPHYAINCP)utilarr.h \ 193 $(SOPHYAINCP)randinterf.h \ 188 194 $(SOPHYAINCP)tmatrix.h \ 189 195 $(SOPHYAINCP)tmatrix_tsnl.h \ … … 222 228 $(SOPHYAINCP)ndatablock.h \ 223 229 $(SOPHYAINCP)utilarr.h \ 230 $(SOPHYAINCP)randinterf.h \ 224 231 $(SOPHYAINCP)tmatrix_tsnl.h \ 225 232 $(SOPHYAINCP)tvector_tsnl.h \ … … 262 269 $(SOPHYAINCP)ndatablock.h \ 263 270 $(SOPHYAINCP)utilarr.h \ 271 $(SOPHYAINCP)randinterf.h \ 264 272 $(SOPHYAINCP)tmatrix_tsnl.h \ 265 273 $(SOPHYAINCP)tvector_tsnl.h \ … … 298 306 $(SOPHYAINCP)ndatablock.h \ 299 307 $(SOPHYAINCP)utilarr.h \ 308 $(SOPHYAINCP)randinterf.h \ 300 309 $(SOPHYAINCP)tmatrix_tsnl.h \ 301 310 $(SOPHYAINCP)tvector_tsnl.h \ … … 371 380 $(SOPHYAINCP)ndatablock.h \ 372 381 $(SOPHYAINCP)utilarr.h \ 382 $(SOPHYAINCP)randinterf.h \ 373 383 $(SOPHYAINCP)tmatrix_tsnl.h \ 374 384 $(SOPHYAINCP)tvector_tsnl.h \ -
trunk/SophyaLib/HiStats/smakefile
r3572 r3615 34 34 $(SOPHYAINCP)ndatablock.h \ 35 35 $(SOPHYAINCP)utilarr.h \ 36 $(SOPHYAINCP)randinterf.h \ 36 37 $(SOPHYAINCP)tmatrix_tsnl.h \ 37 38 $(SOPHYAINCP)tvector_tsnl.h \ … … 63 64 $(SOPHYAINCP)ndatablock.h \ 64 65 $(SOPHYAINCP)utilarr.h \ 66 $(SOPHYAINCP)randinterf.h \ 65 67 $(SOPHYAINCP)tmatrix_tsnl.h \ 66 68 $(SOPHYAINCP)tvector_tsnl.h \ … … 97 99 $(SOPHYAINCP)ndatablock.h \ 98 100 $(SOPHYAINCP)utilarr.h \ 101 $(SOPHYAINCP)randinterf.h \ 99 102 $(SOPHYAINCP)tmatrix_tsnl.h \ 100 103 $(SOPHYAINCP)tvector_tsnl.h \ … … 132 135 $(SOPHYAINCP)ndatablock.h \ 133 136 $(SOPHYAINCP)utilarr.h \ 137 $(SOPHYAINCP)randinterf.h \ 134 138 $(SOPHYAINCP)tmatrix_tsnl.h \ 135 139 $(SOPHYAINCP)tvector_tsnl.h \ … … 159 163 $(SOPHYAINCP)ndatablock.h \ 160 164 $(SOPHYAINCP)utilarr.h \ 165 $(SOPHYAINCP)randinterf.h \ 161 166 $(SOPHYAINCP)tmatrix.h \ 162 167 $(SOPHYAINCP)tmatrix_tsnl.h \ … … 186 191 $(SOPHYAINCP)ndatablock.h \ 187 192 $(SOPHYAINCP)utilarr.h \ 193 $(SOPHYAINCP)randinterf.h \ 188 194 $(SOPHYAINCP)tmatrix.h \ 189 195 $(SOPHYAINCP)tmatrix_tsnl.h \ … … 222 228 $(SOPHYAINCP)ndatablock.h \ 223 229 $(SOPHYAINCP)utilarr.h \ 230 $(SOPHYAINCP)randinterf.h \ 224 231 $(SOPHYAINCP)tmatrix_tsnl.h \ 225 232 $(SOPHYAINCP)tvector_tsnl.h \ … … 262 269 $(SOPHYAINCP)ndatablock.h \ 263 270 $(SOPHYAINCP)utilarr.h \ 271 $(SOPHYAINCP)randinterf.h \ 264 272 $(SOPHYAINCP)tmatrix_tsnl.h \ 265 273 $(SOPHYAINCP)tvector_tsnl.h \ … … 298 306 $(SOPHYAINCP)ndatablock.h \ 299 307 $(SOPHYAINCP)utilarr.h \ 308 $(SOPHYAINCP)randinterf.h \ 300 309 $(SOPHYAINCP)tmatrix_tsnl.h \ 301 310 $(SOPHYAINCP)tvector_tsnl.h \ … … 371 380 $(SOPHYAINCP)ndatablock.h \ 372 381 $(SOPHYAINCP)utilarr.h \ 382 $(SOPHYAINCP)randinterf.h \ 373 383 $(SOPHYAINCP)tmatrix_tsnl.h \ 374 384 $(SOPHYAINCP)tvector_tsnl.h \ -
trunk/SophyaLib/Manual/Makefile
r3151 r3615 6 6 clean: 7 7 rm -rf *.o dox_filter 8 if [ -d /home/ manip/mnt/planck/cmv/SophyaWork/Linux/../Manual/ ] ; then cd /home/manip/mnt/planck/cmv/SophyaWork/Linux/../Manual// ; rm -rf html latex man rtf; fi8 if [ -d /home/local/SophyaWork/Linux/doc/ ] ; then cd /home/local/SophyaWork/Linux/doc// ; rm -rf html latex man rtf; fi 9 9 10 10 #------------------------------------------------------- 11 11 copy: 12 if [ ! -d /home/ manip/mnt/planck/cmv/SophyaWork/Linux/../Manual//latex ] ; then mkdir /home/manip/mnt/planck/cmv/SophyaWork/Linux/../Manual//latex; fi13 cp -p *.tex *.sty *.eps *.inc /home/ manip/mnt/planck/cmv/SophyaWork/Linux/../Manual//latex/.12 if [ ! -d /home/local/SophyaWork/Linux/doc//latex ] ; then mkdir /home/local/SophyaWork/Linux/doc//latex; fi 13 cp -p *.tex *.sty *.eps *.inc /home/local/SophyaWork/Linux/doc//latex/. 14 14 15 15 #------------------------------------------------------- … … 25 25 26 26 #------------------------------------------------------- 27 sophya: copy /home/ manip/mnt/planck/cmv/SophyaWork/Linux/../Manual//latex/sophya.ps27 sophya: copy /home/local/SophyaWork/Linux/doc//latex/sophya.ps 28 28 29 /home/ manip/mnt/planck/cmv/SophyaWork/Linux/../Manual//latex/sophya.ps: sophya.tex defsophya.sty blue_sophya_400.eps ex1.inc30 cd /home/ manip/mnt/planck/cmv/SophyaWork/Linux/../Manual//latex/; \29 /home/local/SophyaWork/Linux/doc//latex/sophya.ps: sophya.tex defsophya.sty blue_sophya_400.eps ex1.inc 30 cd /home/local/SophyaWork/Linux/doc//latex/; \ 31 31 latex sophya.tex; \ 32 32 makeindex sophya; \ … … 34 34 dvips -o sophya.ps sophya.dvi 35 35 36 piapp: copy /home/ manip/mnt/planck/cmv/SophyaWork/Linux/../Manual//latex/piapp.ps36 piapp: copy /home/local/SophyaWork/Linux/doc//latex/piapp.ps 37 37 38 /home/ manip/mnt/planck/cmv/SophyaWork/Linux/../Manual//latex/piapp.ps: piapp.tex piahelp.tex defsophya.sty39 cd /home/ manip/mnt/planck/cmv/SophyaWork/Linux/../Manual//latex/; \38 /home/local/SophyaWork/Linux/doc//latex/piapp.ps: piapp.tex piahelp.tex defsophya.sty 39 cd /home/local/SophyaWork/Linux/doc//latex/; \ 40 40 latex piapp.tex; \ 41 41 makeindex piapp; \ … … 43 43 dvips -o piapp.ps piapp.dvi 44 44 45 pmixer: copy /home/ manip/mnt/planck/cmv/SophyaWork/Linux/../Manual//latex/pmixer.ps45 pmixer: copy /home/local/SophyaWork/Linux/doc//latex/pmixer.ps 46 46 47 /home/ manip/mnt/planck/cmv/SophyaWork/Linux/../Manual//latex/pmixer.ps: pmixer.tex48 cd /home/ manip/mnt/planck/cmv/SophyaWork/Linux/../Manual//latex/; \47 /home/local/SophyaWork/Linux/doc//latex/pmixer.ps: pmixer.tex 48 cd /home/local/SophyaWork/Linux/doc//latex/; \ 49 49 latex pmixer.tex; \ 50 50 latex pmixer; \ -
trunk/SophyaLib/Manual/piahelp.tex
r3490 r3615 328 328 \begin{verbatim} 329 329 > Automatic random number generator initialisation 330 by Auto _Ini_Ranf(int lp)330 by AutoInitRand(int lp) 331 331 Usage: autoiniranf 332 332 \end{verbatim} -
trunk/SophyaLib/NTools/Makefile
r3608 r3615 33 33 $(SOPHYAINCP)ndatablock.h \ 34 34 $(SOPHYAINCP)utilarr.h \ 35 $(SOPHYAINCP)randinterf.h \ 35 36 $(SOPHYAINCP)tmatrix.h \ 36 37 $(SOPHYAINCP)tmatrix_tsnl.h \ … … 67 68 $(SOPHYAINCP)ndatablock.h \ 68 69 $(SOPHYAINCP)utilarr.h \ 70 $(SOPHYAINCP)randinterf.h \ 69 71 $(SOPHYAINCP)tmatrix_tsnl.h \ 70 72 $(SOPHYAINCP)fioarr.h \ … … 114 116 $(SOPHYAINCP)ndatablock.h \ 115 117 $(SOPHYAINCP)utilarr.h \ 118 $(SOPHYAINCP)randinterf.h \ 116 119 $(SOPHYAINCP)tmatrix_tsnl.h \ 117 120 $(SOPHYAINCP)tvector_tsnl.h \ … … 120 123 121 124 $(SOPHYAOBJP)dynccd.o: dynccd.cc $(SOPHYAINCP)sopnamsp.h \ 122 $(SOPHYAINCP)machdefs.h fmath.h perandom.h \ 123 $(SOPHYAINCP)tvector.h \ 124 $(SOPHYAINCP)tmatrix.h \ 125 $(SOPHYAINCP)machdefs.h \ 126 $(SOPHYAINCP)tarray.h \ 127 $(SOPHYAINCP)basarr.h \ 128 $(SOPHYAINCP)anydataobj.h \ 125 $(SOPHYAINCP)machdefs.h fmath.h \ 126 $(SOPHYAINCP)srandgen.h \ 127 $(SOPHYAINCP)machdefs.h \ 128 $(SOPHYAINCP)randinterf.h \ 129 $(SOPHYAINCP)anydataobj.h perandom.h \ 130 $(SOPHYAINCP)tvector.h \ 131 $(SOPHYAINCP)tmatrix.h \ 132 $(SOPHYAINCP)tarray.h \ 133 $(SOPHYAINCP)basarr.h \ 129 134 $(SOPHYAINCP)mutyv.h \ 130 135 $(SOPHYAINCP)timestamp.h \ … … 146 151 $(SOPHYAINCP)perrors.h \ 147 152 $(SOPHYAINCP)fmath.h \ 148 $(SOPHYAINCP)tvector.h \ 149 $(SOPHYAINCP)srandgen.h classfunc.h cimage.h \ 153 $(SOPHYAINCP)tvector.h classfunc.h cimage.h \ 150 154 $(SOPHYAINCP)tmatrix.h \ 151 155 $(SOPHYAINCP)fioarr.h dynccd.h \ … … 175 179 $(SOPHYAINCP)ndatablock.h \ 176 180 $(SOPHYAINCP)utilarr.h \ 181 $(SOPHYAINCP)randinterf.h \ 177 182 $(SOPHYAINCP)tmatrix_tsnl.h \ 178 183 $(SOPHYAINCP)tvector_tsnl.h generaldata.h \ … … 207 212 $(SOPHYAINCP)ndatablock.h \ 208 213 $(SOPHYAINCP)utilarr.h \ 214 $(SOPHYAINCP)randinterf.h \ 209 215 $(SOPHYAINCP)tmatrix_tsnl.h \ 210 216 $(SOPHYAINCP)tvector_tsnl.h generaldata.h \ … … 239 245 $(SOPHYAINCP)ndatablock.h \ 240 246 $(SOPHYAINCP)utilarr.h \ 247 $(SOPHYAINCP)randinterf.h \ 241 248 $(SOPHYAINCP)tmatrix_tsnl.h \ 242 249 $(SOPHYAINCP)tvector.h \ … … 266 273 $(SOPHYAINCP)ndatablock.h \ 267 274 $(SOPHYAINCP)utilarr.h \ 275 $(SOPHYAINCP)randinterf.h \ 268 276 $(SOPHYAINCP)tmatrix_tsnl.h \ 269 277 $(SOPHYAINCP)tvector.h \ … … 292 300 $(SOPHYAINCP)ndatablock.h \ 293 301 $(SOPHYAINCP)utilarr.h \ 302 $(SOPHYAINCP)randinterf.h \ 294 303 $(SOPHYAINCP)tmatrix_tsnl.h \ 295 304 $(SOPHYAINCP)tvector.h \ … … 319 328 $(SOPHYAINCP)ndatablock.h \ 320 329 $(SOPHYAINCP)utilarr.h \ 330 $(SOPHYAINCP)randinterf.h \ 321 331 $(SOPHYAINCP)tmatrix_tsnl.h \ 322 332 $(SOPHYAINCP)tvector_tsnl.h \ … … 346 356 $(SOPHYAINCP)ndatablock.h \ 347 357 $(SOPHYAINCP)utilarr.h \ 358 $(SOPHYAINCP)randinterf.h \ 348 359 $(SOPHYAINCP)tmatrix_tsnl.h \ 349 360 $(SOPHYAINCP)tvector_tsnl.h generaldata.h \ … … 378 389 $(SOPHYAINCP)ndatablock.h \ 379 390 $(SOPHYAINCP)utilarr.h \ 391 $(SOPHYAINCP)randinterf.h \ 380 392 $(SOPHYAINCP)tmatrix_tsnl.h \ 381 393 $(SOPHYAINCP)tvector_tsnl.h generaldata.h \ … … 418 430 $(SOPHYAINCP)ndatablock.h \ 419 431 $(SOPHYAINCP)utilarr.h \ 432 $(SOPHYAINCP)randinterf.h \ 420 433 $(SOPHYAINCP)tmatrix_tsnl.h \ 421 434 $(SOPHYAINCP)tvector_tsnl.h generaldata.h \ … … 458 471 $(SOPHYAINCP)ndatablock.h \ 459 472 $(SOPHYAINCP)utilarr.h \ 473 $(SOPHYAINCP)randinterf.h \ 460 474 $(SOPHYAINCP)tmatrix_tsnl.h \ 461 475 $(SOPHYAINCP)tvector_tsnl.h \ … … 488 502 $(SOPHYAINCP)ndatablock.h \ 489 503 $(SOPHYAINCP)utilarr.h \ 504 $(SOPHYAINCP)randinterf.h \ 490 505 $(SOPHYAINCP)tmatrix_tsnl.h cimage.h \ 491 506 $(SOPHYAINCP)fioarr.h \ … … 512 527 $(SOPHYAINCP)machdefs.h \ 513 528 $(SOPHYAINCP)pexceptions.h \ 514 $(SOPHYAINCP)machdefs.h perandom.h \ 515 $(SOPHYAINCP)tvector.h \ 516 $(SOPHYAINCP)tmatrix.h \ 517 $(SOPHYAINCP)tarray.h \ 518 $(SOPHYAINCP)basarr.h \ 519 $(SOPHYAINCP)anydataobj.h \ 529 $(SOPHYAINCP)machdefs.h \ 530 $(SOPHYAINCP)srandgen.h \ 531 $(SOPHYAINCP)randinterf.h \ 532 $(SOPHYAINCP)anydataobj.h perandom.h \ 533 $(SOPHYAINCP)tvector.h \ 534 $(SOPHYAINCP)tmatrix.h \ 535 $(SOPHYAINCP)tarray.h \ 536 $(SOPHYAINCP)basarr.h \ 520 537 $(SOPHYAINCP)mutyv.h \ 521 538 $(SOPHYAINCP)timestamp.h \ … … 537 554 $(SOPHYAINCP)perrors.h \ 538 555 $(SOPHYAINCP)fmath.h \ 539 $(SOPHYAINCP)tvector.h \ 540 $(SOPHYAINCP)srandgen.h classfunc.h pemath.h 556 $(SOPHYAINCP)tvector.h classfunc.h 541 557 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ perandom.cc 542 558 … … 564 580 $(SOPHYAINCP)ndatablock.h \ 565 581 $(SOPHYAINCP)utilarr.h \ 582 $(SOPHYAINCP)randinterf.h \ 566 583 $(SOPHYAINCP)tmatrix_tsnl.h \ 567 584 $(SOPHYAINCP)tvector_tsnl.h \ … … 594 611 $(SOPHYAINCP)ndatablock.h \ 595 612 $(SOPHYAINCP)utilarr.h \ 613 $(SOPHYAINCP)randinterf.h \ 596 614 $(SOPHYAINCP)tmatrix_tsnl.h \ 597 615 $(SOPHYAINCP)tvector_tsnl.h \ … … 629 647 $(SOPHYAINCP)ndatablock.h \ 630 648 $(SOPHYAINCP)utilarr.h \ 649 $(SOPHYAINCP)randinterf.h \ 631 650 $(SOPHYAINCP)tmatrix_tsnl.h \ 632 651 $(SOPHYAINCP)tvector_tsnl.h generalfit.h \ … … 680 699 $(SOPHYAINCP)ndatablock.h \ 681 700 $(SOPHYAINCP)utilarr.h \ 701 $(SOPHYAINCP)randinterf.h \ 682 702 $(SOPHYAINCP)tmatrix.h \ 683 703 $(SOPHYAINCP)tmatrix_tsnl.h \ -
trunk/SophyaLib/NTools/dynccd.cc
r2882 r3615 5 5 6 6 #include "fmath.h" 7 #include "srandgen.h" 7 8 #include "perandom.h" 8 9 -
trunk/SophyaLib/NTools/perandom.cc
r3608 r3615 1 1 #include "sopnamsp.h" 2 2 #include "machdefs.h" 3 #include <iostream> 3 4 #include "pexceptions.h" 5 #include "srandgen.h" 4 6 #include "perandom.h" 5 #include "pemath.h"6 #include <iostream>7 7 8 8 … … 290 290 } 291 291 292 293 294 /////////////////////////////////////////////////////////////////295 /*296 **** Remarques sur complex< r_8 > ComplexGaussRan(double sig) ****297 298 --- variables gaussiennes x,y independantes299 x gaussien: pdf f(x) = 1/(sqrt(2Pi) Sx) exp(-(x-Mx)^2/(2 Sx^2))300 y gaussien: pdf f(y) = 1/(sqrt(2Pi) Sy) exp(-(y-My)^2/(2 Sy^2))301 x,y independants --> pdf f(x,y) = f(x) f(y)302 On a:303 <x> = Integrate[x*f(x)] = Mx304 <x^2> = Integrate[x^2*f(x)] = Mx^2 + Sx^2305 306 --- On cherche la pdf g(r,t) du module et de la phase307 x = r cos(t) , y = r sin(t)308 r=sqrt(x^2+y^2 , t=atan2(y,x)309 (r,t) --> (x,y): le Jacobien = r310 311 g(r,t) = r f(x,y) = r f(x) f(y)312 = r/(2Pi Sx Sy) exp(-(x-Mx)^2/(2 Sx^2)) exp(-(y-My)^2/(2 Sy^2))313 314 - Le cas general est complique315 (cf D.Pelat cours DEA "bruits et signaux" section 4.5)316 317 - Cas ou "Mx = My = 0" et "Sx = Sy = S"318 c'est la pdf du module et de la phase d'un nombre complexe319 dont les parties reelles et imaginaires sont independantes320 et sont distribuees selon des gaussiennes de variance S^2321 g(r,t) = r/(2Pi S^2) exp(-r^2/(2 S^2))322 La distribution de "r" est donc:323 g(r) = Integrate[g(r,t),{t,0,2Pi}]324 = r/S^2 exp(-r^2/(2 S^2))325 La distribution de "t" est donc:326 g(t) = Integrate[g(r,t),{r,0,Infinity}]327 = 1 / 2Pi (distribution uniforme sur [0,2Pi[)328 Les variables aleatoires r,t sont independantes:329 g(r,t) = g(r) g(t)330 On a:331 <r> = Integrate[r*g(r)] = sqrt(PI/2)*S332 <r^2> = Integrate[r^2*g(r)] = 2*S^2333 <r^3> = Integrate[r^3*g(r)] = 3*sqrt(PI/2)*S^3334 <r^4> = Integrate[r^4*g(r)] = 8*S^4335 336 - Attention:337 La variable complexe "c = x+iy = r*exp(i*t)" ainsi definie verifie:338 <|c|^2> = <c c*> = <x^2+y^2> = <r^2> = 2 S^2339 Si on veut generer une variable complexe gaussienne telle que340 <c c*> = s^2 alors il faut prendre S = s/sqrt(2) comme argument341 342 */ -
trunk/SophyaLib/NTools/perandom.h
r3608 r3615 12 12 #include "tvector.h" 13 13 #include "histos.h" 14 #include "srandgen.h"15 14 #include "classfunc.h" 16 #include <complex>17 15 18 16 namespace SOPHYA { … … 54 52 }; 55 53 56 57 /*!58 \ingroup NTools59 \brief Returns a random complex number such that real and imaginary parts are gaussians with variance sig^260 */61 inline complex< r_8 > ComplexGaussRan(void)62 {return complex< r_8 >(NorRand(),NorRand());}63 inline complex< r_8 > ComplexGaussRan(double sig)64 {return complex< r_8 >(GauRnd(0.,sig),GauRnd(0.,sig));}65 66 /*!67 \ingroup NTools68 \brief Returns the module of a random complex number generated by ComplexGaussRan69 */70 inline double ModComplexGaussRan(double sig=1.)71 {double r=-log(1.-drand01()); return sig*sqrt(2.*r);}72 73 54 } // namespace SOPHYA 74 55 -
trunk/SophyaLib/NTools/smakefile
r3608 r3615 33 33 $(SOPHYAINCP)ndatablock.h \ 34 34 $(SOPHYAINCP)utilarr.h \ 35 $(SOPHYAINCP)randinterf.h \ 35 36 $(SOPHYAINCP)tmatrix.h \ 36 37 $(SOPHYAINCP)tmatrix_tsnl.h \ … … 67 68 $(SOPHYAINCP)ndatablock.h \ 68 69 $(SOPHYAINCP)utilarr.h \ 70 $(SOPHYAINCP)randinterf.h \ 69 71 $(SOPHYAINCP)tmatrix_tsnl.h \ 70 72 $(SOPHYAINCP)fioarr.h \ … … 114 116 $(SOPHYAINCP)ndatablock.h \ 115 117 $(SOPHYAINCP)utilarr.h \ 118 $(SOPHYAINCP)randinterf.h \ 116 119 $(SOPHYAINCP)tmatrix_tsnl.h \ 117 120 $(SOPHYAINCP)tvector_tsnl.h \ … … 120 123 121 124 $(SOPHYAOBJP)dynccd.o: dynccd.cc $(SOPHYAINCP)sopnamsp.h \ 122 $(SOPHYAINCP)machdefs.h fmath.h perandom.h \ 123 $(SOPHYAINCP)tvector.h \ 124 $(SOPHYAINCP)tmatrix.h \ 125 $(SOPHYAINCP)machdefs.h \ 126 $(SOPHYAINCP)tarray.h \ 127 $(SOPHYAINCP)basarr.h \ 128 $(SOPHYAINCP)anydataobj.h \ 125 $(SOPHYAINCP)machdefs.h fmath.h \ 126 $(SOPHYAINCP)srandgen.h \ 127 $(SOPHYAINCP)machdefs.h \ 128 $(SOPHYAINCP)randinterf.h \ 129 $(SOPHYAINCP)anydataobj.h perandom.h \ 130 $(SOPHYAINCP)tvector.h \ 131 $(SOPHYAINCP)tmatrix.h \ 132 $(SOPHYAINCP)tarray.h \ 133 $(SOPHYAINCP)basarr.h \ 129 134 $(SOPHYAINCP)mutyv.h \ 130 135 $(SOPHYAINCP)timestamp.h \ … … 146 151 $(SOPHYAINCP)perrors.h \ 147 152 $(SOPHYAINCP)fmath.h \ 148 $(SOPHYAINCP)tvector.h \ 149 $(SOPHYAINCP)srandgen.h classfunc.h cimage.h \ 153 $(SOPHYAINCP)tvector.h classfunc.h cimage.h \ 150 154 $(SOPHYAINCP)tmatrix.h \ 151 155 $(SOPHYAINCP)fioarr.h dynccd.h \ … … 175 179 $(SOPHYAINCP)ndatablock.h \ 176 180 $(SOPHYAINCP)utilarr.h \ 181 $(SOPHYAINCP)randinterf.h \ 177 182 $(SOPHYAINCP)tmatrix_tsnl.h \ 178 183 $(SOPHYAINCP)tvector_tsnl.h generaldata.h \ … … 207 212 $(SOPHYAINCP)ndatablock.h \ 208 213 $(SOPHYAINCP)utilarr.h \ 214 $(SOPHYAINCP)randinterf.h \ 209 215 $(SOPHYAINCP)tmatrix_tsnl.h \ 210 216 $(SOPHYAINCP)tvector_tsnl.h generaldata.h \ … … 239 245 $(SOPHYAINCP)ndatablock.h \ 240 246 $(SOPHYAINCP)utilarr.h \ 247 $(SOPHYAINCP)randinterf.h \ 241 248 $(SOPHYAINCP)tmatrix_tsnl.h \ 242 249 $(SOPHYAINCP)tvector.h \ … … 266 273 $(SOPHYAINCP)ndatablock.h \ 267 274 $(SOPHYAINCP)utilarr.h \ 275 $(SOPHYAINCP)randinterf.h \ 268 276 $(SOPHYAINCP)tmatrix_tsnl.h \ 269 277 $(SOPHYAINCP)tvector.h \ … … 292 300 $(SOPHYAINCP)ndatablock.h \ 293 301 $(SOPHYAINCP)utilarr.h \ 302 $(SOPHYAINCP)randinterf.h \ 294 303 $(SOPHYAINCP)tmatrix_tsnl.h \ 295 304 $(SOPHYAINCP)tvector.h \ … … 319 328 $(SOPHYAINCP)ndatablock.h \ 320 329 $(SOPHYAINCP)utilarr.h \ 330 $(SOPHYAINCP)randinterf.h \ 321 331 $(SOPHYAINCP)tmatrix_tsnl.h \ 322 332 $(SOPHYAINCP)tvector_tsnl.h \ … … 346 356 $(SOPHYAINCP)ndatablock.h \ 347 357 $(SOPHYAINCP)utilarr.h \ 358 $(SOPHYAINCP)randinterf.h \ 348 359 $(SOPHYAINCP)tmatrix_tsnl.h \ 349 360 $(SOPHYAINCP)tvector_tsnl.h generaldata.h \ … … 378 389 $(SOPHYAINCP)ndatablock.h \ 379 390 $(SOPHYAINCP)utilarr.h \ 391 $(SOPHYAINCP)randinterf.h \ 380 392 $(SOPHYAINCP)tmatrix_tsnl.h \ 381 393 $(SOPHYAINCP)tvector_tsnl.h generaldata.h \ … … 418 430 $(SOPHYAINCP)ndatablock.h \ 419 431 $(SOPHYAINCP)utilarr.h \ 432 $(SOPHYAINCP)randinterf.h \ 420 433 $(SOPHYAINCP)tmatrix_tsnl.h \ 421 434 $(SOPHYAINCP)tvector_tsnl.h generaldata.h \ … … 458 471 $(SOPHYAINCP)ndatablock.h \ 459 472 $(SOPHYAINCP)utilarr.h \ 473 $(SOPHYAINCP)randinterf.h \ 460 474 $(SOPHYAINCP)tmatrix_tsnl.h \ 461 475 $(SOPHYAINCP)tvector_tsnl.h \ … … 488 502 $(SOPHYAINCP)ndatablock.h \ 489 503 $(SOPHYAINCP)utilarr.h \ 504 $(SOPHYAINCP)randinterf.h \ 490 505 $(SOPHYAINCP)tmatrix_tsnl.h cimage.h \ 491 506 $(SOPHYAINCP)fioarr.h \ … … 512 527 $(SOPHYAINCP)machdefs.h \ 513 528 $(SOPHYAINCP)pexceptions.h \ 514 $(SOPHYAINCP)machdefs.h perandom.h \ 515 $(SOPHYAINCP)tvector.h \ 516 $(SOPHYAINCP)tmatrix.h \ 517 $(SOPHYAINCP)tarray.h \ 518 $(SOPHYAINCP)basarr.h \ 519 $(SOPHYAINCP)anydataobj.h \ 529 $(SOPHYAINCP)machdefs.h \ 530 $(SOPHYAINCP)srandgen.h \ 531 $(SOPHYAINCP)randinterf.h \ 532 $(SOPHYAINCP)anydataobj.h perandom.h \ 533 $(SOPHYAINCP)tvector.h \ 534 $(SOPHYAINCP)tmatrix.h \ 535 $(SOPHYAINCP)tarray.h \ 536 $(SOPHYAINCP)basarr.h \ 520 537 $(SOPHYAINCP)mutyv.h \ 521 538 $(SOPHYAINCP)timestamp.h \ … … 537 554 $(SOPHYAINCP)perrors.h \ 538 555 $(SOPHYAINCP)fmath.h \ 539 $(SOPHYAINCP)tvector.h \ 540 $(SOPHYAINCP)srandgen.h classfunc.h pemath.h 556 $(SOPHYAINCP)tvector.h classfunc.h 541 557 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ perandom.cc 542 558 … … 564 580 $(SOPHYAINCP)ndatablock.h \ 565 581 $(SOPHYAINCP)utilarr.h \ 582 $(SOPHYAINCP)randinterf.h \ 566 583 $(SOPHYAINCP)tmatrix_tsnl.h \ 567 584 $(SOPHYAINCP)tvector_tsnl.h \ … … 594 611 $(SOPHYAINCP)ndatablock.h \ 595 612 $(SOPHYAINCP)utilarr.h \ 613 $(SOPHYAINCP)randinterf.h \ 596 614 $(SOPHYAINCP)tmatrix_tsnl.h \ 597 615 $(SOPHYAINCP)tvector_tsnl.h \ … … 629 647 $(SOPHYAINCP)ndatablock.h \ 630 648 $(SOPHYAINCP)utilarr.h \ 649 $(SOPHYAINCP)randinterf.h \ 631 650 $(SOPHYAINCP)tmatrix_tsnl.h \ 632 651 $(SOPHYAINCP)tvector_tsnl.h generalfit.h \ … … 680 699 $(SOPHYAINCP)ndatablock.h \ 681 700 $(SOPHYAINCP)utilarr.h \ 701 $(SOPHYAINCP)randinterf.h \ 682 702 $(SOPHYAINCP)tmatrix.h \ 683 703 $(SOPHYAINCP)tmatrix_tsnl.h \ -
trunk/SophyaLib/Samba/Makefile
r3572 r3615 12 12 13 13 $(SOPHYAOBJP)alm.o: alm.cc $(SOPHYAINCP)sopnamsp.h alm.h \ 14 $(SOPHYAINCP)stsrand.h \ 15 $(SOPHYAINCP)machdefs.h \ 16 $(SOPHYAINCP)objfio.h \ 17 $(SOPHYAINCP)anydataobj.h \ 18 $(SOPHYAINCP)ppersist.h \ 19 $(SOPHYAINCP)pexceptions.h \ 20 $(SOPHYAINCP)gnumd5.h \ 21 $(SOPHYAINCP)ppfbinstream.h \ 22 $(SOPHYAINCP)rawstream.h \ 23 $(SOPHYAINCP)ppfnametag.h \ 24 $(SOPHYAINCP)ndatablock.h \ 14 $(SOPHYAINCP)randinterf.h \ 15 $(SOPHYAINCP)machdefs.h \ 16 $(SOPHYAINCP)anydataobj.h \ 25 17 $(SOPHYAINCP)nbmath.h \ 26 18 $(SOPHYAINCP)smathconst.h \ 27 19 $(SOPHYAINCP)triangmtx.h \ 28 $(SOPHYAINCP)tvector.h \ 29 $(SOPHYAINCP)tmatrix.h \ 30 $(SOPHYAINCP)tarray.h \ 31 $(SOPHYAINCP)basarr.h \ 32 $(SOPHYAINCP)mutyv.h \ 33 $(SOPHYAINCP)timestamp.h \ 34 $(SOPHYAINCP)dvlist.h \ 35 $(SOPHYAINCP)utilarr.h \ 20 $(SOPHYAINCP)ndatablock.h \ 21 $(SOPHYAINCP)pexceptions.h \ 22 $(SOPHYAINCP)tvector.h \ 23 $(SOPHYAINCP)tmatrix.h \ 24 $(SOPHYAINCP)tarray.h \ 25 $(SOPHYAINCP)basarr.h \ 26 $(SOPHYAINCP)mutyv.h \ 27 $(SOPHYAINCP)timestamp.h \ 28 $(SOPHYAINCP)objfio.h \ 29 $(SOPHYAINCP)ppersist.h \ 30 $(SOPHYAINCP)gnumd5.h \ 31 $(SOPHYAINCP)ppfbinstream.h \ 32 $(SOPHYAINCP)rawstream.h \ 33 $(SOPHYAINCP)ppfnametag.h \ 34 $(SOPHYAINCP)dvlist.h \ 35 $(SOPHYAINCP)utilarr.h \ 36 $(SOPHYAINCP)randinterf.h \ 36 37 $(SOPHYAINCP)tmatrix_tsnl.h \ 37 38 $(SOPHYAINCP)tvector_tsnl.h … … 41 42 $(SOPHYAINCP)fmath.h bruit.h \ 42 43 $(SOPHYAINCP)srandgen.h \ 43 $(SOPHYAINCP)machdefs.h 44 $(SOPHYAINCP)machdefs.h \ 45 $(SOPHYAINCP)randinterf.h \ 46 $(SOPHYAINCP)anydataobj.h 44 47 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ bruit.cc 45 48 … … 91 94 $(SOPHYAINCP)ndatablock.h \ 92 95 $(SOPHYAINCP)utilarr.h \ 96 $(SOPHYAINCP)randinterf.h \ 93 97 $(SOPHYAINCP)tmatrix_tsnl.h \ 94 98 $(SOPHYAINCP)tvector_tsnl.h alm.h \ 95 $(SOPHYAINCP) stsrand.h \99 $(SOPHYAINCP)randinterf.h \ 96 100 $(SOPHYAINCP)nbmath.h \ 97 101 $(SOPHYAINCP)smathconst.h \ … … 129 133 $(SOPHYAINCP)ndatablock.h \ 130 134 $(SOPHYAINCP)utilarr.h \ 135 $(SOPHYAINCP)randinterf.h \ 131 136 $(SOPHYAINCP)tmatrix_tsnl.h \ 132 137 $(SOPHYAINCP)tvector_tsnl.h \ … … 195 200 $(SOPHYAINCP)ndatablock.h \ 196 201 $(SOPHYAINCP)utilarr.h \ 202 $(SOPHYAINCP)randinterf.h \ 197 203 $(SOPHYAINCP)tmatrix_tsnl.h \ 198 204 $(SOPHYAINCP)tvector_tsnl.h \ … … 200 206 $(SOPHYAINCP)fftpserver.h \ 201 207 $(SOPHYAINCP)fftservintf.h \ 202 $(SOPHYAINCP) stsrand.h alm.h \208 $(SOPHYAINCP)randinterf.h alm.h \ 203 209 $(SOPHYAINCP)nbmath.h \ 204 210 $(SOPHYAINCP)triangmtx.h \ -
trunk/SophyaLib/Samba/smakefile
r3572 r3615 12 12 13 13 $(SOPHYAOBJP)alm.o: alm.cc $(SOPHYAINCP)sopnamsp.h alm.h \ 14 $(SOPHYAINCP)stsrand.h \ 15 $(SOPHYAINCP)machdefs.h \ 16 $(SOPHYAINCP)objfio.h \ 17 $(SOPHYAINCP)anydataobj.h \ 18 $(SOPHYAINCP)ppersist.h \ 19 $(SOPHYAINCP)pexceptions.h \ 20 $(SOPHYAINCP)gnumd5.h \ 21 $(SOPHYAINCP)ppfbinstream.h \ 22 $(SOPHYAINCP)rawstream.h \ 23 $(SOPHYAINCP)ppfnametag.h \ 24 $(SOPHYAINCP)ndatablock.h \ 14 $(SOPHYAINCP)randinterf.h \ 15 $(SOPHYAINCP)machdefs.h \ 16 $(SOPHYAINCP)anydataobj.h \ 25 17 $(SOPHYAINCP)nbmath.h \ 26 18 $(SOPHYAINCP)smathconst.h \ 27 19 $(SOPHYAINCP)triangmtx.h \ 28 $(SOPHYAINCP)tvector.h \ 29 $(SOPHYAINCP)tmatrix.h \ 30 $(SOPHYAINCP)tarray.h \ 31 $(SOPHYAINCP)basarr.h \ 32 $(SOPHYAINCP)mutyv.h \ 33 $(SOPHYAINCP)timestamp.h \ 34 $(SOPHYAINCP)dvlist.h \ 35 $(SOPHYAINCP)utilarr.h \ 20 $(SOPHYAINCP)ndatablock.h \ 21 $(SOPHYAINCP)pexceptions.h \ 22 $(SOPHYAINCP)tvector.h \ 23 $(SOPHYAINCP)tmatrix.h \ 24 $(SOPHYAINCP)tarray.h \ 25 $(SOPHYAINCP)basarr.h \ 26 $(SOPHYAINCP)mutyv.h \ 27 $(SOPHYAINCP)timestamp.h \ 28 $(SOPHYAINCP)objfio.h \ 29 $(SOPHYAINCP)ppersist.h \ 30 $(SOPHYAINCP)gnumd5.h \ 31 $(SOPHYAINCP)ppfbinstream.h \ 32 $(SOPHYAINCP)rawstream.h \ 33 $(SOPHYAINCP)ppfnametag.h \ 34 $(SOPHYAINCP)dvlist.h \ 35 $(SOPHYAINCP)utilarr.h \ 36 $(SOPHYAINCP)randinterf.h \ 36 37 $(SOPHYAINCP)tmatrix_tsnl.h \ 37 38 $(SOPHYAINCP)tvector_tsnl.h … … 41 42 $(SOPHYAINCP)fmath.h bruit.h \ 42 43 $(SOPHYAINCP)srandgen.h \ 43 $(SOPHYAINCP)machdefs.h 44 $(SOPHYAINCP)machdefs.h \ 45 $(SOPHYAINCP)randinterf.h \ 46 $(SOPHYAINCP)anydataobj.h 44 47 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ bruit.cc 45 48 … … 91 94 $(SOPHYAINCP)ndatablock.h \ 92 95 $(SOPHYAINCP)utilarr.h \ 96 $(SOPHYAINCP)randinterf.h \ 93 97 $(SOPHYAINCP)tmatrix_tsnl.h \ 94 98 $(SOPHYAINCP)tvector_tsnl.h alm.h \ 95 $(SOPHYAINCP) stsrand.h \99 $(SOPHYAINCP)randinterf.h \ 96 100 $(SOPHYAINCP)nbmath.h \ 97 101 $(SOPHYAINCP)smathconst.h \ … … 129 133 $(SOPHYAINCP)ndatablock.h \ 130 134 $(SOPHYAINCP)utilarr.h \ 135 $(SOPHYAINCP)randinterf.h \ 131 136 $(SOPHYAINCP)tmatrix_tsnl.h \ 132 137 $(SOPHYAINCP)tvector_tsnl.h \ … … 195 200 $(SOPHYAINCP)ndatablock.h \ 196 201 $(SOPHYAINCP)utilarr.h \ 202 $(SOPHYAINCP)randinterf.h \ 197 203 $(SOPHYAINCP)tmatrix_tsnl.h \ 198 204 $(SOPHYAINCP)tvector_tsnl.h \ … … 200 206 $(SOPHYAINCP)fftpserver.h \ 201 207 $(SOPHYAINCP)fftservintf.h \ 202 $(SOPHYAINCP) stsrand.h alm.h \208 $(SOPHYAINCP)randinterf.h alm.h \ 203 209 $(SOPHYAINCP)nbmath.h \ 204 210 $(SOPHYAINCP)triangmtx.h \ -
trunk/SophyaLib/SkyMap/Makefile
r3405 r3615 33 33 $(SOPHYAINCP)ndatablock.h \ 34 34 $(SOPHYAINCP)utilarr.h \ 35 $(SOPHYAINCP)randinterf.h \ 35 36 $(SOPHYAINCP)tmatrix_tsnl.h \ 36 37 $(SOPHYAINCP)tvector_tsnl.h \ … … 64 65 $(SOPHYAINCP)ndatablock.h \ 65 66 $(SOPHYAINCP)utilarr.h \ 67 $(SOPHYAINCP)randinterf.h \ 66 68 $(SOPHYAINCP)tmatrix_tsnl.h \ 67 69 $(SOPHYAINCP)tvector_tsnl.h localmap.h \ … … 100 102 $(SOPHYAINCP)ndatablock.h \ 101 103 $(SOPHYAINCP)utilarr.h \ 104 $(SOPHYAINCP)randinterf.h \ 102 105 $(SOPHYAINCP)tmatrix_tsnl.h \ 103 106 $(SOPHYAINCP)tvector_tsnl.h \ … … 134 137 $(SOPHYAINCP)ndatablock.h \ 135 138 $(SOPHYAINCP)utilarr.h \ 139 $(SOPHYAINCP)randinterf.h \ 136 140 $(SOPHYAINCP)tmatrix_tsnl.h \ 137 141 $(SOPHYAINCP)tvector_tsnl.h \ … … 167 171 $(SOPHYAINCP)ndatablock.h \ 168 172 $(SOPHYAINCP)utilarr.h \ 173 $(SOPHYAINCP)randinterf.h \ 169 174 $(SOPHYAINCP)tmatrix_tsnl.h \ 170 175 $(SOPHYAINCP)tvector_tsnl.h \ … … 199 204 $(SOPHYAINCP)ndatablock.h \ 200 205 $(SOPHYAINCP)utilarr.h \ 206 $(SOPHYAINCP)randinterf.h \ 201 207 $(SOPHYAINCP)tmatrix_tsnl.h \ 202 208 $(SOPHYAINCP)tvector_tsnl.h \ … … 260 266 $(SOPHYAINCP)ndatablock.h \ 261 267 $(SOPHYAINCP)utilarr.h \ 268 $(SOPHYAINCP)randinterf.h \ 262 269 $(SOPHYAINCP)tmatrix_tsnl.h \ 263 270 $(SOPHYAINCP)tvector_tsnl.h \ … … 293 300 $(SOPHYAINCP)ndatablock.h \ 294 301 $(SOPHYAINCP)utilarr.h \ 302 $(SOPHYAINCP)randinterf.h \ 295 303 $(SOPHYAINCP)tmatrix_tsnl.h \ 296 304 $(SOPHYAINCP)tvector_tsnl.h \ … … 327 335 $(SOPHYAINCP)dvlist.h \ 328 336 $(SOPHYAINCP)utilarr.h \ 337 $(SOPHYAINCP)randinterf.h \ 329 338 $(SOPHYAINCP)tmatrix_tsnl.h \ 330 339 $(SOPHYAINCP)tvector_tsnl.h \ … … 373 382 $(SOPHYAINCP)ndatablock.h \ 374 383 $(SOPHYAINCP)utilarr.h \ 384 $(SOPHYAINCP)randinterf.h \ 375 385 $(SOPHYAINCP)tmatrix_tsnl.h \ 376 386 $(SOPHYAINCP)tvector_tsnl.h \ -
trunk/SophyaLib/SkyMap/smakefile
r3405 r3615 33 33 $(SOPHYAINCP)ndatablock.h \ 34 34 $(SOPHYAINCP)utilarr.h \ 35 $(SOPHYAINCP)randinterf.h \ 35 36 $(SOPHYAINCP)tmatrix_tsnl.h \ 36 37 $(SOPHYAINCP)tvector_tsnl.h \ … … 64 65 $(SOPHYAINCP)ndatablock.h \ 65 66 $(SOPHYAINCP)utilarr.h \ 67 $(SOPHYAINCP)randinterf.h \ 66 68 $(SOPHYAINCP)tmatrix_tsnl.h \ 67 69 $(SOPHYAINCP)tvector_tsnl.h localmap.h \ … … 100 102 $(SOPHYAINCP)ndatablock.h \ 101 103 $(SOPHYAINCP)utilarr.h \ 104 $(SOPHYAINCP)randinterf.h \ 102 105 $(SOPHYAINCP)tmatrix_tsnl.h \ 103 106 $(SOPHYAINCP)tvector_tsnl.h \ … … 134 137 $(SOPHYAINCP)ndatablock.h \ 135 138 $(SOPHYAINCP)utilarr.h \ 139 $(SOPHYAINCP)randinterf.h \ 136 140 $(SOPHYAINCP)tmatrix_tsnl.h \ 137 141 $(SOPHYAINCP)tvector_tsnl.h \ … … 167 171 $(SOPHYAINCP)ndatablock.h \ 168 172 $(SOPHYAINCP)utilarr.h \ 173 $(SOPHYAINCP)randinterf.h \ 169 174 $(SOPHYAINCP)tmatrix_tsnl.h \ 170 175 $(SOPHYAINCP)tvector_tsnl.h \ … … 199 204 $(SOPHYAINCP)ndatablock.h \ 200 205 $(SOPHYAINCP)utilarr.h \ 206 $(SOPHYAINCP)randinterf.h \ 201 207 $(SOPHYAINCP)tmatrix_tsnl.h \ 202 208 $(SOPHYAINCP)tvector_tsnl.h \ … … 260 266 $(SOPHYAINCP)ndatablock.h \ 261 267 $(SOPHYAINCP)utilarr.h \ 268 $(SOPHYAINCP)randinterf.h \ 262 269 $(SOPHYAINCP)tmatrix_tsnl.h \ 263 270 $(SOPHYAINCP)tvector_tsnl.h \ … … 293 300 $(SOPHYAINCP)ndatablock.h \ 294 301 $(SOPHYAINCP)utilarr.h \ 302 $(SOPHYAINCP)randinterf.h \ 295 303 $(SOPHYAINCP)tmatrix_tsnl.h \ 296 304 $(SOPHYAINCP)tvector_tsnl.h \ … … 327 335 $(SOPHYAINCP)dvlist.h \ 328 336 $(SOPHYAINCP)utilarr.h \ 337 $(SOPHYAINCP)randinterf.h \ 329 338 $(SOPHYAINCP)tmatrix_tsnl.h \ 330 339 $(SOPHYAINCP)tvector_tsnl.h \ … … 373 382 $(SOPHYAINCP)ndatablock.h \ 374 383 $(SOPHYAINCP)utilarr.h \ 384 $(SOPHYAINCP)randinterf.h \ 375 385 $(SOPHYAINCP)tmatrix_tsnl.h \ 376 386 $(SOPHYAINCP)tvector_tsnl.h \ -
trunk/SophyaLib/SkyT/Makefile
r3405 r3615 111 111 $(SOPHYAINCP)ndatablock.h \ 112 112 $(SOPHYAINCP)utilarr.h \ 113 $(SOPHYAINCP)randinterf.h \ 113 114 $(SOPHYAINCP)tmatrix_tsnl.h \ 114 115 $(SOPHYAINCP)tvector_tsnl.h \ … … 142 143 $(SOPHYAINCP)ndatablock.h \ 143 144 $(SOPHYAINCP)utilarr.h \ 145 $(SOPHYAINCP)randinterf.h \ 144 146 $(SOPHYAINCP)tmatrix_tsnl.h \ 145 147 $(SOPHYAINCP)tvector_tsnl.h gaussfilt.h … … 169 171 $(SOPHYAINCP)ndatablock.h \ 170 172 $(SOPHYAINCP)utilarr.h \ 173 $(SOPHYAINCP)randinterf.h \ 171 174 $(SOPHYAINCP)tmatrix_tsnl.h \ 172 175 $(SOPHYAINCP)tvector_tsnl.h … … 194 197 $(SOPHYAINCP)ndatablock.h \ 195 198 $(SOPHYAINCP)utilarr.h \ 199 $(SOPHYAINCP)randinterf.h \ 196 200 $(SOPHYAINCP)tmatrix_tsnl.h \ 197 201 $(SOPHYAINCP)tvector_tsnl.h \ -
trunk/SophyaLib/SkyT/smakefile
r3405 r3615 111 111 $(SOPHYAINCP)ndatablock.h \ 112 112 $(SOPHYAINCP)utilarr.h \ 113 $(SOPHYAINCP)randinterf.h \ 113 114 $(SOPHYAINCP)tmatrix_tsnl.h \ 114 115 $(SOPHYAINCP)tvector_tsnl.h \ … … 142 143 $(SOPHYAINCP)ndatablock.h \ 143 144 $(SOPHYAINCP)utilarr.h \ 145 $(SOPHYAINCP)randinterf.h \ 144 146 $(SOPHYAINCP)tmatrix_tsnl.h \ 145 147 $(SOPHYAINCP)tvector_tsnl.h gaussfilt.h … … 169 171 $(SOPHYAINCP)ndatablock.h \ 170 172 $(SOPHYAINCP)utilarr.h \ 173 $(SOPHYAINCP)randinterf.h \ 171 174 $(SOPHYAINCP)tmatrix_tsnl.h \ 172 175 $(SOPHYAINCP)tvector_tsnl.h … … 194 197 $(SOPHYAINCP)ndatablock.h \ 195 198 $(SOPHYAINCP)utilarr.h \ 199 $(SOPHYAINCP)randinterf.h \ 196 200 $(SOPHYAINCP)tmatrix_tsnl.h \ 197 201 $(SOPHYAINCP)tvector_tsnl.h \ -
trunk/SophyaLib/SysTools/Makefile
r3405 r3615 15 15 $(SOPHYAINCP)pexceptions.h \ 16 16 $(SOPHYAINCP)machdefs.h \ 17 $(SOPHYAINCP)srandgen.h 17 $(SOPHYAINCP)srandgen.h \ 18 $(SOPHYAINCP)randinterf.h \ 19 $(SOPHYAINCP)anydataobj.h 18 20 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ cexpre.cc 19 21 … … 35 37 $(SOPHYAINCP)strutilxx.h cexpre.h \ 36 38 $(SOPHYAINCP)pexceptions.h rpneval.h \ 37 $(SOPHYAINCP)srandgen.h zthread.h 39 $(SOPHYAINCP)srandgen.h \ 40 $(SOPHYAINCP)randinterf.h zthread.h 38 41 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ commander.cc 39 42 40 $(SOPHYAOBJP)ctimer.o: ctimer.cc $(SOPHYAINCP) sopnamsp.h \41 $(SOPHYAINCP) machdefs.h ctimer.h43 $(SOPHYAOBJP)ctimer.o: ctimer.cc $(SOPHYAINCP)machdefs.h \ 44 $(SOPHYAINCP)sopnamsp.h ctimer.h 42 45 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ ctimer.cc 43 46 … … 70 73 $(SOPHYAINCP)machdefs.h \ 71 74 $(SOPHYAINCP)strutilxx.h \ 72 $(SOPHYAINCP)srandgen.h 75 $(SOPHYAINCP)srandgen.h \ 76 $(SOPHYAINCP)randinterf.h \ 77 $(SOPHYAINCP)anydataobj.h 73 78 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ rpneval.cc 74 79 -
trunk/SophyaLib/SysTools/cexpre.cc
r2804 r3615 220 220 static double _CE_rand01() { return drand01(); } 221 221 static double _CE_randpm1() { return drandpm1(); } 222 static double _CE_gaurand() { return Gau Rnd(0., 1.); }222 static double _CE_gaurand() { return Gaussian(1.,0.); } 223 223 //--------------------------------------------------------- 224 224 CE_FuncExp::CE_FuncExp(string const & func) -
trunk/SophyaLib/SysTools/commander.cc
r3581 r3615 584 584 kw = "autoiniranf"; 585 585 usage = "> Automatic random number generator initialisation\n"; 586 usage += " by Auto _Ini_Ranf(int lp) \n";586 usage += " by AutoInitRand(int lp) \n"; 587 587 usage += " Usage: autoiniranf"; 588 588 RegisterCommand(kw, usage, NULL, grp); … … 1955 1955 } 1956 1956 else if (kw == "autoiniranf") { 1957 Auto _Ini_Ranf(1);1957 AutoInitRand(1); 1958 1958 return(0); 1959 1959 } -
trunk/SophyaLib/SysTools/rpneval.cc
r2913 r3615 238 238 } 239 239 else if (args[k] == "gaurand") { 240 double rnd = Gau Rnd(0., 1.);240 double rnd = Gaussian(1.,0.); 241 241 rpnstack_.push(rnd); 242 242 } -
trunk/SophyaLib/SysTools/smakefile
r3405 r3615 15 15 $(SOPHYAINCP)pexceptions.h \ 16 16 $(SOPHYAINCP)machdefs.h \ 17 $(SOPHYAINCP)srandgen.h 17 $(SOPHYAINCP)srandgen.h \ 18 $(SOPHYAINCP)randinterf.h \ 19 $(SOPHYAINCP)anydataobj.h 18 20 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ cexpre.cc 19 21 … … 35 37 $(SOPHYAINCP)strutilxx.h cexpre.h \ 36 38 $(SOPHYAINCP)pexceptions.h rpneval.h \ 37 $(SOPHYAINCP)srandgen.h zthread.h 39 $(SOPHYAINCP)srandgen.h \ 40 $(SOPHYAINCP)randinterf.h zthread.h 38 41 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ commander.cc 39 42 40 $(SOPHYAOBJP)ctimer.o: ctimer.cc $(SOPHYAINCP) sopnamsp.h \41 $(SOPHYAINCP) machdefs.h ctimer.h43 $(SOPHYAOBJP)ctimer.o: ctimer.cc $(SOPHYAINCP)machdefs.h \ 44 $(SOPHYAINCP)sopnamsp.h ctimer.h 42 45 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ ctimer.cc 43 46 … … 70 73 $(SOPHYAINCP)machdefs.h \ 71 74 $(SOPHYAINCP)strutilxx.h \ 72 $(SOPHYAINCP)srandgen.h 75 $(SOPHYAINCP)srandgen.h \ 76 $(SOPHYAINCP)randinterf.h \ 77 $(SOPHYAINCP)anydataobj.h 73 78 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ rpneval.cc 74 79 -
trunk/SophyaLib/TArray/Makefile
r3405 r3615 49 49 $(SOPHYAINCP)dvlist.h \ 50 50 $(SOPHYAINCP)mutyv.h \ 51 $(SOPHYAINCP)ndatablock.h utilarr.h tmatrix.h \ 51 $(SOPHYAINCP)ndatablock.h utilarr.h \ 52 $(SOPHYAINCP)randinterf.h tmatrix.h \ 52 53 tmatrix_tsnl.h tvector.h tvector_tsnl.h \ 53 54 $(SOPHYAINCP)ppersist.h \ … … 71 72 $(SOPHYAINCP)dvlist.h \ 72 73 $(SOPHYAINCP)mutyv.h \ 73 $(SOPHYAINCP)ndatablock.h utilarr.h 74 $(SOPHYAINCP)ndatablock.h utilarr.h \ 75 $(SOPHYAINCP)randinterf.h 74 76 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ matharr.cc 75 77 … … 91 93 $(SOPHYAINCP)mutyv.h \ 92 94 $(SOPHYAINCP)ndatablock.h utilarr.h \ 93 tmatrix_tsnl.h tvector.h tvector_tsnl.h \ 95 $(SOPHYAINCP)randinterf.h tmatrix_tsnl.h \ 96 tvector.h tvector_tsnl.h \ 94 97 $(SOPHYAINCP)smathconst.h 95 98 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ sopemtx.cc … … 111 114 $(SOPHYAINCP)dvlist.h \ 112 115 $(SOPHYAINCP)mutyv.h \ 113 $(SOPHYAINCP)ndatablock.h utilarr.h 116 $(SOPHYAINCP)ndatablock.h utilarr.h \ 117 $(SOPHYAINCP)randinterf.h 114 118 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ tarray.cc 115 119 … … 131 135 $(SOPHYAINCP)dvlist.h \ 132 136 $(SOPHYAINCP)mutyv.h \ 133 $(SOPHYAINCP)ndatablock.h utilarr.h tmatrix.h \ 137 $(SOPHYAINCP)ndatablock.h utilarr.h \ 138 $(SOPHYAINCP)randinterf.h tmatrix.h \ 134 139 tmatrix_tsnl.h tvector.h tvector_tsnl.h \ 135 140 $(SOPHYAINCP)ppersist.h … … 154 159 $(SOPHYAINCP)mutyv.h \ 155 160 $(SOPHYAINCP)ndatablock.h utilarr.h \ 156 tmatrix_tsnl.h161 $(SOPHYAINCP)randinterf.h tmatrix_tsnl.h 157 162 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ tmatrix.cc 158 163 … … 175 180 $(SOPHYAINCP)mutyv.h \ 176 181 $(SOPHYAINCP)ndatablock.h utilarr.h \ 177 tmatrix_tsnl.h tvector_tsnl.h 182 $(SOPHYAINCP)randinterf.h tmatrix_tsnl.h \ 183 tvector_tsnl.h 178 184 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ tvector.cc 179 185 … … 191 197 $(SOPHYAINCP)rawstream.h \ 192 198 $(SOPHYAINCP)ppfnametag.h \ 193 $(SOPHYAINCP)stsrand.h \ 194 $(SOPHYAINCP)ndatablock.h 199 $(SOPHYAINCP)randinterf.h \ 200 $(SOPHYAINCP)randr48.h \ 201 $(SOPHYAINCP)ndatablock.h \ 202 $(SOPHYAINCP)randinterf.h 195 203 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ utilarr.cc 196 204 -
trunk/SophyaLib/TArray/smakefile
r3405 r3615 49 49 $(SOPHYAINCP)dvlist.h \ 50 50 $(SOPHYAINCP)mutyv.h \ 51 $(SOPHYAINCP)ndatablock.h utilarr.h tmatrix.h \ 51 $(SOPHYAINCP)ndatablock.h utilarr.h \ 52 $(SOPHYAINCP)randinterf.h tmatrix.h \ 52 53 tmatrix_tsnl.h tvector.h tvector_tsnl.h \ 53 54 $(SOPHYAINCP)ppersist.h \ … … 71 72 $(SOPHYAINCP)dvlist.h \ 72 73 $(SOPHYAINCP)mutyv.h \ 73 $(SOPHYAINCP)ndatablock.h utilarr.h 74 $(SOPHYAINCP)ndatablock.h utilarr.h \ 75 $(SOPHYAINCP)randinterf.h 74 76 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ matharr.cc 75 77 … … 91 93 $(SOPHYAINCP)mutyv.h \ 92 94 $(SOPHYAINCP)ndatablock.h utilarr.h \ 93 tmatrix_tsnl.h tvector.h tvector_tsnl.h \ 95 $(SOPHYAINCP)randinterf.h tmatrix_tsnl.h \ 96 tvector.h tvector_tsnl.h \ 94 97 $(SOPHYAINCP)smathconst.h 95 98 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ sopemtx.cc … … 111 114 $(SOPHYAINCP)dvlist.h \ 112 115 $(SOPHYAINCP)mutyv.h \ 113 $(SOPHYAINCP)ndatablock.h utilarr.h 116 $(SOPHYAINCP)ndatablock.h utilarr.h \ 117 $(SOPHYAINCP)randinterf.h 114 118 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ tarray.cc 115 119 … … 131 135 $(SOPHYAINCP)dvlist.h \ 132 136 $(SOPHYAINCP)mutyv.h \ 133 $(SOPHYAINCP)ndatablock.h utilarr.h tmatrix.h \ 137 $(SOPHYAINCP)ndatablock.h utilarr.h \ 138 $(SOPHYAINCP)randinterf.h tmatrix.h \ 134 139 tmatrix_tsnl.h tvector.h tvector_tsnl.h \ 135 140 $(SOPHYAINCP)ppersist.h … … 154 159 $(SOPHYAINCP)mutyv.h \ 155 160 $(SOPHYAINCP)ndatablock.h utilarr.h \ 156 tmatrix_tsnl.h161 $(SOPHYAINCP)randinterf.h tmatrix_tsnl.h 157 162 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ tmatrix.cc 158 163 … … 175 180 $(SOPHYAINCP)mutyv.h \ 176 181 $(SOPHYAINCP)ndatablock.h utilarr.h \ 177 tmatrix_tsnl.h tvector_tsnl.h 182 $(SOPHYAINCP)randinterf.h tmatrix_tsnl.h \ 183 tvector_tsnl.h 178 184 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ tvector.cc 179 185 … … 191 197 $(SOPHYAINCP)rawstream.h \ 192 198 $(SOPHYAINCP)ppfnametag.h \ 193 $(SOPHYAINCP)stsrand.h \ 194 $(SOPHYAINCP)ndatablock.h 199 $(SOPHYAINCP)randinterf.h \ 200 $(SOPHYAINCP)randr48.h \ 201 $(SOPHYAINCP)ndatablock.h \ 202 $(SOPHYAINCP)randinterf.h 195 203 $(CXXCOMPILE) $(CXXTEMPFLG) -o $@ utilarr.cc 196 204
Note:
See TracChangeset
for help on using the changeset viewer.