#include <math.h>#include <lalapps.h>#include <lal/UserInput.h>#include <lal/LALConstants.h>Include dependency graph for compareFstats.c:

Go to the source code of this file.
Data Structures | |
| struct | FstatLine_t |
Defines | |
| #define | MAKEFAKEDATAC_ENORM 0 |
| #define | MAKEFAKEDATAC_ESUB 1 |
| #define | MAKEFAKEDATAC_EARG 2 |
| #define | MAKEFAKEDATAC_EBAD 3 |
| #define | MAKEFAKEDATAC_EFILE 4 |
| #define | MAKEFAKEDATAC_ENOARG 5 |
| #define | MAKEFAKEDATAC_EFORMAT 6 |
| #define | MAKEFAKEDATAC_MSGENORM "Normal exit" |
| #define | MAKEFAKEDATAC_MSGESUB "Subroutine failed" |
| #define | MAKEFAKEDATAC_MSGEARG "Error parsing arguments" |
| #define | MAKEFAKEDATAC_MSGEBAD "Bad argument values" |
| #define | MAKEFAKEDATAC_MSGEFILE "File IO error" |
| #define | MAKEFAKEDATAC_MSGENOARG "Missing argument" |
| #define | MAKEFAKEDATAC_MSGEFORMAT "Bad file format" |
| #define | TRUE (1==1) |
| #define | FALSE (1==0) |
| #define | max(x, y) ( (x) > (y) ? (x) : (y) ) |
| #define | MAX_ENTRIES 7 |
Functions | |
| RCSID ("$Id: compareFstats.c,v 1.24 2007/06/08 15:29:51 bema Exp $") | |
| void | initUserVars (LALStatus *) |
| void | compareClusterFiles (LALStatus *status, UINT4 *diff, LALParsedDataFile *f1, LALParsedDataFile *f2) |
| comparison specific to cluster-output files (7 entries ) | |
| void | compareFstatFiles (LALStatus *status, UINT4 *diff, LALParsedDataFile *f1, LALParsedDataFile *f2, REAL8 Ftol) |
| comparison specific to pure Fstat-output files (5 entries ) | |
| int | parse_Fstat_line (const CHAR *line, FstatLine_t *FstatLine) |
| REAL8 | relError (REAL8 x, REAL8 y) |
| int | main (int argc, char *argv[]) |
| MAIN function of SideBandMCMC code Compute the posterior pdfs of the orbital and nuisance parameters of a binary signal in Fstat form. | |
Variables | |
| CHAR * | uvar_Fname1 |
| CHAR * | uvar_Fname2 |
| BOOLEAN | uvar_help |
| BOOLEAN | uvar_clusterFiles |
| REAL8 | uvar_Ftolerance |
| #define MAKEFAKEDATAC_ENORM 0 |
Definition at line 43 of file compareFstats.c.
| #define MAKEFAKEDATAC_ESUB 1 |
Definition at line 44 of file compareFstats.c.
| #define MAKEFAKEDATAC_EARG 2 |
Definition at line 45 of file compareFstats.c.
| #define MAKEFAKEDATAC_EBAD 3 |
Definition at line 46 of file compareFstats.c.
| #define MAKEFAKEDATAC_EFILE 4 |
Definition at line 47 of file compareFstats.c.
| #define MAKEFAKEDATAC_ENOARG 5 |
Definition at line 48 of file compareFstats.c.
| #define MAKEFAKEDATAC_EFORMAT 6 |
Definition at line 49 of file compareFstats.c.
| #define MAKEFAKEDATAC_MSGENORM "Normal exit" |
Definition at line 51 of file compareFstats.c.
| #define MAKEFAKEDATAC_MSGESUB "Subroutine failed" |
Definition at line 52 of file compareFstats.c.
| #define MAKEFAKEDATAC_MSGEARG "Error parsing arguments" |
Definition at line 53 of file compareFstats.c.
| #define MAKEFAKEDATAC_MSGEBAD "Bad argument values" |
Definition at line 54 of file compareFstats.c.
| #define MAKEFAKEDATAC_MSGEFILE "File IO error" |
Definition at line 55 of file compareFstats.c.
| #define MAKEFAKEDATAC_MSGENOARG "Missing argument" |
Definition at line 56 of file compareFstats.c.
| #define MAKEFAKEDATAC_MSGEFORMAT "Bad file format" |
Definition at line 57 of file compareFstats.c.
| #define TRUE (1==1) |
Definition at line 62 of file compareFstats.c.
| #define FALSE (1==0) |
Definition at line 63 of file compareFstats.c.
| #define MAX_ENTRIES 7 |
Definition at line 364 of file compareFstats.c.
| RCSID | ( | "$Id: compareFstats. | c, | |
| v 1.24 2007/06/08 15:29:51 bema Exp $" | ||||
| ) |
| void initUserVars | ( | LALStatus * | ) |
| void compareClusterFiles | ( | LALStatus * | status, | |
| UINT4 * | diff, | |||
| LALParsedDataFile * | f1, | |||
| LALParsedDataFile * | f2 | |||
| ) |
comparison specific to cluster-output files (7 entries )
Definition at line 183 of file compareFstats.c.
| void compareFstatFiles | ( | LALStatus * | status, | |
| UINT4 * | diff, | |||
| LALParsedDataFile * | f1, | |||
| LALParsedDataFile * | f2, | |||
| REAL8 | Ftol | |||
| ) |
comparison specific to pure Fstat-output files (5 entries )
Definition at line 277 of file compareFstats.c.
| int parse_Fstat_line | ( | const CHAR * | line, | |
| FstatLine_t * | FstatLine | |||
| ) |
Definition at line 366 of file compareFstats.c.
Definition at line 415 of file compareFstats.c.
| int main | ( | int | argc, | |
| char * | argv[] | |||
| ) |
MAIN function of SideBandMCMC code Compute the posterior pdfs of the orbital and nuisance parameters of a binary signal in Fstat form.
..
variable declarations
the status must be initially blank; this can be done by making it static:
static LALStatus status;
other variables:
ExampleOutput output; ExampleInput input; ExampleParams params;
parse arguments, if desired
for example:
program = *argv; while ( --argc > 0 ) { ++argv; if ( ! strcmp( *argv, "-d" ) ) { --argc; ++argv; lalDebugLevel = atoi( *argv ); continue; } if ( ! strcmp( *argv, "-v" ) ) { verbose = 1; continue; } if ( ! strcmp( *argv, "-h" ) ) { fprintf( stderr, usage, program ); return 0; } fprintf( stderr, "no such option %s\n", *argv ); fprintf( stderr, usage, program ); return FAIL_ARGS; }
/** test response to invalid data
these tests must be wrapped so they are not done when debugging is disabled:
ifndef LAL_NDEBUG if ( ! lalNoDebug ) { LALExample( &status, NULL, &input, ¶ms ); if ( status.statusCode != EXAMPLEH_ENULL || strcmp( status.statusDescription, EXAMPLEH_MSGENULL ) ) { fprintf( stderr, "incorrect error code %d and message %s\n", status.statusCode, status.statusDescription ); fprintf( stderr, "expecting error code %d and message %s\n", EXAMPLEH_ENULL, EXAMPLEH_MSGENULL ); return FAIL_CODE; }
fputs( "PASS: Test response to invalid data\n", stderr ); } endif
test response to valid data
for example:
LALExample( &status, &output, &input, ¶m ); if ( status.statusCode ) { fprintf( stderr, "received error code %d and message %s\n", status.statusCode, status.statusDescription ); return FAIL_ESUB; }
(perform checks on the contents of output too!)
during default operation, output to the screen should be minimal:
for ( i = 0; i < 1048576; ++i ) printf( "%d\n", i ); !!! BAD !!!
but it is OK to indicate that tests have passed:
fputs( "PASS: Test response to valid data\n", stderr );
check for memory leaks and return success:
LALCheckMemoryLeaks(); fputs( "PASS: All tests\n" );
Definition at line 100 of file compareFstats.c.
Definition at line 79 of file compareFstats.c.
Definition at line 80 of file compareFstats.c.
Definition at line 81 of file compareFstats.c.
Definition at line 82 of file compareFstats.c.
Definition at line 83 of file compareFstats.c.
1.5.2