Ignore:
Timestamp:
Aug 8, 2008, 3:11:45 PM (17 years ago)
Author:
ansari
Message:

Nettoyage alm.h .cc , utilisation RandomGenerator par Alm<T> et SphericalTransformServer , Reza 08/08/2008

File:
1 edited

Legend:

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

    r3508 r3510  
    66#include "sphericaltransformserver.h"
    77#include "tvector.h"
    8 #include "srandgen.h"
     8#include "stsrand.h"
    99#include "nbmath.h"
    1010#include "timing.h"
     
    152152
    153153 */
     154
     155//!  Default constructor - Creates a non thread-safe RandomGenerator to be used by GenerateFromCl
     156template<class T>
     157SphericalTransformServer<T>::SphericalTransformServer()
     158: rg_(1, false)
     159{
     160  fftIntfPtr_=new FFTPackServer(true); // preserveinput = true
     161  fftIntfPtr_->setNormalize(false);
     162}
     163
     164//!  Constructor with the specification of a RandomGenerator object to be used by GenerateFromCl
     165template<class T>
     166SphericalTransformServer<T>::SphericalTransformServer(RandomGenerator const & rg)
     167: rg_(rg)
     168{
     169  fftIntfPtr_=new FFTPackServer(true); // preserveinput = true
     170  fftIntfPtr_->setNormalize(false);
     171}
     172
     173template<class T>
     174SphericalTransformServer<T>::~SphericalTransformServer()
     175{
     176  if (fftIntfPtr_!=NULL) delete fftIntfPtr_;
     177}
     178
     179/*!
     180 Set a fft server. The constructor sets a default fft server (fft-pack).
     181 So it is not necessary to call this method for a standard use.
     182 \warning The FFTServerInterface object should NOT overwrite the input arrays
     183*/
     184template<class T>
     185void SphericalTransformServer<T>::SetFFTServer(FFTServerInterface* srv)
     186{
     187  if (fftIntfPtr_!=NULL) delete fftIntfPtr_;
     188  fftIntfPtr_=srv;
     189  fftIntfPtr_->setNormalize(false);
     190}
     191
    154192
    155193 /*! \fn void SOPHYA::SphericalTransformServer::GenerateFromAlm( SphericalMap<T>& map, int_4 pixelSizeIndex, const Alm<T>& alm) const
     
    12751313  //  Alm<T> a2lme = almFromCl(Cle, fwhm);
    12761314  // Alm<T> a2lmb = almFromCl(Clb, fwhm);
    1277   Alm<T> a2lme(Cle, fwhm);
    1278   Alm<T> a2lmb(Clb, fwhm);
     1315  Alm<T> a2lme(Cle, fwhm, rg_);
     1316  Alm<T> a2lmb(Clb, fwhm, rg_);
    12791317
    12801318  GenerateFromAlm(sphq,sphu,pixelSizeIndex,a2lme,a2lmb);
     
    12931331{
    12941332
    1295   Alm<T> alm(Cl, fwhm);
     1333  Alm<T> alm(Cl, fwhm, rg_);
    12961334  GenerateFromAlm(sph,pixelSizeIndex, alm );
    12971335}
Note: See TracChangeset for help on using the changeset viewer.