Changeset 3613 in Sophya for trunk/SophyaLib/Samba
- Timestamp:
- Apr 30, 2009, 7:07:46 PM (16 years ago)
- Location:
- trunk/SophyaLib/Samba
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/Samba/alm.cc
r3510 r3613 20 20 21 21 //alm.ReSize(nlmax); 22 this->ReSizeRow(nlmax+1); 23 RandomGenerator rg(1, false); 24 GenFromCl(clin, fwhm, rg); 22 this->ReSizeRow(nlmax+1); 23 GenFromCl(clin, fwhm, *(RandomGeneratorInterface::GetGlobalRandGenP()) ); 25 24 } 26 25 … … 29 28 */ 30 29 template <class T> 31 Alm<T>::Alm(const TVector<T>& clin, const r_8 fwhm, RandomGenerator & rg)30 Alm<T>::Alm(const TVector<T>& clin, const r_8 fwhm, RandomGeneratorInterface & rg) 32 31 { 33 32 int_4 nlmax= clin.NElts()-1; … … 41 40 42 41 template <class T> 43 void Alm<T>::GenFromCl(const TVector<T> & clin, const r_8 fwhm, RandomGenerator & rg)42 void Alm<T>::GenFromCl(const TVector<T> & clin, const r_8 fwhm, RandomGeneratorInterface & rg) 44 43 { 45 44 /*======================================================================= -
trunk/SophyaLib/Samba/alm.h
r3510 r3613 6 6 #define ALM_SEEN 7 7 8 #include " stsrand.h"8 #include "randinterf.h" 9 9 #include "nbmath.h" 10 10 #include "triangmtx.h" … … 26 26 Alm(const TVector<T> & clin, const r_8 fwhm) ; 27 27 //! Constructor, generates alm from a cl vector, using the specified random generator object 28 Alm(const TVector<T> & clin, const r_8 fwhm, RandomGenerator 28 Alm(const TVector<T> & clin, const r_8 fwhm, RandomGeneratorInterface& rg); 29 29 30 30 //! Resize with a new lmax … … 41 41 42 42 private: 43 void GenFromCl(const TVector<T> & clin, const r_8 fwhm, RandomGenerator & rg);43 void GenFromCl(const TVector<T> & clin, const r_8 fwhm, RandomGeneratorInterface& rg); 44 44 }; 45 45 -
trunk/SophyaLib/Samba/sphericaltransformserver.cc
r3572 r3613 6 6 #include "sphericaltransformserver.h" 7 7 #include "tvector.h" 8 #include "stsrand.h"9 8 #include "nbmath.h" 10 9 #include "timing.h" … … 156 155 template<class T> 157 156 SphericalTransformServer<T>::SphericalTransformServer() 158 : rg _(1, false)157 : rgp_(RandomGeneratorInterface::GetGlobalRandGenP()) 159 158 { 160 159 fftIntfPtr_=new FFTPackServer(true); // preserveinput = true … … 164 163 //! Constructor with the specification of a RandomGenerator object to be used by GenerateFromCl 165 164 template<class T> 166 SphericalTransformServer<T>::SphericalTransformServer(RandomGenerator const& rg)167 : rg _(rg)165 SphericalTransformServer<T>::SphericalTransformServer(RandomGeneratorInterface& rg) 166 : rgp_(&rg) 168 167 { 169 168 fftIntfPtr_=new FFTPackServer(true); // preserveinput = true … … 1312 1311 // Alm<T> a2lme = almFromCl(Cle, fwhm); 1313 1312 // Alm<T> a2lmb = almFromCl(Clb, fwhm); 1314 Alm<T> a2lme(Cle, fwhm, rg_);1315 Alm<T> a2lmb(Clb, fwhm, rg_);1313 Alm<T> a2lme(Cle, fwhm, *rgp_); 1314 Alm<T> a2lmb(Clb, fwhm, *rgp_); 1316 1315 1317 1316 GenerateFromAlm(sphq,sphu,pixelSizeIndex,a2lme,a2lmb); … … 1330 1329 { 1331 1330 1332 Alm<T> alm(Cl, fwhm, rg_);1331 Alm<T> alm(Cl, fwhm, *rgp_); 1333 1332 GenerateFromAlm(sph,pixelSizeIndex, alm ); 1334 1333 } -
trunk/SophyaLib/Samba/sphericaltransformserver.h
r3510 r3613 5 5 #include "fftservintf.h" 6 6 #include "fftpserver.h" 7 #include " stsrand.h"7 #include "randinterf.h" 8 8 #include "alm.h" 9 9 #include "lambdaBuilder.h" … … 19 19 public: 20 20 21 SphericalTransformServer();22 SphericalTransformServer(RandomGenerator const& rg);21 explicit SphericalTransformServer(); 22 explicit SphericalTransformServer(RandomGeneratorInterface& rg); 23 23 virtual ~SphericalTransformServer(); 24 24 void SetFFTServer(FFTServerInterface* srv=NULL); … … 107 107 108 108 FFTServerInterface* fftIntfPtr_; 109 mutable RandomGenerator rg_;109 mutable RandomGeneratorInterface* rgp_; 110 110 111 111 };
Note:
See TracChangeset
for help on using the changeset viewer.