- params[i].nsamples = quotient;
- if (i < left) params[i].nsamples++;
-
- if (i == 0) {
- params[i].fo = fopen(cvsF, "w");
- fprintf(params[i].fo, "%d %d\n", NSAMPLES, M + 1);
- }
- else {
- sprintf(outF, "%s%d", cvsF, i);
- params[i].fo = fopen(outF, "w");
+ hasSeed ? engineFactory::init(seed) : engineFactory::init();
+ for (int i = 0; i < nThreads; i++) {
+ paramsArray[i].no = i;
+
+ paramsArray[i].nsamples = quotient;
+ if (i < left) paramsArray[i].nsamples++;
+
+ sprintf(outF, "%s%d", cvsF, i);
+ paramsArray[i].fo = fopen(outF, "w");
+
+ paramsArray[i].engine = engineFactory::new_engine();
+ paramsArray[i].pme_c = new double[M + 1];
+ memset(paramsArray[i].pme_c, 0, sizeof(double) * (M + 1));
+ paramsArray[i].pve_c = new double[M + 1];
+ memset(paramsArray[i].pve_c, 0, sizeof(double) * (M + 1));
+ paramsArray[i].pme_tpm = new double[M + 1];
+ memset(paramsArray[i].pme_tpm, 0, sizeof(double) * (M + 1));
+ paramsArray[i].pme_fpkm = new double[M + 1];
+ memset(paramsArray[i].pme_fpkm, 0, sizeof(double) * (M + 1));
+
+ paramsArray[i].pve_c_genes = new double[m];
+ memset(paramsArray[i].pve_c_genes, 0, sizeof(double) * m);
+
+ paramsArray[i].pve_c_trans = NULL;
+ if (alleleS) {
+ paramsArray[i].pve_c_trans = new double[m_trans];
+ memset(paramsArray[i].pve_c_trans, 0, sizeof(double) * m_trans);