Commit 5e9cf340 authored by Vivien Raymond's avatar Vivien Raymond
Browse files

removed most warnings

Original: 2ab820c9789b4f67236b60e7f708a69b8334ee1a
parent 531011f7
......@@ -75,7 +75,7 @@ void SingleIFOLikelihoodTest(void);
void BasicMCMCTest(void);
void TemplateDumpTest(void);
void PTMCMCTest(void);
REAL8 FreqDomainNullLogLikelihood(LALIFOData *data);
// gsl_rng * InitializeRandomSeed(void);
// unsigned long int random_seed();
......@@ -102,7 +102,7 @@ LALInferenceRunState *initialize(ProcessParamsTable *commandLine)
{
LALInferenceRunState *irs=NULL;
LALIFOData *ifoPtr, *ifoListStart;
ProcessParamsTable *ppt=NULL;
//ProcessParamsTable *ppt=NULL;
unsigned long int randomseed;
struct timeval tv;
FILE *devrandom;
......@@ -293,17 +293,17 @@ void BasicMCMCLALProposal(LALInferenceRunState *runState, LALVariables *proposed
ra_proposed, dec_proposed, psi_proposed, dist_proposed;
REAL8 logProposalRatio = 0.0; // = log(P(backward)/P(forward))
gsl_rng * GSLrandom=runState->GSLrandom;
LALVariables * currentParams = runState->currentParams;
mc = *(REAL8*) getVariable(currentParams, "chirpmass"); /* solar masses*/
eta = *(REAL8*) getVariable(currentParams, "massratio"); /* dim-less */
iota = *(REAL8*) getVariable(currentParams, "inclination"); /* radian */
tc = *(REAL8*) getVariable(currentParams, "time"); /* GPS seconds */
phi = *(REAL8*) getVariable(currentParams, "phase"); /* radian */
ra = *(REAL8*) getVariable(currentParams, "rightascension"); /* radian */
dec = *(REAL8*) getVariable(currentParams, "declination"); /* radian */
psi = *(REAL8*) getVariable(currentParams, "polarisation"); /* radian */
dist = *(REAL8*) getVariable(currentParams, "distance"); /* Mpc */
LALVariables * currentParams_local = runState->currentParams;
mc = *(REAL8*) getVariable(currentParams_local, "chirpmass"); /* solar masses*/
eta = *(REAL8*) getVariable(currentParams_local, "massratio"); /* dim-less */
iota = *(REAL8*) getVariable(currentParams_local, "inclination"); /* radian */
tc = *(REAL8*) getVariable(currentParams_local, "time"); /* GPS seconds */
phi = *(REAL8*) getVariable(currentParams_local, "phase"); /* radian */
ra = *(REAL8*) getVariable(currentParams_local, "rightascension"); /* radian */
dec = *(REAL8*) getVariable(currentParams_local, "declination"); /* radian */
psi = *(REAL8*) getVariable(currentParams_local, "polarisation"); /* radian */
dist = *(REAL8*) getVariable(currentParams_local, "distance"); /* Mpc */
//mc_proposed = mc*(1.0+gsl_ran_ugaussian(GSLrandom)*0.01); /*mc changed by 1% */
// (above proposal is not symmetric!)
......@@ -322,7 +322,7 @@ void BasicMCMCLALProposal(LALInferenceRunState *runState, LALVariables *proposed
dist_proposed = dist * exp(gsl_ran_ugaussian(GSLrandom)*0.1); // ~10% change
logProposalRatio *= dist_proposed / dist;
copyVariables(currentParams, proposedParams);
copyVariables(currentParams_local, proposedParams);
setVariable(proposedParams, "chirpmass", &mc_proposed);
setVariable(proposedParams, "massratio", &eta_proposed);
setVariable(proposedParams, "inclination", &iota_proposed);
......@@ -357,6 +357,7 @@ REAL8 BasicUniformLALPrior(LALInferenceRunState *runState, LALVariables *params)
/* Prior is flat if within range */
/****************************************/
{
(void) runState; /* avoid warning about unused parameter */
REAL8 mc, eta, iota, phi, tc, ra, dec, psi, dist;
REAL8 logdensity;
......@@ -395,10 +396,10 @@ void ASinOmegaTProposal(LALInferenceRunState *runState, LALVariables *proposedPa
REAL8 A_proposed, Omega_proposed;
REAL8 logProposalRatio = 0.0; // = log(P(backward)/P(forward))
gsl_rng * GSLrandom=runState->GSLrandom;
LALVariables * currentParams = runState->currentParams;
LALVariables * currentParams_local = runState->currentParams;
A = *(REAL8*) getVariable(currentParams, "A"); /* dim-less */
Omega = *(REAL8*) getVariable(currentParams, "Omega"); /* rad/sec */
A = *(REAL8*) getVariable(currentParams_local, "A"); /* dim-less */
Omega = *(REAL8*) getVariable(currentParams_local, "Omega"); /* rad/sec */
//A_proposed=A*(1.0+gsl_ran_ugaussian(GSLrandom)*0.1); /*mc changed by 10% */
//Omega_proposed=Omega*(1.0+gsl_ran_ugaussian(GSLrandom)*0.01); /*Omega changed by 0.01*/
......@@ -410,7 +411,7 @@ void ASinOmegaTProposal(LALInferenceRunState *runState, LALVariables *proposedPa
Omega_proposed = Omega * exp(gsl_ran_ugaussian(GSLrandom)*0.01); // ~ 1% change
logProposalRatio *= Omega_proposed / Omega;
copyVariables(currentParams, proposedParams);
copyVariables(currentParams_local, proposedParams);
setVariable(proposedParams, "A", &A_proposed);
setVariable(proposedParams, "Omega", &Omega_proposed);
......@@ -434,6 +435,7 @@ REAL8 ASinOmegaTPrior(LALInferenceRunState *runState, LALVariables *params)
/* Prior is flat if within range */
/****************************************/
{
(void) runState; /* avoid warning about unused parameter */
REAL8 A, Omega;
REAL8 logdensity;
......@@ -498,7 +500,7 @@ void BasicMCMCOneStep(LALInferenceRunState *runState)
//Test LALAlgorithm
void MCMCAlgorithm(struct tagLALInferenceRunState *runState)
{
int i;
//int i;
REAL8 dummyR8;
printf(" MCMCAlgorithm(); starting parameter values:\n");
......@@ -525,7 +527,7 @@ void NelderMeadEval(struct tagLALInferenceRunState *runState,
// Evaluates Prior & Likelihood for a given (sub-) set of parameters.
// /!\ Side effect: alters value of "runState->currentParams" !
{
int i;
//int i;
// copy over (subset of) values from "value" argument
// (other parameter values, if any, remain as they are):
for (i=0; i<dim; ++i)
......@@ -573,7 +575,7 @@ void NelderMeadAlgorithm(struct tagLALInferenceRunState *runState, LALVariables
REAL8 epsilon = 0.001; // stop criterion
int maxiter = 500; // also stop criterion
int i, j;
//int i, j;
LALVariables param;
LALVariables startval;
char str[VARNAME_MAX];
......@@ -606,7 +608,7 @@ void NelderMeadAlgorithm(struct tagLALInferenceRunState *runState, LALVariables
if (i==0)
die(" ERROR in NelderMeadAlgorithm(): empty \"runstate->currentParams\" vector provided.\n");
for (j=1; j<=i; ++j) { // check "currentParams" entries and copy all REAL( values:
if (getVariableType(runstate->currentParams, j) == REAL8_t){
if (getVariableTypeByIndex(runstate->currentParams, j) == REAL8_t){
strcpy(str, getVariableName(runstate->currentParams, j));
addVariable(&param, str, getVariable(runstate->currentParams, str), REAL8_t, PARAM_LINEAR);
}
......@@ -1026,7 +1028,7 @@ void SingleIFOLikelihoodTest(void)
freqModel2=runstate->data->freqData->data;
//ComputeFreqDomainResponse(&currentParams, runstate->data, templateLAL, freqModel2);
FILE * freqModelFile=fopen("freqModelFile.dat", "w");
for(i=0; i<runstate->data->freqData->data->length; i++){
for(i=0; i<(int)runstate->data->freqData->data->length; i++){
fprintf(freqModelFile, "%g\t %g\t %g\t %g\t %g\t %g\n",
((double)i)*1.0/ (((double)runstate->data->timeData->data->length) * runstate->data->timeData->deltaT),
freqModel1->data[i].re, freqModel1->data[i].im, freqModel2->data[i].re, freqModel2->data[i].im,
......
......@@ -721,6 +721,9 @@ void printCommandLine(ProcessParamsTable *procparams, char *str)
/* ============ Likelihood computations: ========== */
REAL8 ZeroLogLikelihood(LALVariables *currentParams, LALIFOData *data, LALTemplateFunction *template) {
(void) currentParams; /* avoid warning about unused parameter */
(void) data; /* avoid warning about unused parameter */
(void) template; /* avoid warning about unused parameter */
return 0.0;
}
......@@ -1512,7 +1515,7 @@ REAL8 ComputeFrequencyDomainOverlap(LALIFOData * dataPtr,
}
void dumptemplateFreqDomain(LALVariables *currentParams, LALIFOData * data,
LALTemplateFunction *template, char *filename)
LALTemplateFunction *template, const char *filename)
/* de-bugging function writing (frequency-domain) template to a CSV file */
/* File contains real & imaginary parts of plus & cross components. */
/* Template amplitude is scaled to 1Mpc distance. */
......@@ -1552,7 +1555,7 @@ void dumptemplateFreqDomain(LALVariables *currentParams, LALIFOData * data,
void dumptemplateTimeDomain(LALVariables *currentParams, LALIFOData * data,
LALTemplateFunction *template, char *filename)
LALTemplateFunction *template, const char *filename)
/* de-bugging function writing (frequency-domain) template to a CSV file */
/* File contains real & imaginary parts of plus & cross components. */
/* Template amplitude is scaled to 1Mpc distance. */
......
......@@ -291,9 +291,9 @@ REAL8 NullLogLikelihood(LALIFOData *data);
REAL8 TimeDomainNullLogLikelihood(LALIFOData *data);
void dumptemplateFreqDomain(LALVariables *currentParams, LALIFOData * data,
LALTemplateFunction *template, char *filename);
LALTemplateFunction *template, const char *filename);
void dumptemplateTimeDomain(LALVariables *currentParams, LALIFOData * data,
LALTemplateFunction *template, char *filename);
LALTemplateFunction *template, const char *filename);
void executeFT(LALIFOData *IFOdata);
void executeInvFT(LALIFOData *IFOdata);
......
......@@ -221,7 +221,7 @@ LALIFOData *readData(ProcessParamsTable *commandLine)
&& strcmp(caches[i],"LALAdLIGO")))
{
FakeFlag=1;
datarandparam=XLALCreateRandomParams(dataseed?dataseed+i:dataseed);
datarandparam=XLALCreateRandomParams(dataseed?dataseed+(int)i:dataseed);
/* Selection of the noise curve */
if(!strcmp(caches[i],"LALLIGO")) {PSD = &LALLIGOIPsd; scalefactor=9E-46;}
if(!strcmp(caches[i],"LALVirgo")) {PSD = &LALVIRGOPsd; scalefactor=1.0;}
......
......@@ -5,7 +5,7 @@
#include <lal/Units.h>
#include <lal/RealFFT.h>
int main() {
int main(void) {
REAL8FrequencySeries *PSD;
REAL8TimeSeries *TDW;
REAL8FFTPlan *plan;
......
......@@ -7,7 +7,7 @@
#define MIN_INT(a, b) ((a) < (b) ? (a) : (b))
#define MAX_INT(a, b) ((a) > (b) ? (a) : (b))
int main() {
int main(void) {
REAL8TimeSeries *conv, *data, *response, *exactConv;
const UINT4 N = 101;
const LIGOTimeGPS zero = {0, 0};
......
......@@ -49,6 +49,7 @@
#include <lal/Units.h>
#include <lal/LALFrameL.h>
#include <lal/LALInspiral.h>
#include <lal/SeqFactories.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
#include <gsl/gsl_vector.h>
......@@ -3601,6 +3602,7 @@ void templateLALPPN(DataFramework *DF, vector *parameter, double Fplus, double F
/* uses LAL function "LALGeneratePPNInspiral()" */
/* "order" parameter doesn't (yet?) have an effect. */
{
(void) order; /* avoid warning about unused parameter */
double *timedomainwaveform=NULL;
double chirptime, timeshift;
long i,j, jStart;
......
......@@ -5,7 +5,7 @@
#include <lal/TimeFreqFFT.h>
#include <lal/Random.h>
int main() {
int main(void) {
const UINT4 N = 8192;
const UINT4 NPSD = N/2+1;
const REAL8 T = 8.38;
......
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