36 #include <lal/LALStdlib.h>
37 #include <lal/LALGSL.h>
38 #include <lal/LALConstants.h>
39 #include <gsl/gsl_sf.h>
40 #include <gsl/gsl_integration.h>
41 #include <gsl/gsl_errno.h>
44 #define UNUSED __attribute__ ((unused))
50 #define TESTSTATUS( pstatus, code ) \
51 if ( (pstatus)->statusCode != code ) { REPORTSTATUS(pstatus); exit(1); } \
55 extern gsl_error_handler_t *gsl_error_handler;
56 gsl_error_handler_t *original_handler;
58 if ( original_handler != gsl_error_handler ) \
59 { fprintf( stderr, "Error: handler was not restored!\n" ); exit(2); } \
67 ClearStatus(
status->statusPtr );
109 static double Heaviside(
double x,
void UNUSED * params )
116 memset( &newStatus, 0,
sizeof( newStatus ) );
119 Logarithm( &newStatus, &dummy,
x );
122 ClearStatus( &newStatus );
133 gsl_integration_workspace *work = NULL;
139 F.function = &Heaviside;
142 TRYGSL( work = gsl_integration_workspace_alloc( 100 ),
status );
143 CALLGSL( gsl_integration_qags( &F,
a, b,
eps,
eps, 100, work,
y, &err ),
146 TRYGSL( gsl_integration_workspace_free( work ),
status );
148 TRYGSL( gsl_integration_workspace_free( work ),
status );
170 original_handler = gsl_error_handler;
199 Integral( &
status, &
y, -1, 1, 1e-7 );
#define TRYGSL(statement, statusptr)
#define CALLGSL(statement, statusptr)
void LALCheckMemoryLeaks(void)
#define CHECKSTATUSPTR(statusptr)
#define ENDFAIL(statusptr)
#define TRY(func, statusptr)
#define ATTATCHSTATUSPTR(statusptr)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
#define BEGINFAIL(statusptr)
int main(int argc, char *argv[])
#define LAL_REAL8_EPS
Difference between 1 and the next resolvable REAL8 2^-52.
#define LAL_REAL8_MIN
Smallest normalized REAL8 number 2^-1022.
double REAL8
Double precision real floating-point number (8 bytes).
LAL status structure, see The LALStatus structure for more details.
INT4 statusCode
A numerical code identifying the type of error, or 0 for nominal status; Negative values are reserved...
void output(int gps_sec, int output_type)