Commit 3778f4b7 authored by Tyson Littenberg's avatar Tyson Littenberg
Browse files

fixed memory error in BayesWaveMCMC



git-svn-id: https://svn.ligo.caltech.edu/svn/bayeswave/trunk@560 c56465c9-8126-4a4f-9d7d-ac845eff4865
parent f9c369ba
......@@ -115,9 +115,9 @@ int main(int argc, char *argv[])
mode_t process_mask = umask(0);
mkdir("chains", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
mkdir("waveforms", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
mkdir("checkpoint",S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
if(data->checkpointFlag) mkdir("checkpoint",S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
sprintf(filename,"%ssnr",data->runName);
if(data->checkpointFlag) mkdir(filename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
mkdir(filename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
umask(process_mask);
// burstMDC injection
......
......@@ -1975,7 +1975,7 @@ void EvolveExtrinsicParameters(struct Data *data, struct Prior *prior, struct Mo
paramsx = model_x->extParams;
SnGeox = data->SnGeo;
paramsy = dvector(0,NE-1);
paramsy = dvector(0,NE);
SnGeoy = dvector(0,data->N/2);
dim = smodel->size;
......@@ -2193,7 +2193,7 @@ void EvolveExtrinsicParameters(struct Data *data, struct Prior *prior, struct Mo
free(glitch);
free_dvector(paramsy,0,NE-1);
free_dvector(paramsy,0,NE);
free_dvector(SnGeoy,0,iendN);
free_dmatrix(intParams,1,dim,0,4);
......
......@@ -88,16 +88,14 @@ void ComputeNoiseCorrelationMatrix(struct Data *data, double *Sn, struct Backgro
double invTobs = 1.0/data->Tobs;
double invTf = invTobs*background->invfref;
double amp = exp(background->logamp);
double f;
for(i=data->imin; i<data->imax; i++)
{
/*
Calculate network response to stochastic background parameters
*/
f = (double)(i)/data->Tobs;
x = f/background->fref;
//x = (double)i*invTf;
x = (double)i*invTf;
background->spectrum[i] = amp * powf(x,background->index);
......
......@@ -74,7 +74,10 @@ int checkrange(double *p, double **r)
{
int k;
for(k=0; k<=3; k++) if(p[k] < r[k][0] || p[k] > r[k][1])
if(p[4] < 0.0) p[4] += LAL_TWOPI;
if(p[4] >= LAL_TWOPI) p[4] -= LAL_TWOPI;
for(k=0; k<4; k++) if(p[k] < r[k][0] || p[k] > r[k][1])
{
//printf("parameter %i out of range (%g): [%g,%g]\n",k,p[k],r[k][0],r[k][1]);
return 1;
......
......@@ -213,7 +213,6 @@ void extrinsic_fisher_information_matrix(struct FisherMatrix *fisher, double *pa
double **s;
double stab;
double Tobs;
int NV;
struct Network *projectionP = malloc(sizeof(struct Network));
struct Network *projectionM = malloc(sizeof(struct Network));
......@@ -231,9 +230,6 @@ void extrinsic_fisher_information_matrix(struct FisherMatrix *fisher, double *pa
paramsP = dvector(0,NE-1);
paramsM = dvector(0,NE-1);
NV = NE;
// Plus and minus templates for each detector:
s = dmatrix(0,NI-1,0,N-1);
hP = dmatrix(0,NI-1,0,N-1);
......
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