/* This is get_lli.h */

struct initialization_gll {
        char header[1024];
        int nums, numr, numc;
        int nallparams;
        int dec_r;
        double qracc;
        int s_mstart, s_mend, s_sdstart, s_sdend, c_mstart, c_mend;
        int  c_sdstart, c_sdend, pstart;
        double ssdsum, csdsum;
        double *allparameters;
        double log_P;
	double **dprob_1_mat;
	double **dprob_2_mat;
	double **dprob_3_mat;
	double **dprob_mat;
        int **freq_mat;
        FILE *inPtr;
};


// Functions
void open_file( char gen_name [ 50 ], struct initialization_gll *isp );

void lcjcgll_init ( struct initialization_gll *isp );

void wsdo_logp ( struct initialization_gll *isp );

void missing_entry( double **dpmat, C struct initialization_gll *isp, int r_start, int r_end, double PRx );

double normal ( double x, double mu, double sigma );

double outerkernel ( double s,  void *infoptr, int nc );

double innerkernel ( double cj,  void *infoptr, int nc );

double eq3_wrap ( int r12, int ie3, int je3, double *pp, C struct initialization_gll *isp );

double eq3 ( int r12, int j, int n, double *mu, double *sigma, double mus, double sigmas,
		C struct initialization_gll *isp );

double eq3a_wrap ( int r12, int ie3a, int je3a, double *pp, C struct initialization_gll *isp );

double eq3a ( int r12, int j, int n, double *mu, double *sigma, double mus, double sigmas,
		C struct initialization_gll *isp );

int sdt ( int isdtx, struct initialization_gll *isp );

double Max(double a, double b);

void wsdo_l_f ( struct initialization_gll *isp );

void free_dm ( C struct initialization_gll *isp );
