| [220] | 1 | /* quelques fonctions mathematiques et constantes utiles */
 | 
|---|
 | 2 | /*                                         cmv  23/06/94 */
 | 
|---|
 | 3 | #ifndef NBMATH_H_SEEN
 | 
|---|
 | 4 | #define NBMATH_H_SEEN
 | 
|---|
 | 5 | 
 | 
|---|
| [244] | 6 | #include "machdefs.h"
 | 
|---|
| [756] | 7 | #include "smathconst.h"
 | 
|---|
| [220] | 8 | 
 | 
|---|
 | 9 | #ifdef __cplusplus
 | 
|---|
 | 10 | extern "C" {
 | 
|---|
 | 11 | #endif
 | 
|---|
 | 12 | 
 | 
|---|
 | 13 | 
 | 
|---|
 | 14 | /* pour le fit 1-dim */
 | 
|---|
 | 15 | #define NPAR_FITFUN 10
 | 
|---|
 | 16 | #define FITFUN_FLOAT 1
 | 
|---|
 | 17 | #define FITFUN_DOUBLE 2
 | 
|---|
 | 18 | union FloatDouble { float  *fx; double *dx; };
 | 
|---|
 | 19 | typedef union FloatDouble FLOATDOUBLE;
 | 
|---|
 | 20 | 
 | 
|---|
 | 21 | double FitFun( double (*FunFit) (double ,double *,double *) ,int_4 type
 | 
|---|
 | 22 |              ,FLOATDOUBLE temps,FLOATDOUBLE mag,FLOATDOUBLE err
 | 
|---|
 | 23 |              ,int_4 *ndata,int_4 I1,int_4 I2
 | 
|---|
 | 24 |              ,double *par,double *epar,double *stepar
 | 
|---|
 | 25 |              ,double *minpar,double *maxpar,int_4 npar
 | 
|---|
 | 26 |              ,double stochi2,int_4 NstepMX,int_4 deb);
 | 
|---|
 | 27 | 
 | 
|---|
 | 28 | double GausPiv(double *A,int_4 nca,int_4 n,double *B,int_4 ncb,int_4 m,int_4 Inv);
 | 
|---|
 | 29 | 
 | 
|---|
 | 30 | int_4 paramga(float sxin, float syin, float rhoin
 | 
|---|
 | 31 |              , float *smax, float *axisrat, float *tiltdeg);
 | 
|---|
 | 32 | int_4 gaparam(float smax, float axisrat, float tiltdeg
 | 
|---|
 | 33 |              , float *sxin, float *syin, float *rhoin);
 | 
|---|
 | 34 | 
 | 
|---|
 | 35 | double nberfc(double x);
 | 
|---|
 | 36 | float probnb(float sci2,int_4 inddl,int_4 *ipass);
 | 
|---|
 | 37 | double nbgammln(double xx);
 | 
|---|
 | 38 | double nbgammq(double a,double x);
 | 
|---|
 | 39 | double nbgammp(double a,double x);
 | 
|---|
 | 40 | 
 | 
|---|
 | 41 | void Set_Ihoq(int degre,int *mIhoqN,double *IhoqNX,double *IhoqNW);
 | 
|---|
 | 42 | int Get_Ihoq(int degre,double *IhoqNX,double *IhoqNW);
 | 
|---|
 | 43 | void nbgauleg(double x1,double x2,double *x,double *w,int n);
 | 
|---|
 | 44 | double Integ_Fun(double xmin,double xmax,double (*fonc)(double),int npas);
 | 
|---|
 | 45 | double Integ_Fun_2D(double (*fonc)(double x,double y)
 | 
|---|
 | 46 |                 ,double xmin,double xmax,double ymin,double ymax
 | 
|---|
 | 47 |                 ,int npasx,int npasy);
 | 
|---|
 | 48 | 
 | 
|---|
 | 49 | void Set_FitFunDPol(int DPol);
 | 
|---|
 | 50 | double Gauss1DPolF(double x,double *Par,double *DgDpar);
 | 
|---|
 | 51 | double GaussI1DPol(double x,double *Par,double *DgDpar);
 | 
|---|
 | 52 | double Polyn1D(double x,double *Par,double *DgDpar); 
 | 
|---|
 | 53 | 
 | 
|---|
 | 54 | double FitProp(double *x,double *y,double *ey,int *n,double *a1);
 | 
|---|
 | 55 | double FitLin(double *x,double *y,double *ey,int *n
 | 
|---|
 | 56 |              ,double *a0,double *a1);
 | 
|---|
 | 57 | double FitPar(double *x,double *y,double *ey,int *n
 | 
|---|
 | 58 |              ,double *a0,double *a1,double *a2);
 | 
|---|
 | 59 | double FitParLin(double *xx,double *y,double *ey,int *n,double x0,int Deg_d
 | 
|---|
 | 60 |                 ,double *a0,double *a1,double *b1,double *b2);
 | 
|---|
 | 61 | double FitPropClean(double *x,double *y,double *ey,int *n
 | 
|---|
 | 62 |                   ,double per_clean,double *a1);
 | 
|---|
 | 63 | double FitLinClean(double *x,double *y,double *ey,int *n
 | 
|---|
 | 64 |                   ,double per_clean,double *a0,double *a1);
 | 
|---|
 | 65 | double FitParClean(double *x,double *y,double *ey,int *n
 | 
|---|
 | 66 |                   ,double per_clean,double *a0,double *a1,double *a2);
 | 
|---|
 | 67 | 
 | 
|---|
 | 68 | float interpole(float x,int n,float *t1,float *t2);
 | 
|---|
 | 69 | 
 | 
|---|
 | 70 | int_4 MeanSig(float *mag,float *err,int_4 *ndata,float nsigma,float *mean,float *sigma);
 | 
|---|
 | 71 | int Most_Probable( float *val, int nval, float binin, int nmoy
 | 
|---|
 | 72 |                  , float low, float high, float *most, int deb);
 | 
|---|
 | 73 | float Ajust_GaFn(int Ns,float *fcfr
 | 
|---|
 | 74 |            ,float *haut,float *ehaut,float *mean,float *emean
 | 
|---|
 | 75 |            ,float *sigma,float *esigma,float *fond,float *efond
 | 
|---|
 | 76 |            ,int fixfond,int NBIN_RESOL
 | 
|---|
 | 77 |            ,float perc_net,float frac_sgb,float dyn_sgb,int deb);
 | 
|---|
 | 78 | float HFit_GaFn(int Ns,float *fcfr
 | 
|---|
 | 79 |            ,float *haut,float *ehaut,float *mean,float *emean
 | 
|---|
 | 80 |            ,float *sigma,float *esigma,float *fond,float *efond
 | 
|---|
 | 81 |            ,int fixfond,int nbin,float xmin,float xmax,int deb);
 | 
|---|
 | 82 | int Ajust_MnSg(int Ns,float *fcfr
 | 
|---|
 | 83 |            ,float *mean,float *emean,float *sigma,float *esigma
 | 
|---|
 | 84 |            ,float perc_net,float n_sigma,int deb);
 | 
|---|
 | 85 | 
 | 
|---|
 | 86 | float Int3DCube(float(*fonction)(float, float, float), float step, 
 | 
|---|
 | 87 |                float precision);
 | 
|---|
 | 88 | 
 | 
|---|
 | 89 | int IntFaisDr(int n,float *cs,float *sn,float *p,float *x0,float *y0
 | 
|---|
 | 90 |              ,int npass,float perclean,int lp);
 | 
|---|
 | 91 | 
 | 
|---|
| [2639] | 92 | double log_factoriel(unsigned int n);
 | 
|---|
 | 93 | double log_stirling(unsigned int n);
 | 
|---|
 | 94 | double log_gosper(unsigned int n);
 | 
|---|
 | 95 | double give_log_factoriel(unsigned int n);
 | 
|---|
 | 96 | 
 | 
|---|
| [220] | 97 | #ifdef __cplusplus
 | 
|---|
 | 98 | }
 | 
|---|
 | 99 | #endif
 | 
|---|
 | 100 | 
 | 
|---|
 | 101 | #endif
 | 
|---|