Commit 6867c404 authored by Kipp Cannon's avatar Kipp Cannon
Browse files

lal fft: remove deprecated LAL fft routines

- this completes the removal of the LALStatus structure from the fft package
parent 06a518a9
......@@ -23,7 +23,6 @@
#include <gsl/gsl_sf_gamma.h>
#include <lal/FrequencySeries.h>
#include <lal/LALAtomicDatatypes.h>
#include <lal/LALStdlib.h>
#include <lal/LALConstants.h>
#include <lal/AVFactories.h>
#include <lal/Sequence.h>
......
......@@ -19,13 +19,16 @@
#include <config.h>
#include <complex.h>
#include <fftw3.h>
#include <string.h>
#include <lal/LALStdlib.h>
#include <lal/AVFactories.h>
#include <lal/ComplexFFT.h>
#include <lal/FFTWMutex.h>
#include <lal/LALConfig.h> /* Needed to know whether aligning memory */
#include <lal/LALMalloc.h>
#include <lal/XLALError.h>
/**
* \addtogroup ComplexFFT_h
......
......@@ -20,7 +20,6 @@
#ifndef _COMPLEXFFT_H
#define _COMPLEXFFT_H
#include <lal/LALStdlib.h>
#include <lal/LALDatatypes.h>
#if defined(__cplusplus)
......@@ -47,35 +46,6 @@ extern "C" {
*/
/*@{*/
/** \name Error Codes */
/*@{*/
#define COMPLEXFFTH_ENULL 1 /**< Null pointer */
#define COMPLEXFFTH_ENNUL 2 /**< Non-null pointer */
#define COMPLEXFFTH_ESIZE 4 /**< Invalid input size */
#define COMPLEXFFTH_ESZMM 8 /**< Size mismatch */
#define COMPLEXFFTH_ESLEN 16 /**< Invalid/mismatched sequence lengths */
#define COMPLEXFFTH_ESAME 32 /**< Input/Output data vectors are the same */
#define COMPLEXFFTH_EALOC 64 /**< Memory allocation failed */
#define COMPLEXFFTH_EFFTW 128 /**< Error in FFTW */
#define COMPLEXFFTH_ESNGL 256 /**< FFTW library is not single-precision */
#define COMPLEXFFTH_EINTL 512 /**< Error in Intel FFT library */
#define COMPLEXFFTH_ESIGN 1024 /**< Unknown sign of transform in plan */
/*@}*/
/** \cond DONT_DOXYGEN */
#define COMPLEXFFTH_MSGENULL "Null pointer"
#define COMPLEXFFTH_MSGENNUL "Non-null pointer"
#define COMPLEXFFTH_MSGESIZE "Invalid input size"
#define COMPLEXFFTH_MSGESZMM "Size mismatch"
#define COMPLEXFFTH_MSGESLEN "Invalid/mismatched sequence lengths"
#define COMPLEXFFTH_MSGESAME "Input/Output data vectors are the same"
#define COMPLEXFFTH_MSGEALOC "Memory allocation failed"
#define COMPLEXFFTH_MSGEFFTW "Error in FFTW"
#define COMPLEXFFTH_MSGESNGL "FFTW library is not single-precision"
#define COMPLEXFFTH_MSGEINTL "Error in Intel FFT library"
#define COMPLEXFFTH_MSGESIGN "Unknown sign of transform in plan"
/** \endcond */
/** Plan to perform FFT of COMPLEX8 data */
typedef struct tagCOMPLEX8FFTPlan COMPLEX8FFTPlan;
/** Plan to perform FFT of COMPLEX16 data */
......@@ -359,126 +329,6 @@ void XLALDestroyCOMPLEX16FFTPlan( COMPLEX16FFTPlan *plan );
*/
int XLALCOMPLEX16VectorFFT( COMPLEX16Vector * _LAL_RESTRICT_ output, const COMPLEX16Vector * _LAL_RESTRICT_ input, const COMPLEX16FFTPlan *plan );
/*
*
* LAL COMPLEX8 functions
*
*/
/**
* \b DEPRECATED
* @deprecated Use XLALCreateForwardCOMPLEX8FFTPlan() instead.
*/
void
LALCreateForwardCOMPLEX8FFTPlan(
LALStatus *status,
COMPLEX8FFTPlan **plan,
UINT4 size,
INT4 measure
);
/**
* \b DEPRECATED
* @deprecated Use XLALCreateForwardCOMPLEX8FFTPlan() instead.
*/
#define LALCreateForwardComplexFFTPlan LALCreateForwardCOMPLEX8FFTPlan
/**
* \b DEPRECATED
* @deprecated Use XLALCreateReverseCOMPLEX8FFTPlan() instead.
*/
void
LALCreateReverseCOMPLEX8FFTPlan(
LALStatus *status,
COMPLEX8FFTPlan **plan,
UINT4 size,
INT4 measure
);
/**
* \b DEPRECATED
* @deprecated Use XLALCreateReverseCOMPLEX8FFTPlan() instead.
*/
#define LALCreateReverseComplexFFTPlan LALCreateReverseCOMPLEX8FFTPlan
/**
* \b DEPRECATED
* @deprecated Use XLALDestroyCOMPLEX8FFTPlan() instead.
*/
void
LALDestroyCOMPLEX8FFTPlan (
LALStatus *status,
COMPLEX8FFTPlan **plan
);
/**
* \b DEPRECATED
* @deprecated Use XLALDestroyCOMPLEX8FFTPlan() instead.
*/
#define LALDestroyComplexFFTPlan LALDestroyCOMPLEX8FFTPlan
/**
* \b DEPRECATED
* @deprecated Use XLALCOMPLEX8VectorFFT() instead.
*/
void
LALCOMPLEX8VectorFFT (
LALStatus *status,
COMPLEX8Vector *output,
COMPLEX8Vector *input,
COMPLEX8FFTPlan *plan
);
/*
*
* LAL COMPLEX16 functions
*
*/
/**
* \b DEPRECATED
* @deprecated Use XLALCreateForwardCOMPLEX16FFTPlan() instead.
*/
void
LALCreateForwardCOMPLEX16FFTPlan(
LALStatus *status,
COMPLEX16FFTPlan **plan,
UINT4 size,
INT4 measure
);
/**
* \b DEPRECATED
* @deprecated Use XLALCreateReverseCOMPLEX16FFTPlan() instead.
*/
void
LALCreateReverseCOMPLEX16FFTPlan(
LALStatus *status,
COMPLEX16FFTPlan **plan,
UINT4 size,
INT4 measure
);
/**
* \b DEPRECATED
* @deprecated Use XLALDestroyCOMPLEX16FFTPlan() instead.
*/
void
LALDestroyCOMPLEX16FFTPlan (
LALStatus *status,
COMPLEX16FFTPlan **plan
);
/**
* \b DEPRECATED
* @deprecated Use XLALCOMPLEX16VectorFFT() instead.
*/
void
LALCOMPLEX16VectorFFT (
LALStatus *status,
COMPLEX16Vector *output,
COMPLEX16Vector *input,
COMPLEX16FFTPlan *plan
);
/*@}*/
#if 0
......
......@@ -209,141 +209,6 @@ int VECTOR_FFT_FUNCTION(COMPLEX_VECTOR_TYPE * _LAL_RESTRICT_ output, const COMPL
return 0;
}
/*
* Legacy Routines
*/
#define OLD_CREATE_FORWARD_PLAN_FUNCTION CONCAT2(LALCreateForward,PLAN_TYPE)
#define OLD_CREATE_REVERSE_PLAN_FUNCTION CONCAT2(LALCreateReverse,PLAN_TYPE)
#define OLD_DESTROY_PLAN_FUNCTION CONCAT2(LALDestroy,PLAN_TYPE)
#define OLD_VECTOR_FFT_FUNCTION CONCAT3(LAL,COMPLEX_VECTOR_TYPE,FFT)
void OLD_CREATE_FORWARD_PLAN_FUNCTION(LALStatus * status, PLAN_TYPE ** plan, UINT4 size, INT4 measure)
{
INITSTATUS(status);
XLAL_PRINT_DEPRECATION_WARNING(STRING(CREATE_FORWARD_PLAN_FUNCTION));
ASSERT(plan, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL);
ASSERT(!*plan, status, COMPLEXFFTH_ENNUL, COMPLEXFFTH_MSGENNUL);
ASSERT(size > 0, status, COMPLEXFFTH_ESIZE, COMPLEXFFTH_MSGESIZE);
*plan = CREATE_FORWARD_PLAN_FUNCTION(size, measure);
if (!*plan) {
int code = xlalErrno;
XLALClearErrno();
switch (code) {
case XLAL_EBADLEN:
ABORT(status, COMPLEXFFTH_ESIZE, COMPLEXFFTH_MSGESIZE);
case XLAL_ENOMEM:
ABORT(status, COMPLEXFFTH_EALOC, COMPLEXFFTH_MSGEALOC);
case XLAL_EFAILED:
ABORT(status, COMPLEXFFTH_EFFTW, COMPLEXFFTH_MSGEFFTW);
default:
ABORTXLAL(status);
}
}
RETURN(status);
}
void OLD_CREATE_REVERSE_PLAN_FUNCTION(LALStatus * status, PLAN_TYPE ** plan, UINT4 size, INT4 measure)
{
INITSTATUS(status);
XLAL_PRINT_DEPRECATION_WARNING(STRING(CREATE_REVERSE_PLAN_FUNCTION));
ASSERT(plan, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL);
ASSERT(!*plan, status, COMPLEXFFTH_ENNUL, COMPLEXFFTH_MSGENNUL);
ASSERT(size > 0, status, COMPLEXFFTH_ESIZE, COMPLEXFFTH_MSGESIZE);
*plan = CREATE_REVERSE_PLAN_FUNCTION(size, measure);
if (!*plan) {
int code = xlalErrno;
XLALClearErrno();
switch (code) {
case XLAL_EBADLEN:
ABORT(status, COMPLEXFFTH_ESIZE, COMPLEXFFTH_MSGESIZE);
case XLAL_ENOMEM:
ABORT(status, COMPLEXFFTH_EALOC, COMPLEXFFTH_MSGEALOC);
case XLAL_EFAILED:
ABORT(status, COMPLEXFFTH_EFFTW, COMPLEXFFTH_MSGEFFTW);
default:
ABORTXLAL(status);
}
}
RETURN(status);
}
void OLD_DESTROY_PLAN_FUNCTION(LALStatus * status, PLAN_TYPE ** plan)
{
INITSTATUS(status);
XLAL_PRINT_DEPRECATION_WARNING(STRING(DESTROY_PLAN_FUNCTION));
ASSERT(plan, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL);
ASSERT(*plan, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL);
DESTROY_PLAN_FUNCTION(*plan);
if (xlalErrno) {
int code = xlalErrno;
XLALClearErrno();
switch (code) {
case XLAL_EINVAL:
ABORT(status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL);
default:
ABORTXLAL(status);
}
}
RETURN(status);
}
void OLD_VECTOR_FFT_FUNCTION(LALStatus * status, COMPLEX_VECTOR_TYPE * output, COMPLEX_VECTOR_TYPE * input, PLAN_TYPE * plan)
{
int code;
INITSTATUS(status);
XLAL_PRINT_DEPRECATION_WARNING(STRING(VECTOR_FFT_FUNCTION));
ASSERT(output, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL);
ASSERT(input, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL);
ASSERT(plan, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL);
ASSERT(output->data, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL);
ASSERT(input->data, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL);
/* make sure that it is not the same data! */
ASSERT(output->data != input->data, status, COMPLEXFFTH_ESAME, COMPLEXFFTH_MSGESAME);
/* make sure that the lengths agree */
ASSERT(plan->size > 0, status, COMPLEXFFTH_ESIZE, COMPLEXFFTH_MSGESIZE);
ASSERT(output->length == plan->size, status, COMPLEXFFTH_ESZMM, COMPLEXFFTH_MSGESZMM);
ASSERT(input->length == plan->size, status, COMPLEXFFTH_ESZMM, COMPLEXFFTH_MSGESZMM);
code = VECTOR_FFT_FUNCTION(output, input, plan);
if (code) {
code = xlalErrno;
XLALClearErrno();
switch (code) {
case XLAL_EINVAL:
if (!plan->size) { /* plan size was invalid */
ABORT(status, COMPLEXFFTH_ESIZE, COMPLEXFFTH_MSGESIZE);
} else if (output->data == input->data) { /* same data pointers */
ABORT(status, COMPLEXFFTH_ESAME, COMPLEXFFTH_MSGESAME);
} else { /* one of the data pointers was NULL */
ABORT(status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL);
}
case XLAL_EBADLEN: /* size mismatch */
ABORT(status, COMPLEXFFTH_ESZMM, COMPLEXFFTH_MSGESZMM);
default:
ABORTXLAL(status);
}
}
RETURN(status);
}
#undef OLD_CREATE_FORWARD_PLAN_FUNCTION
#undef OLD_CREATE_REVERSE_PLAN_FUNCTION
#undef OLD_DESTROY_PLAN_FUNCTION
#undef OLD_VECTOR_FFT_FUNCTION
#undef CONCAT2x
#undef CONCAT2
#undef CONCAT3x
......
......@@ -22,7 +22,6 @@
#include <string.h>
#include <lal/AVFactories.h>
#include <lal/Calibration.h>
#include <lal/LALStdlib.h>
#include <lal/LALConstants.h>
#include <lal/TimeFreqFFT.h>
#include <lal/Units.h>
......
......@@ -21,7 +21,6 @@
#include <lal/LALDatatypes.h>
#include <lal/LALMalloc.h>
#include <lal/LALStatusMacros.h>
#include <lal/XLALError.h>
#include <lal/ComplexFFT.h>
#include <lal/CudaPlan.h>
......@@ -293,348 +292,3 @@ int XLALCOMPLEX16VectorFFT( COMPLEX16Vector * _LAL_RESTRICT_ output, const COMPL
);
return 0;
}
/*
*
* LAL COMPLEX8 functions
*
*/
void
LALCreateForwardCOMPLEX8FFTPlan(
LALStatus *status,
COMPLEX8FFTPlan **plan,
UINT4 size,
INT4 measure
)
{
INITSTATUS(status);
XLAL_PRINT_DEPRECATION_WARNING("XLALCreateForwardCOMPLEX8FFTPlan");
ASSERT( plan, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL );
ASSERT( ! *plan, status, COMPLEXFFTH_ENNUL, COMPLEXFFTH_MSGENNUL );
ASSERT( size > 0, status, COMPLEXFFTH_ESIZE, COMPLEXFFTH_MSGESIZE );
*plan = XLALCreateCOMPLEX8FFTPlan( size, 1, measure );
if ( ! *plan )
{
int code = xlalErrno;
XLALClearErrno();
switch ( code )
{
case XLAL_EBADLEN:
ABORT( status, COMPLEXFFTH_ESIZE, COMPLEXFFTH_MSGESIZE );
case XLAL_ENOMEM:
ABORT( status, COMPLEXFFTH_EALOC, COMPLEXFFTH_MSGEALOC );
case XLAL_EFAILED:
ABORT( status, COMPLEXFFTH_EFFTW, COMPLEXFFTH_MSGEFFTW );
default:
ABORTXLAL( status );
}
}
RETURN( status );
}
void
LALCreateReverseCOMPLEX8FFTPlan(
LALStatus *status,
COMPLEX8FFTPlan **plan,
UINT4 size,
INT4 measure
)
{
INITSTATUS(status);
XLAL_PRINT_DEPRECATION_WARNING("XLALCreateReverseCOMPLEX8FFTPlan");
ASSERT( plan, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL );
ASSERT( ! *plan, status, COMPLEXFFTH_ENNUL, COMPLEXFFTH_MSGENNUL );
ASSERT( size > 0, status, COMPLEXFFTH_ESIZE, COMPLEXFFTH_MSGESIZE );
*plan = XLALCreateCOMPLEX8FFTPlan( size, 0, measure );
if ( ! *plan )
{
int code = xlalErrno;
XLALClearErrno();
switch ( code )
{
case XLAL_EBADLEN:
ABORT( status, COMPLEXFFTH_ESIZE, COMPLEXFFTH_MSGESIZE );
case XLAL_ENOMEM:
ABORT( status, COMPLEXFFTH_EALOC, COMPLEXFFTH_MSGEALOC );
case XLAL_EFAILED:
ABORT( status, COMPLEXFFTH_EFFTW, COMPLEXFFTH_MSGEFFTW );
default:
ABORTXLAL( status );
}
}
RETURN( status );
}
void
LALDestroyCOMPLEX8FFTPlan (
LALStatus *status,
COMPLEX8FFTPlan **plan
)
{
INITSTATUS(status);
XLAL_PRINT_DEPRECATION_WARNING("XLALDestroyCOMPLEX8FFTPlan");
ASSERT( plan, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL );
ASSERT( *plan, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL );
XLALDestroyCOMPLEX8FFTPlan( *plan );
if ( xlalErrno )
{
int code = xlalErrno;
XLALClearErrno();
switch ( code )
{
case XLAL_EINVAL:
ABORT( status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL );
default:
ABORTXLAL( status );
}
}
RETURN( status );
}
void
LALCOMPLEX8VectorFFT (
LALStatus *status,
COMPLEX8Vector *output,
COMPLEX8Vector *input,
COMPLEX8FFTPlan *plan
)
{
int code;
INITSTATUS(status);
XLAL_PRINT_DEPRECATION_WARNING("XLALCOMPLEX8VectorFFT");
ASSERT( output, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL );
ASSERT( input, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL );
ASSERT( plan, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL );
ASSERT( output->data, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL );
ASSERT( input->data, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL );
/* make sure that it is not the same data! */
ASSERT( output->data != input->data, status,
COMPLEXFFTH_ESAME, COMPLEXFFTH_MSGESAME );
/* make sure that the lengths agree */
ASSERT( plan->size > 0, status, COMPLEXFFTH_ESIZE, COMPLEXFFTH_MSGESIZE );
ASSERT( output->length == plan->size, status,
COMPLEXFFTH_ESZMM, COMPLEXFFTH_MSGESZMM );
ASSERT( input->length == plan->size, status,
COMPLEXFFTH_ESZMM, COMPLEXFFTH_MSGESZMM );
code = XLALCOMPLEX8VectorFFT( output, input, plan );
if ( code )
{
code = xlalErrno;
XLALClearErrno();
switch ( code )
{
case XLAL_EINVAL:
if ( ! plan->size ) /* plan size was invalid */
{
ABORT( status, COMPLEXFFTH_ESIZE, COMPLEXFFTH_MSGESIZE );
}
else if ( output->data == input->data ) /* same data pointers */
{
ABORT( status, COMPLEXFFTH_ESAME, COMPLEXFFTH_MSGESAME );
}
else /* one of the data pointers was NULL */
{
ABORT( status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL );
}
case XLAL_EBADLEN: /* size mismatch */
ABORT( status, COMPLEXFFTH_ESZMM, COMPLEXFFTH_MSGESZMM );
default:
ABORTXLAL( status );
}
}
RETURN( status );
}
/*
*
* LAL COMPLEX16 functions
*
*/
void
LALCreateForwardCOMPLEX16FFTPlan(
LALStatus *status,
COMPLEX16FFTPlan **plan,
UINT4 size,
INT4 measure
)
{
INITSTATUS(status);
XLAL_PRINT_DEPRECATION_WARNING("XLALCreateForwardCOMPLEX16FFTPlan");
ASSERT( plan, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL );
ASSERT( ! *plan, status, COMPLEXFFTH_ENNUL, COMPLEXFFTH_MSGENNUL );
ASSERT( size > 0, status, COMPLEXFFTH_ESIZE, COMPLEXFFTH_MSGESIZE );
*plan = XLALCreateCOMPLEX16FFTPlan( size, 1, measure );
if ( ! *plan )
{
int code = xlalErrno;
XLALClearErrno();
switch ( code )
{
case XLAL_EBADLEN:
ABORT( status, COMPLEXFFTH_ESIZE, COMPLEXFFTH_MSGESIZE );
case XLAL_ENOMEM:
ABORT( status, COMPLEXFFTH_EALOC, COMPLEXFFTH_MSGEALOC );
case XLAL_EFAILED:
ABORT( status, COMPLEXFFTH_EFFTW, COMPLEXFFTH_MSGEFFTW );
default:
ABORTXLAL( status );
}
}
RETURN( status );
}
void
LALCreateReverseCOMPLEX16FFTPlan(
LALStatus *status,
COMPLEX16FFTPlan **plan,
UINT4 size,
INT4 measure
)
{
INITSTATUS(status);
XLAL_PRINT_DEPRECATION_WARNING("XLALCreateReverseCOMPLEX16FFTPlan");
ASSERT( plan, status, COMPLEXFFTH_ENULL, COMPLEXFFTH_MSGENULL );
ASSERT( ! *plan, status, COMPLEXFFTH_ENNUL, COMPLEXFFTH_MSGENNUL );
ASSERT( size > 0, status, COMPLEXFFTH_ESIZE, COMPLEXFFTH_MSGESIZE );
*plan = XLALCreateCOMPLEX16FFTPlan( size, 0, measure );
if ( ! *plan )
{
int code = xlalErrno;
XLALClearErrno();
switch ( code )
{
case XLAL_EBADLEN:
ABORT( status, COMPLEXFFTH_ESIZE, COMPLEXFFTH_MSGESIZE );
case XLAL_ENOMEM:
ABORT( status, COMPLEXFFTH_EALOC, COMPLEXFFTH_MSGEALOC );
case XLAL_EFAILED:
ABORT( status, COMPLEXFFTH_EFFTW, COMPLEXFFTH_MSGEFFTW );
default:
ABORTXLAL( status );
}
}
RETURN( status );