Commit f90088e6 authored by Marcella Wijngaarden's avatar Marcella Wijngaarden
Browse files

Some memory cleanup

parent 08845948
...@@ -41,7 +41,6 @@ struct bayesCBC ...@@ -41,7 +41,6 @@ struct bayesCBC
int intrinsic_only; // evolve only semi-intrinsic parameters (NX), not sky int intrinsic_only; // evolve only semi-intrinsic parameters (NX), not sky
double gmst; double gmst;
double *logLx; double *logLx;
double *detLogL; // holds likelihood for each detector for current chain
double **pallx; double **pallx;
gsl_rng **rvec; // holds r for each cbc chain gsl_rng **rvec; // holds r for each cbc chain
// (temporarily as needed when running multitheaded) // (temporarily as needed when running multitheaded)
......
...@@ -1485,9 +1485,6 @@ double log_likelihood_full(struct Net *net, double **D, double *params, RealVect ...@@ -1485,9 +1485,6 @@ double log_likelihood_full(struct Net *net, double **D, double *params, RealVect
rho[id] = HD/sqrt(HH); rho[id] = HD/sqrt(HH);
logLdet = HD-0.5*HH; logLdet = HD-0.5*HH;
logL += logLdet; logL += logLdet;
// Store likelihood for individual detectors for BW
rundata->detLogL[id] = logLdet;
} }
// Set sky back to inclination instead of epsilon // Set sky back to inclination instead of epsilon
......
...@@ -992,10 +992,29 @@ void reset_likelihood(struct Data *data) ...@@ -992,10 +992,29 @@ void reset_likelihood(struct Data *data)
void free_bayescbc(struct bayesCBC *bayescbc, struct Data *data, struct Chain *chain) void free_bayescbc(struct bayesCBC *bayescbc, struct Data *data, struct Chain *chain)
{ {
// TODO int i;
free_double_vector(bayescbc->logLx);
// TODO freq, net
fclose(bayescbc->chainA);
fclose(bayescbc->chainA); free_double_vector(bayescbc->logLx);
free_double_tensor(bayescbc->global,bayescbc->NQ,bayescbc->NM);
free_double_matrix(bayescbc->skyx,bayescbc->NC);
free_int_vector(bayescbc->who);
free_double_vector(bayescbc->heat);
free_double_matrix(bayescbc->paramx,bayescbc->NC);
free_double_tensor(bayescbc->history,bayescbc->NH+1,bayescbc->NX);
free_int_vector(bayescbc->mxc);
free_double_matrix(bayescbc->pallx,bayescbc->NX);
free_double_matrix(bayescbc->D,data->NI);
free_double_matrix(bayescbc->SN,data->NI);
//MT modification
for(i=0;i<bayescbc->NC;i++){
gsl_rng_free(bayescbc->rvec[i]);
}
free(bayescbc->rvec);
} }
...@@ -1080,8 +1099,6 @@ void initialize_bayescbc(struct bayesCBC *bayescbc, struct Data *data, struct Ch ...@@ -1080,8 +1099,6 @@ void initialize_bayescbc(struct bayesCBC *bayescbc, struct Data *data, struct Ch
} }
} }
// detLogL stores the likelihood in each detector (for quick computation of full logL) for current chain
bayescbc->detLogL = double_vector(NI-1);
bayescbc->who = chain->index; bayescbc->who = chain->index;
// Set prior range BayesCBC // Set prior range BayesCBC
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment