Changeset 3062 in Sophya for trunk/SophyaLib/NTools/generaldata.h


Ignore:
Timestamp:
Aug 14, 2006, 8:24:21 PM (19 years ago)
Author:
cmv
Message:

dans GeneralFitData int -> int_4
GeneralFitData creation operator =
cmv 14/8/2006

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/NTools/generaldata.h

    r2683 r3062  
    1313namespace SOPHYA {
    1414
     15//  Forward class declaration for Fits handler
     16template <class T>  class FitsHandler;
     17
    1518class GeneralFit;
    1619
     
    2326  friend class GeneralFit;
    2427  friend class ObjFileIO<GeneralFitData>;
     28  friend class FitsHandler<GeneralFitData>;
    2529public:
    2630  //! Valeurs par defaut pour l'utilisation des erreurs
     
    3034    };
    3135
    32   GeneralFitData(unsigned int nVar, unsigned int nDataAlloc, uint_2 errx=0);
     36  GeneralFitData(uint_4 nVar, uint_4 nDataAlloc, uint_2 errx=0);
    3337  GeneralFitData(const GeneralFitData& data, bool clean=false);
    3438  GeneralFitData();
    3539  virtual ~GeneralFitData();
    3640
    37   void Alloc(unsigned int nVar, unsigned int nDataAlloc, int_2 errx=-1);
    38   void SetDataPtr(int ptr = 0);
    39 
    40   void KillData(int i);
    41   void KillData(int i1,int i2);
    42 
    43   void ValidData(int i);
    44   void ValidData(int i1,int i2);
     41  void SetDataPtr(int_4 ptr = 0);
     42
     43  void KillData(int_4 i);
     44  void KillData(int_4 i1,int_4 i2);
     45
     46  void ValidData(int_4 i);
     47  void ValidData(int_4 i1,int_4 i2);
    4548  void ValidData();
    4649
    47   void RedefineData1(int i,double x,double f,double err=Def_ErrF,double errx=Def_ErrX);
    48   void RedefineData2(int i,double x,double y,double f,double err=Def_ErrF
     50  void RedefineData1(int_4 i,double x,double f,double err=Def_ErrF,double errx=Def_ErrX);
     51  void RedefineData2(int_4 i,double x,double y,double f,double err=Def_ErrF
    4952                    ,double errx=Def_ErrX,double erry=Def_ErrX);
    50   void RedefineData(int i,double* xp,double f,double err=Def_ErrF,double* errxp=NULL);
     53  void RedefineData(int_4 i,double* xp,double f,double err=Def_ErrF,double* errxp=NULL);
    5154
    5255  void AddData1(double x, double f, double err=Def_ErrF,double errx=Def_ErrX);
     
    5659  void AddData(float* xp, float f, float err=Def_ErrF,float* errxp=NULL);
    5760
    58   void SetData1(int nData,double* x,double* f,double *err=NULL,double *errx=NULL);
    59   void SetData1(int nData,float* x,float* f,float* err=NULL,float *errx=NULL);
    60   void SetData2(int nData,double* x,double* y,double* f,double *err=NULL
     61  void SetData1(int_4 nData,double* x,double* f,double *err=NULL,double *errx=NULL);
     62  void SetData1(int_4 nData,float* x,float* f,float* err=NULL,float *errx=NULL);
     63  void SetData2(int_4 nData,double* x,double* y,double* f,double *err=NULL
    6164               ,double *errx=NULL,double *erry=NULL);
    62   void SetData2(int nData,float* x,float* y,float* f,float* err=NULL
     65  void SetData2(int_4 nData,float* x,float* y,float* f,float* err=NULL
    6366               ,float *errx=NULL,float *erry=NULL);
    64   void SetData(int nData,double** xp,double *f,double *err=NULL,double** errxp=NULL);
    65   void SetData(int nData,float** xp,float* f,float* err=NULL,float** errxp=NULL);
     67  void SetData(int_4 nData,double** xp,double *f,double *err=NULL,double** errxp=NULL);
     68  void SetData(int_4 nData,float** xp,float* f,float* err=NULL,float** errxp=NULL);
    6669
    6770  void PrintStatus() const;
    68   void PrintData(int i) const;
    69   void PrintData(int i1,int i2) const;
     71  void PrintData(int_4 i) const;
     72  void PrintData(int_4 i1,int_4 i2) const;
    7073  void PrintData() const;
    7174  void Show(ostream& os) const;
    7275  inline void Show() const {Show(cout);}
    7376
     77  //! Operator equal
     78  GeneralFitData& operator = (const GeneralFitData& g);
     79
    7480  //! Retourne la place restante dans la structure (nombre de donnees que l'on peut encore stoquer).
    75   inline int GetSpaceFree() const { return mNDataAlloc - mNData; }
     81  inline int_4 GetSpaceFree() const { return mNDataAlloc - mNData; }
    7682  //! Retourne le nombre de variables Xi
    77   inline int NVar()       const {return mNVar;}
     83  inline int_4 NVar()       const {return mNVar;}
    7884  //! Retourne le nombre de donnees
    79   inline int NData()      const {return mNData;}
     85  inline int_4 NData()      const {return mNData;}
    8086  //! Retourne le nombre de bonnes donnees (utilisees pour le fit)
    81   inline int NDataGood()  const {return mNDataGood;}
     87  inline int_4 NDataGood()  const {return mNDataGood;}
    8288  //! Retourne la place maximale allouee pour les donnees
    83   inline int NDataAlloc() const {return mNDataAlloc;}
     89  inline int_4 NDataAlloc() const {return mNDataAlloc;}
    8490
    8591  //! Retourne 1 si point valide, sinon 0
    86   inline unsigned short int IsValid(int i) const
     92  inline unsigned short IsValid(int_4 i) const
    8793                {if(i>=0 && i<mNData) return mOK[i]; else return 0;}
    8894  //! Retourne ``true'' si il y a des erreurs sur les variables d'abscisse, ``false'' sinon.
     
    9096
    9197  //! Retourne l'abscisse pour 1 dimension (y=f(x)) donnee I
    92   inline double X1(int i) const
     98  inline double X1(int_4 i) const
    9399                {if(i>=0 && i<mNData) return mXP[i]; else return 0.;}
    94100  //! Retourne la 1er abscisse (X) pour (v=f(x,y,z,...)) donnee I
    95   inline double X(int i) const
     101  inline double X(int_4 i) const
    96102                {if(i>=0 && i<mNData) return mXP[i*mNVar]; else return 0.;}
    97103  //! Retourne la 2sd abscisse (Y) pour (v=f(x,y,z,...)) donnee I
    98   inline double Y(int i) const
     104  inline double Y(int_4 i) const
    99105                {if(i>=0 && i<mNData && 1<mNVar) return mXP[i*mNVar+1]; else return 0.;}
    100106  //! etourne la 3ieme abscisse (Z) pour (v=f(x,y,z,...)) donnee I
    101   inline double Z(int i) const
     107  inline double Z(int_4 i) const
    102108                {if(i>=0 && i<mNData && 2<mNVar) return mXP[i*mNVar+2]; else return 0.;}
    103109  //! Retourne la Jieme abscisse (Xj) pour (v=f(x0,x1,x2,...)) donnee I
    104   inline double Absc(int j,int i) const
     110  inline double Absc(int_4 j,int_4 i) const
    105111                {if(i>=0 && i<mNData && j<mNVar)return mXP[i*mNVar+j]; else return 0.;}
    106112  //! Retourne la valeur de la Ieme donnee
    107   inline double Val(int i) const
     113  inline double Val(int_4 i) const
    108114                {if(i>=0 && i<mNData) return mF[i]; else return 0.;}
    109115
    110116  //! Retourne l'erreur (dx) sur l'abscisse pour 1 dimension (y=f(x)) donnee I
    111   inline double EX1(int i) const
     117  inline double EX1(int_4 i) const
    112118                {if(mErrXP && i>=0 && i<mNData) return mErrXP[i]; else return 0.;}
    113119  //! Retourne l'erreur (dx) sur la 1er abscisse (X) pour (v=f(x,y,z,...)) donnee I
    114   inline double EX(int i) const
     120  inline double EX(int_4 i) const
    115121                {if(mErrXP && i>=0 && i<mNData) return mErrXP[i*mNVar]; else return 0.;}
    116122  //! Retourne l'erreur (dy) sur la 2sd abscisse (Y) pour (v=f(x,y,z,...)) donnee I
    117   inline double EY(int i) const
     123  inline double EY(int_4 i) const
    118124                {if(mErrXP && i>=0 && i<mNData && 1<mNVar) return mErrXP[i*mNVar+1];
    119125                 else return 0.;}
    120126  //! Retourne l'erreur (dz) sur la 3ieme abscisse (Z) pour (v=f(x,y,z,...)) donnee I
    121   inline double EZ(int i) const
     127  inline double EZ(int_4 i) const
    122128                {if(mErrXP && i>=0 && i<mNData && 2<mNVar) return mErrXP[i*mNVar+2];
    123129                 else return 0.;}
    124130  //! Retourne l'erreur (dxj) sur la Jieme abscisse (Xj) pour (v=f(x0,x1,x2,...)) donnee I
    125   inline double EAbsc(int j,int i) const
     131  inline double EAbsc(int_4 j,int_4 i) const
    126132                {if(mErrXP && i>=0 && i<mNData && j<mNVar) return mErrXP[i*mNVar+j];
    127133                 else return 0.;}
    128134  //! Retourne l'erreur de la Ieme donnee
    129   inline double EVal(int i) const
     135  inline double EVal(int_4 i) const
    130136                {if(i>=0 && i<mNData) return mErr[i]; else return 0.;}
    131137
    132   r_8* GetVec(int n, r_8* ret=NULL) const;
    133   r_4* GetVecR4(int n, r_4* ret=NULL) const;
    134   int GetMnMx(int var,int& imin,int& imax) const;
    135   int GetMnMx(int var,double& min,double& max) const;
    136   int GetMeanSigma(int var,double& mean,double& sigma,double min=1.,double max=-1.) const;
    137   int GetMoMeMed(int var,double& mode,double& mean,double& median,
     138  r_8* GetVec(int_4 n, r_8* ret=NULL) const;
     139  r_4* GetVecR4(int_4 n, r_4* ret=NULL) const;
     140  int_4 GetMnMx(int_4 var,int_4& imin,int_4& imax) const;
     141  int_4 GetMnMx(int_4 var,double& min,double& max) const;
     142  int_4 GetMeanSigma(int_4 var,double& mean,double& sigma,double min=1.,double max=-1.) const;
     143  int_4 GetMoMeMed(int_4 var,double& mode,double& mean,double& median,
    138144                 double min=1.,double max=-1.,double coeff=0.8) const;
    139   int GetMode(int var,double& mode,double min=1.,double max=-1.,double coeff=0.8) const;
    140   double PolFit(int varx,Poly& pol,int degre,bool ey=true,double xc=0.) const;
    141   double PolFit(int varx,int vary,Poly2& pol,int degre1,int degre2=-1,bool ez=true
     145  int_4 GetMode(int_4 var,double& mode,double min=1.,double max=-1.,double coeff=0.8) const;
     146  double PolFit(int_4 varx,Poly& pol,int_4 degre,bool ey=true,double xc=0.) const;
     147  double PolFit(int_4 varx,int_4 vary,Poly2& pol,int_4 degre1,int_4 degre2=-1,bool ez=true
    142148               ,double xc=0.,double yc=0.) const;
    143149  GeneralFitData FitResidus(GeneralFit& gfit) const;
     
    161167
    162168protected:
     169  void Alloc(uint_4 nVar, uint_4 nDataAlloc, uint_2 errx=0);
    163170  void Delete();
    164171
Note: See TracChangeset for help on using the changeset viewer.