Changeset 3348 in Sophya for trunk/Cosmo/SimLSS/pkspectrum.h


Ignore:
Timestamp:
Oct 11, 2007, 4:37:03 PM (18 years ago)
Author:
cmv
Message:
  • definition des options par enum
  • mise en variable privee du rayon R du filtre de VarianceSpectrum Elle disparait des arguments des methodes: Variance FindMaximum FindLimits

cmv 11/10/2007

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cosmo/SimLSS/pkspectrum.h

    r3325 r3348  
    2323class TransfertEisenstein : public GenericFunc {
    2424public:
     25
     26  typedef enum{ALL=0, CDM=1, BARYON=2} ReturnPart;
     27
    2528  TransfertEisenstein(double h100,double OmegaCDM0,double OmegaBaryon0,double tcmb,bool nobaryon=false,int lp=0);
    2629  TransfertEisenstein(TransfertEisenstein& tf);
     
    2932  double KPeak(void);
    3033  void SetNoOscEnv(unsigned short nooscenv=0);
    31   void SetReturnPart(unsigned short retpart=0);
     34  void SetReturnPart(ReturnPart retpart=ALL);
    3235protected:
    3336  int lp_;
     
    3942
    4043  bool nobaryon_;
    41   unsigned short nooscenv_, retpart_;
     44  unsigned short nooscenv_;
     45  ReturnPart retpart_;
    4246
    4347  double T0tild(double k,double alphac,double betac);
     
    9498class PkSpectrumZ : public GenericFunc {
    9599public:
     100  typedef enum {PK=0, DELTA=1} ReturnSpectrum;
    96101  PkSpectrumZ(PkSpectrum0& pk0,GrowthFactor& d1,double zref=0.);
    97102  PkSpectrumZ(PkSpectrumZ& pkz);
     
    101106  inline void   SetZ(double z) {zref_ = z;}
    102107  inline double GetZ(void) {return zref_;}
    103   void SetTypSpec(unsigned short typspec=0);
     108  void SetTypSpec(ReturnSpectrum typspec=PK);
    104109  inline void SetScale(double scale=1.) {scale_=scale; zold_=-1.;}
    105110  inline double GetScale(void) {return scale_;}
     
    110115  GrowthFactor& d1_;
    111116  double zref_, scale_;
    112   unsigned short typspec_;
     117  ReturnSpectrum typspec_;
    113118  mutable double zold_, d1old_;
    114119};
     
    117122class VarianceSpectrum : public GenericFunc {
    118123public:
    119   VarianceSpectrum(GenericFunc& pk,unsigned short typfilter);
     124
     125  typedef enum {TOPHAT=0, GAUSSIAN=1, NOFILTER=2} TypeFilter;
     126
     127  VarianceSpectrum(GenericFunc& pk,double R,TypeFilter typfilter);
    120128  VarianceSpectrum(VarianceSpectrum& pkinf);
    121129  virtual ~VarianceSpectrum(void);
    122130
    123   void SetFilter(unsigned short typfilter=0);
     131  void SetRadius(double R);
     132  void SetFilter(TypeFilter typfilter=TOPHAT);
    124133  void SetInteg(double dperc=0.1,double dlogkinc=-1.,double dlogkmax=-1.,unsigned short glorder=4);
    125134
    126   double Variance(double R,double kmin,double kmax);
     135  double Variance(double kmin,double kmax);
    127136
    128137  // ATTENTION: La fonction a integrer est : f(k)dk = k^3*Pk(k)/(2Pi^2) *filter2(k*R) *dk/k
     
    131140
    132141  // Aide a l'integration
    133   double FindMaximum(double R,double kmin,double kmax,double eps=1.e-3);
    134   int FindLimits(double R,double high,double &kmin,double &kmax,double eps=1.e-3);
     142  double FindMaximum(double kmin,double kmax,double eps=1.e-3);
     143  int FindLimits(double high,double &kmin,double &kmax,double eps=1.e-3);
    135144
    136145protected:
    137146
    138147  GenericFunc& pk_;
    139   unsigned short typfilter_;
     148  TypeFilter typfilter_;
    140149  double R_;
    141150
Note: See TracChangeset for help on using the changeset viewer.