44 int i;
int k;
int nuprime;
int offset=0;
int m;
int pass;
45 double sumUprime,sumU;
46 double jumpToNext,jumpToPrevious;
47 double chainToNext,chainToPrevious;
48 double aConst[101],uprime[101];
51 for(m=3,i=1,nuprime=1;i<101;i++)
54 for(k=1,jumpToNext=0.,jumpToPrevious=0.;k<=
m;k++)
57 if(bing[i] > 0 || bing[i+k] > 0)
58 jumpToNext +=
exp( (
double)(bing[i+k]-bing[i])
59 /
sqrt((
double)(bing[i+k]+bing[i])));
61 if(bing[i] > 0 || bing[i-k] > 0)
62 jumpToPrevious +=
exp( (
double)(bing[i-k]-bing[i])
63 /
sqrt((
double)(bing[i-k]+bing[i])));
67 if(jumpToNext > 0. && jumpToPrevious > 0.)
69 aConst[
i] = -
log(jumpToNext+jumpToPrevious);
70 chainToNext = aConst[
i]+
log(jumpToNext);
71 chainToPrevious = aConst[
i]+
log(jumpToPrevious);
72 uprime[
i]=chainToNext - chainToPrevious;
73 nuprime++;
u[nuprime] = uprime[
i];
75 { offset=i-1; pass=1;}
82 for(k=3,sumUprime=
u[2],sumU=
u[2];k<nuprime+1;k++)
84 sumU +=
u[
k];
u[
k] = sumU;
85 sumUprime +=
log(1.+
exp(
u[k]-
u[k-1]));
90 for(k=2;k<nuprime+1;k++)
93 for(i=1;i<offset+1;i++)
96 for(i=1;i<nuprime+1;i++)
109 int firstBin=0;
int lastBin=0;
110 double barycentre=0.;
116 for(
int i=1;
i<nu+1;
i++)
119 barycentre += (double)
i *
binu[
i];
120 if(
binu[
i] > maximum)
125 for(
int i=1,pass=0;
i<nu+1;
i++) {
126 if(
binu[
i] > maximum) {
137 peak[0] = (barycentre/sum);
138 peak[1]= (double)(lastBin-firstBin+1);