45 int i;
int k;
int nuprime;
int offset=0;
int m;
int pass;
46 double sumUprime,sumU;
47 double jumpToNext,jumpToPrevious;
48 double chainToNext,chainToPrevious;
49 double aConst[101],uprime[101];
52 for(m=3,i=1,nuprime=1;i<101;i++)
55 for(k=1,jumpToNext=0.,jumpToPrevious=0.;k<=
m;k++)
58 if(bing[i] > 0 || bing[i+k] > 0)
59 jumpToNext +=
exp( (
double)(bing[i+k]-bing[i])
60 /
sqrt((
double)(bing[i+k]+bing[i])));
62 if(bing[i] > 0 || bing[i-k] > 0)
63 jumpToPrevious +=
exp( (
double)(bing[i-k]-bing[i])
64 /
sqrt((
double)(bing[i-k]+bing[i])));
68 if(jumpToNext > 0. && jumpToPrevious > 0.)
70 aConst[
i] = -
log(jumpToNext+jumpToPrevious);
71 chainToNext = aConst[
i]+
log(jumpToNext);
72 chainToPrevious = aConst[
i]+
log(jumpToPrevious);
73 uprime[
i]=chainToNext - chainToPrevious;
74 nuprime++;
u[nuprime] = uprime[
i];
76 { offset=i-1; pass=1;}
83 for(k=3,sumUprime=
u[2],sumU=
u[2];k<nuprime+1;k++)
85 sumU +=
u[
k];
u[
k] = sumU;
86 sumUprime +=
log(1.+
exp(
u[k]-
u[k-1]));
91 for(k=2;k<nuprime+1;k++)
94 for(i=1;i<offset+1;i++)
97 for(i=1;i<nuprime+1;i++)
110 int firstBin=0;
int lastBin=0;
111 double barycentre=0.;
117 for(
int i=1;
i<nu+1;
i++)
120 barycentre += (double)
i *
binu[
i];
121 if(
binu[
i] > maximum)
126 for(
int i=1,pass=0;
i<nu+1;
i++) {
127 if(
binu[
i] > maximum) {
138 peak[0] = (barycentre/sum);
139 peak[1]= (double)(lastBin-firstBin+1);
unsigned int offset(bool)