47 double sumUprime, sumU;
48 double jumpToNext, jumpToPrevious;
49 double chainToNext, chainToPrevious;
50 double aConst[101], uprime[101];
53 for (
m = 3,
i = 1, nuprime = 1;
i < 101;
i++) {
55 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]) /
sqrt((
double)(bing[
i +
k] + bing[
i])));
60 if (bing[
i] > 0 || bing[
i -
k] > 0)
61 jumpToPrevious +=
exp((
double)(bing[
i -
k] - bing[
i]) /
sqrt((
double)(bing[
i -
k] + bing[
i])));
65 if (jumpToNext > 0. && jumpToPrevious > 0.) {
66 aConst[
i] = -
log(jumpToNext + jumpToPrevious);
67 chainToNext = aConst[
i] +
log(jumpToNext);
68 chainToPrevious = aConst[
i] +
log(jumpToPrevious);
69 uprime[
i] = chainToNext - chainToPrevious;
71 u[nuprime] = uprime[
i];
82 for (
k = 3, sumUprime =
u[2], sumU =
u[2];
k < nuprime + 1;
k++) {
90 for (
k = 2;
k < nuprime + 1;
k++)
96 for (
i = 1;
i < nuprime + 1;
i++) {
108 double barycentre = 0.;
114 for (
int i = 1;
i < nu + 1;
i++) {
116 barycentre += (double)
i *
binu[
i];
117 if (
binu[
i] > maximum) {
124 for (
int i = 1, pass = 0;
i < nu + 1;
i++) {
125 if (
binu[
i] > maximum) {
136 peak[0] = (barycentre / sum);
137 peak[1] = (double)(lastBin - firstBin + 1);