From 2edea31a6c59a49ca60e4e3b291dac03b67eda01 Mon Sep 17 00:00:00 2001 From: Karl Wette <karl.wette@ligo.org> Date: Fri, 14 Mar 2025 14:23:35 +1100 Subject: [PATCH] lal/lib/tools/TriggerInterpolate.h: use LAL COMPLEX16 types --- lal/lib/tools/TriggerInterpolate.c | 12 ------------ lal/lib/tools/TriggerInterpolate.h | 25 +++++++++++-------------- lal/test/tools/TriggerInterpolateTest.c | 12 ------------ 3 files changed, 11 insertions(+), 38 deletions(-) diff --git a/lal/lib/tools/TriggerInterpolate.c b/lal/lib/tools/TriggerInterpolate.c index 65cfc5cd36..0c17151652 100644 --- a/lal/lib/tools/TriggerInterpolate.c +++ b/lal/lib/tools/TriggerInterpolate.c @@ -40,18 +40,6 @@ */ -static double complex crect(double real, double imag) -{ - return real + imag * I; -} - - -static double complex cpolar(double amp, double arg) -{ - return amp * crect(cos(arg), sin(arg)); -} - - /* Unwrap phase angles. All elements of arg must be between -M_PI and M_PI. */ static void unwrap(double *arg, size_t n) { diff --git a/lal/lib/tools/TriggerInterpolate.h b/lal/lib/tools/TriggerInterpolate.h index 423bbf56db..bd0cbada9a 100644 --- a/lal/lib/tools/TriggerInterpolate.h +++ b/lal/lib/tools/TriggerInterpolate.h @@ -23,8 +23,7 @@ #ifndef _TRIGGERINTERPOLATE_H #define _TRIGGERINTERPOLATE_H -/* SWIG bindings are not correct for these functions. */ -#ifndef SWIG +#include <lal/LALAtomicDatatypes.h> #if defined(__cplusplus) extern "C" { @@ -94,8 +93,8 @@ extern "C" { */ int XLALTriggerInterpolateCubicSplineAmpPhase( double *tmax, - double _Complex *ymax, - const double _Complex *y, + COMPLEX16 *ymax, + const COMPLEX16 *y, unsigned int window); @@ -110,8 +109,8 @@ int XLALTriggerInterpolateCubicSplineAmpPhase( */ int XLALTriggerInterpolateCubicSpline( double *tmax, - double _Complex *ymax, - const double _Complex *y, + COMPLEX16 *ymax, + const COMPLEX16 *y, unsigned int window); @@ -125,8 +124,8 @@ int XLALTriggerInterpolateCubicSpline( */ int XLALTriggerInterpolateLanczos( double *tmax, - double _Complex *ymax, - const double _Complex *y, + COMPLEX16 *ymax, + const COMPLEX16 *y, unsigned int window); @@ -138,8 +137,8 @@ int XLALTriggerInterpolateLanczos( */ int XLALTriggerInterpolateNearestNeighbor( double *tmax, - double _Complex *ymax, - const double _Complex *y, + COMPLEX16 *ymax, + const COMPLEX16 *y, unsigned int window); @@ -155,8 +154,8 @@ int XLALTriggerInterpolateNearestNeighbor( */ int XLALTriggerInterpolateQuadraticFit( double *tmax, - double _Complex *ymax, - const double _Complex *y, + COMPLEX16 *ymax, + const COMPLEX16 *y, unsigned int window); @@ -169,6 +168,4 @@ int XLALTriggerInterpolateQuadraticFit( } /* extern "C" */ #endif -#endif /* ifndef SWIG */ - #endif /* _TRIGGERINTERPOLATE_h */ diff --git a/lal/test/tools/TriggerInterpolateTest.c b/lal/test/tools/TriggerInterpolateTest.c index 07bb7e58c0..4daf17e99e 100644 --- a/lal/test/tools/TriggerInterpolateTest.c +++ b/lal/test/tools/TriggerInterpolateTest.c @@ -39,18 +39,6 @@ static double cpart(double complex z, int i) } -static double complex crect(double real, double imag) -{ - return real + imag * I; -} - - -static double complex cpolar(double amp, double arg) -{ - return amp * crect(cos(arg), sin(arg)); -} - - static double to_phase_angle(double arg) { arg = fmod(arg, 2 * M_PI); -- GitLab