32 #include <lal/RngMedBias.h>
36 #define RNGMEDBIASTESTC_ENORM 0
37 #define RNGMEDBIASTESTC_ESUB 1
38 #define RNGMEDBIASTESTC_EARG 2
39 #define RNGMEDBIASTESTC_EBAD 3
40 #define RNGMEDBIASTESTC_EFILE 4
42 #define RNGMEDBIASTESTC_MSGENORM "Normal exit"
43 #define RNGMEDBIASTESTC_MSGESUB "Subroutine failed"
44 #define RNGMEDBIASTESTC_MSGEARG "Error parsing arguments"
45 #define RNGMEDBIASTESTC_MSGEBAD "Bad argument values"
46 #define RNGMEDBIASTESTC_MSGEFILE "Could not create output file"
53 #define USAGE "Usage: %s [-d debuglevel] [-b block size] \n"
60 #define ERROR( code, msg, statement ) \
62 if ( lalDebugLevel & LALERROR ) \
63 LALPrintError( "Error[0] %d: program %s, file %s, line %d, %s\n" \
64 " %s %s\n", (code), *argv, __FILE__, \
65 __LINE__, "$Id$", statement ? statement : \
69 #define INFO( statement ) \
71 if ( lalDebugLevel & LALINFO ) \
72 LALPrintError( "Info[0]: program %s, file %s, line %d, %s\n" \
73 " %s\n", *argv, __FILE__, __LINE__, \
74 "$Id$", (statement) ); \
77 #define SUB( func, statusptr ) \
79 if ( (func), (statusptr)->statusCode ) { \
80 ERROR( RNGMEDBIASTESTC_ESUB, RNGMEDBIASTESTC_MSGESUB, \
81 "Function call \"" #func "\" failed:" ); \
82 return RNGMEDBIASTESTC_ESUB; \
89 int main(
int argc,
char *argv[]){
100 while ( arg < argc ) {
102 if ( !strcmp( argv[arg],
"-d" ) ) {
103 if ( argc > arg + 1 ) {
111 else if ( !strcmp( argv[arg],
"-b" ) ) {
112 if ( argc > arg + 1 ) {
114 blkSize = atof(argv[arg++]);
134 printf(
"The correction factor for block size %d is: %1.15lf\n", blkSize, bias);
int main(int argc, char *argv[])
#define SUB(func, statusptr)
#define RNGMEDBIASTESTC_MSGENORM
#define ERROR(code, msg, statement)
#define RNGMEDBIASTESTC_ENORM
#define RNGMEDBIASTESTC_EARG
#define RNGMEDBIASTESTC_MSGEARG
double REAL8
Double precision real floating-point number (8 bytes).
int32_t INT4
Four-byte signed integer.
int LALPrintError(const char *fmt,...)
void LALRngMedBias(LALStatus *status, REAL8 *biasFactor, INT4 blkSize)
LAL status structure, see The LALStatus structure for more details.