static void mc_cal_y(bcf_p1aux_t *ma) { if (ma->n1 > 0 && ma->n1 < ma->n && ma->M == ma->n * 2) { // NB: ma->n1 is ineffective when there are haploid samples int k; long double x; memset(ma->z1, 0, sizeof(double) * (2 * ma->n1 + 1)); memset(ma->z2, 0, sizeof(double) * (2 * (ma->n - ma->n1) + 1)); ma->t1 = ma->t2 = 0.; mc_cal_y_core(ma, ma->n1); ma->t2 = ma->t; memcpy(ma->z2, ma->z, sizeof(double) * (2 * (ma->n - ma->n1) + 1)); mc_cal_y_core(ma, 0); // rescale z x = expl(ma->t - (ma->t1 + ma->t2)); for (k = 0; k <= ma->M; ++k) ma->z[k] *= x; } else mc_cal_y_core(ma, 0); }
static void mc_cal_y(bcf_p1aux_t *ma) { if (ma->n1 > 0 && ma->n1 < ma->n) { int k; long double x; memset(ma->z1, 0, sizeof(double) * (2 * ma->n1 + 1)); memset(ma->z2, 0, sizeof(double) * (2 * (ma->n - ma->n1) + 1)); ma->t1 = ma->t2 = 0.; mc_cal_y_core(ma, ma->n1); ma->t2 = ma->t; memcpy(ma->z2, ma->z, sizeof(double) * (2 * (ma->n - ma->n1) + 1)); mc_cal_y_core(ma, 0); // rescale z x = expl(ma->t - (ma->t1 + ma->t2)); for (k = 0; k <= ma->M; ++k) ma->z[k] *= x; } else mc_cal_y_core(ma, 0); }