#include "includes.h" #include "grid.h" #include "vector.h" #include extern ofstream errorfs; #include "declare.h" /* This file contains source code for functions that make objects needed by the estimation functions, from the data which has been inputted. That data may be shuffled, loci may be out of order, etc. These functions put it into a form that the estimation functions require. */ void makedatafrompeds(igrid &data, const pedvector &peds, const int &num_markers, const ivector &markers, const int &num_indiv, const ivector &indiv_list, const int &debug) { //this function makes the array of affected haplotypes/genotypes //from the peds object read from pedfile int h,t,i,j; for (t=0;trw) rw=rwtemp; } //initialize freqallele,freqfreq; if (rw>20) { errorfs << "Program cannot currently accept more than 20 alleles \n" << "per locus \n"; exit(1); } freqallele.init(rw,num_markers); freqfreq.init(rw,num_markers); //write to grids for (t=0;trw) rw=rwtemp; } //initialize freqallele,freqfreq; if (rw>20) { errorfs << "Program cannot currently accept more than 20 alleles \n" << "per locus \n"; exit(1); } freqallele.init(rw,num_markers); freqfreq.init(rw,num_markers); //write to grids for (t=0;trw) rw=rwtemp; } //initialize jointfreq2; jointfreq2.init(rw,num_markers-1); //fill in jointfreq2 for (t=0;t=0;i--) x[i]=x[i+1]+y[i]; for (i=C+1;i