22#include <gsl/gsl_errno.h>
23#include <lal/TriggerInterpolate.h>
24#include <lal/TriggerInterpolation.h>
27#define APPLY_FUNC(NAME, TYPE) \
28int XLAL ## TYPE ## Apply ## NAME ## TriggerInterpolant( \
29 NAME ## TriggerInterpolant *interp, \
35 double complex ymax_full; \
36 double complex data_full[2 * interp->window + 1]; \
37 double complex *const y_full = &data_full[interp->window]; \
38 for (int i = -(int)interp->window; i <= (int)interp->window; i ++) \
40 result = XLALTriggerInterpolate ## NAME(tmax, &ymax_full, y_full, interp->window); \
41 if (result == GSL_SUCCESS) \
48#define LEGACY_API(NAME) \
49struct tag ## NAME ## TriggerInterpolant { \
50 unsigned int window; \
53NAME ## TriggerInterpolant *XLALCreate ## NAME ## TriggerInterpolant(unsigned int window) \
55 NAME ## TriggerInterpolant *interp = malloc(sizeof(NAME ## TriggerInterpolant)); \
57 GSL_ERROR_NULL("Failed to allocate interpolant", GSL_ENOMEM); \
58 interp->window = window; \
62void XLALDestroy ## NAME ## TriggerInterpolant(NAME ## TriggerInterpolant *interp) \
67APPLY_FUNC(NAME, COMPLEX16) \
68APPLY_FUNC(NAME, COMPLEX8) \
69APPLY_FUNC(NAME, REAL8) \
70APPLY_FUNC(NAME, REAL4)