source: Sophya/trunk/SophyaLib/NTools/nbmath.h@ 3868

Last change on this file since 3868 was 2639, checked in by cmv, 21 years ago

factoriel et approx cmv 22/11/04

File size: 3.9 KB
Line 
1/* quelques fonctions mathematiques et constantes utiles */
2/* cmv 23/06/94 */
3#ifndef NBMATH_H_SEEN
4#define NBMATH_H_SEEN
5
6#include "machdefs.h"
7#include "smathconst.h"
8
9#ifdef __cplusplus
10extern "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
18union FloatDouble { float *fx; double *dx; };
19typedef union FloatDouble FLOATDOUBLE;
20
21double 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
28double GausPiv(double *A,int_4 nca,int_4 n,double *B,int_4 ncb,int_4 m,int_4 Inv);
29
30int_4 paramga(float sxin, float syin, float rhoin
31 , float *smax, float *axisrat, float *tiltdeg);
32int_4 gaparam(float smax, float axisrat, float tiltdeg
33 , float *sxin, float *syin, float *rhoin);
34
35double nberfc(double x);
36float probnb(float sci2,int_4 inddl,int_4 *ipass);
37double nbgammln(double xx);
38double nbgammq(double a,double x);
39double nbgammp(double a,double x);
40
41void Set_Ihoq(int degre,int *mIhoqN,double *IhoqNX,double *IhoqNW);
42int Get_Ihoq(int degre,double *IhoqNX,double *IhoqNW);
43void nbgauleg(double x1,double x2,double *x,double *w,int n);
44double Integ_Fun(double xmin,double xmax,double (*fonc)(double),int npas);
45double Integ_Fun_2D(double (*fonc)(double x,double y)
46 ,double xmin,double xmax,double ymin,double ymax
47 ,int npasx,int npasy);
48
49void Set_FitFunDPol(int DPol);
50double Gauss1DPolF(double x,double *Par,double *DgDpar);
51double GaussI1DPol(double x,double *Par,double *DgDpar);
52double Polyn1D(double x,double *Par,double *DgDpar);
53
54double FitProp(double *x,double *y,double *ey,int *n,double *a1);
55double FitLin(double *x,double *y,double *ey,int *n
56 ,double *a0,double *a1);
57double FitPar(double *x,double *y,double *ey,int *n
58 ,double *a0,double *a1,double *a2);
59double FitParLin(double *xx,double *y,double *ey,int *n,double x0,int Deg_d
60 ,double *a0,double *a1,double *b1,double *b2);
61double FitPropClean(double *x,double *y,double *ey,int *n
62 ,double per_clean,double *a1);
63double FitLinClean(double *x,double *y,double *ey,int *n
64 ,double per_clean,double *a0,double *a1);
65double FitParClean(double *x,double *y,double *ey,int *n
66 ,double per_clean,double *a0,double *a1,double *a2);
67
68float interpole(float x,int n,float *t1,float *t2);
69
70int_4 MeanSig(float *mag,float *err,int_4 *ndata,float nsigma,float *mean,float *sigma);
71int Most_Probable( float *val, int nval, float binin, int nmoy
72 , float low, float high, float *most, int deb);
73float 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);
78float 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);
82int 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
86float Int3DCube(float(*fonction)(float, float, float), float step,
87 float precision);
88
89int IntFaisDr(int n,float *cs,float *sn,float *p,float *x0,float *y0
90 ,int npass,float perclean,int lp);
91
92double log_factoriel(unsigned int n);
93double log_stirling(unsigned int n);
94double log_gosper(unsigned int n);
95double give_log_factoriel(unsigned int n);
96
97#ifdef __cplusplus
98}
99#endif
100
101#endif
Note: See TracBrowser for help on using the repository browser.