Changeset 3613 in Sophya for trunk/SophyaLib/Samba


Ignore:
Timestamp:
Apr 30, 2009, 7:07:46 PM (16 years ago)
Author:
ansari
Message:

Adaptation a l'introduction de la suite des classes RandomGeneratorInterface et Cie , Reza 30/04/2009

Location:
trunk/SophyaLib/Samba
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/Samba/alm.cc

    r3510 r3613  
    2020
    2121  //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()) );
    2524}
    2625
     
    2928*/
    3029template <class T>
    31 Alm<T>::Alm(const TVector<T>& clin, const r_8 fwhm, RandomGenerator & rg)
     30Alm<T>::Alm(const TVector<T>& clin, const r_8 fwhm, RandomGeneratorInterface & rg)
    3231{
    3332  int_4 nlmax= clin.NElts()-1;
     
    4140
    4241template <class T>
    43 void Alm<T>::GenFromCl(const TVector<T> & clin, const r_8 fwhm, RandomGenerator & rg)
     42void Alm<T>::GenFromCl(const TVector<T> & clin, const r_8 fwhm, RandomGeneratorInterface & rg)
    4443{
    4544  /*=======================================================================
  • trunk/SophyaLib/Samba/alm.h

    r3510 r3613  
    66#define ALM_SEEN
    77
    8 #include "stsrand.h"
     8#include "randinterf.h"
    99#include "nbmath.h"
    1010#include "triangmtx.h"
     
    2626  Alm(const TVector<T> & clin, const r_8 fwhm) ;
    2727//! Constructor, generates alm from a cl vector, using the specified random generator object
    28   Alm(const TVector<T> & clin, const r_8 fwhm, RandomGenerator & rg);
     28  Alm(const TVector<T> & clin, const r_8 fwhm, RandomGeneratorInterface& rg);
    2929
    3030//! Resize with a new lmax
     
    4141
    4242private:
    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);
    4444};
    4545
  • trunk/SophyaLib/Samba/sphericaltransformserver.cc

    r3572 r3613  
    66#include "sphericaltransformserver.h"
    77#include "tvector.h"
    8 #include "stsrand.h"
    98#include "nbmath.h"
    109#include "timing.h"
     
    156155template<class T>
    157156SphericalTransformServer<T>::SphericalTransformServer()
    158 : rg_(1, false)
     157: rgp_(RandomGeneratorInterface::GetGlobalRandGenP())
    159158{
    160159  fftIntfPtr_=new FFTPackServer(true); // preserveinput = true
     
    164163//!  Constructor with the specification of a RandomGenerator object to be used by GenerateFromCl
    165164template<class T>
    166 SphericalTransformServer<T>::SphericalTransformServer(RandomGenerator const & rg)
    167 : rg_(rg)
     165SphericalTransformServer<T>::SphericalTransformServer(RandomGeneratorInterface& rg)
     166: rgp_(&rg)
    168167{
    169168  fftIntfPtr_=new FFTPackServer(true); // preserveinput = true
     
    13121311  //  Alm<T> a2lme = almFromCl(Cle, fwhm);
    13131312  // 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_);
    13161315
    13171316  GenerateFromAlm(sphq,sphu,pixelSizeIndex,a2lme,a2lmb);
     
    13301329{
    13311330
    1332   Alm<T> alm(Cl, fwhm, rg_);
     1331  Alm<T> alm(Cl, fwhm, *rgp_);
    13331332  GenerateFromAlm(sph,pixelSizeIndex, alm );
    13341333}
  • trunk/SophyaLib/Samba/sphericaltransformserver.h

    r3510 r3613  
    55#include "fftservintf.h"
    66#include "fftpserver.h"
    7 #include "stsrand.h"
     7#include "randinterf.h"
    88#include "alm.h"
    99#include "lambdaBuilder.h"
     
    1919 public:
    2020
    21   SphericalTransformServer(); 
    22   SphericalTransformServer(RandomGenerator const & rg); 
     21  explicit SphericalTransformServer(); 
     22  explicit SphericalTransformServer(RandomGeneratorInterface& rg); 
    2323  virtual ~SphericalTransformServer();
    2424  void SetFFTServer(FFTServerInterface* srv=NULL);
     
    107107
    108108 FFTServerInterface* fftIntfPtr_;
    109  mutable RandomGenerator rg_;
     109 mutable RandomGeneratorInterface* rgp_;
    110110
    111111};
Note: See TracChangeset for help on using the changeset viewer.