AVFactories.h   AVFactories.h 
skipping to change at line 18 skipping to change at line 18
#define _AVFACTORIES_H #define _AVFACTORIES_H
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#include <stdarg.h> #include <stdarg.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup AVFactories_h * \addtogroup AVFactories_h
*
\brief Provides prototype and status code information for use of CreateVect * \brief Provides prototype and status code information for use of CreateV
or, ector,
CreateArray, ResizeVector, ResizeArray, DestroyVector and DestroyArray * CreateArray, ResizeVector, ResizeArray, DestroyVector and DestroyArray
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/AVFactories.h> * \code
\endcode * #include <lal/AVFactories.h>
* \endcode
\section secXLALfcts XLAL Functions *
* \section secXLALfcts XLAL Functions
\code *
REAL4Vector * XLALCreateVector(UINT4 length); * \code
REAL4Vector * XLALResizeVector(REAL4Vector *vector, UINT4 length); * REAL4Vector * XLALCreateVector(UINT4 length);
void XLALDestroyVector(REAL4Vector *vector, UINT4 length); * REAL4Vector * XLALResizeVector(REAL4Vector *vector, UINT4 length);
* void XLALDestroyVector(REAL4Vector *vector, UINT4 length);
<vectype> * XLALCreate<vectype>(UINT4 length ); *
<vectype> * XLALResize<vectype>(<vectype> *vector, UINT4 length ); * <vectype> * XLALCreate<vectype>(UINT4 length );
void XLALDestroy<vectype>(<vectype> *vector); * <vectype> * XLALResize<vectype>(<vectype> *vector, UINT4 length );
* void XLALDestroy<vectype>(<vectype> *vector);
REAL4Array * XLALCreateArrayL(UINT4 ndim, ...); *
REAL4Array * XLALCreateArrayV(UINT4 ndim, UINT4 *dims); * REAL4Array * XLALCreateArrayL(UINT4 ndim, ...);
REAL4Array * XLALCreateArray(UINT4Vector *dimLength); * REAL4Array * XLALCreateArrayV(UINT4 ndim, UINT4 *dims);
REAL4Array * XLALResizeArrayL(REAL4Array *array, UINT4 ndim, ...); * REAL4Array * XLALCreateArray(UINT4Vector *dimLength);
REAL4Array * XLALResizeArrayV(REAL4Array *array, UINT4 ndim, UINT4 *dims); * REAL4Array * XLALResizeArrayL(REAL4Array *array, UINT4 ndim, ...);
REAL4Array * XLALResizeArray(REAL4Array *array, UINT4Vector *dimLength); * REAL4Array * XLALResizeArrayV(REAL4Array *array, UINT4 ndim, UINT4 *dims
void XLALDestroyArray(REAL4Array *array); );
* REAL4Array * XLALResizeArray(REAL4Array *array, UINT4Vector *dimLength);
<arrtype> * XLALCreate<arrtype>L(UINT4 ndim, ...); * void XLALDestroyArray(REAL4Array *array);
<arrtype> * XLALCreate<arrtype>V(UINT4 ndim, UINT4 *dims); *
<arrtype> * XLALCreate<arrtype>(UINT4Vector *dimLength); * <arrtype> * XLALCreate<arrtype>L(UINT4 ndim, ...);
<arrtype> * XLALResize<arrtype>L(<arrtype> *array, UINT4 ndim, ...); * <arrtype> * XLALCreate<arrtype>V(UINT4 ndim, UINT4 *dims);
<arrtype> * XLALResize<arrtype>V(<arrtype> *array, UINT4 ndim, UINT4 *dims) * <arrtype> * XLALCreate<arrtype>(UINT4Vector *dimLength);
; * <arrtype> * XLALResize<arrtype>L(<arrtype> *array, UINT4 ndim, ...);
<arrtype> * XLALResize<arrtype>(<arrtype> *array, UINT4Vector *dimLength); * <arrtype> * XLALResize<arrtype>V(<arrtype> *array, UINT4 ndim, UINT4 *di
void XLALDestroy<arrtype>(<arrtype> *array); ms);
\endcode * <arrtype> * XLALResize<arrtype>(<arrtype> *array, UINT4Vector *dimLength
);
Here <tt>\<vectype\></tt> is one of * void XLALDestroy<arrtype>(<arrtype> *array);
\c COMPLEX16Vector, * \endcode
\c COMPLEX8Vector, *
\c REAL8Vector, * Here <tt>\<vectype\></tt> is one of
\c REAL4Vector, * \c COMPLEX16Vector,
\c INT8Vector, * \c COMPLEX8Vector,
\c INT4Vector, * \c REAL8Vector,
\c INT2Vector, * \c REAL4Vector,
\c UINT8Vector, * \c INT8Vector,
\c UINT4Vector, * \c INT4Vector,
\c UINT2Vector, or * \c INT2Vector,
\c CHARVector, * \c UINT8Vector,
and <tt>\<arrtype\></tt> is one of * \c UINT4Vector,
\c COMPLEX16Array, * \c UINT2Vector, or
\c COMPLEX8Array, * \c CHARVector,
\c REAL8Array, * and <tt>\<arrtype\></tt> is one of
\c REAL4Array, * \c COMPLEX16Array,
\c INT8Array, * \c COMPLEX8Array,
\c INT4Array, * \c REAL8Array,
\c INT2Array, * \c REAL4Array,
\c UINT8Array, * \c INT8Array,
\c UINT4Array, or * \c INT4Array,
\c UINT2Array. * \c INT2Array,
* \c UINT8Array,
\subsection ss_AVF_desc Description * \c UINT4Array, or
* \c UINT2Array.
The <tt>XLALCreate\<type\>%Vector</tt> functions create vectors of the spec *
ified * \subsection ss_AVF_desc Description
\c length number of objects of type <tt>\<type\></tt>. The function *
\c XLALCreateVector() is the same as \c XLALCreateREAL4Vector(). * The <tt>XLALCreate\<type\>%Vector</tt> functions create vectors of the s
pecified
The <tt>XLALDestroy\<type\>%Vector</tt> functions deallocate the memory all * \c length number of objects of type <tt>\<type\></tt>. The function
ocation * \c XLALCreateVector() is the same as \c XLALCreateREAL4Vector().
pointed to by \c vector including its contents. The function *
\c XLALDestroyVector() is the same as \c XLALDestroyREAL4Vector(). * The <tt>XLALDestroy\<type\>%Vector</tt> functions deallocate the memory
allocation
The <tt>XLALResize\<type\>%Vector</tt> functions resize the supplied vector * pointed to by \c vector including its contents. The function
\c vector to the new size \c length. If \c vector is \c NULL * \c XLALDestroyVector() is the same as \c XLALDestroyREAL4Vector().
then this is equivalent to <tt>XLALCreate\<type\>%Vector</tt>. If \c lengt *
h * The <tt>XLALResize\<type\>%Vector</tt> functions resize the supplied vec
is zero then this is equivalent to <tt>XLALDestroy\<type\>%Vector</tt> and tor
the * \c vector to the new size \c length. If \c vector is \c NULL
routine returns \c NULL. Otherwise, the amount of data in the vector * then this is equivalent to <tt>XLALCreate\<type\>%Vector</tt>. If \c le
is realloced using \c LALRealloc(). The function ngth
\c XLALResizeVector() is the same as \c XLALResizeREAL4Vector(). * is zero then this is equivalent to <tt>XLALDestroy\<type\>%Vector</tt> a
nd the
The <tt>XLALCreate\<type\>Array</tt> * routine returns \c NULL. Otherwise, the amount of data in the vector
<tt>XLALCreate\<type\>ArrayL</tt> * is realloced using \c LALRealloc(). The function
<tt>XLALCreate\<type\>ArrayV</tt> * \c XLALResizeVector() is the same as \c XLALResizeREAL4Vector().
all create an object of type <tt>\<type\>Array</tt>. They differ in the wa *
y * The <tt>XLALCreate\<type\>Array</tt>
that the dimensions of the array are specified. The function * <tt>XLALCreate\<type\>ArrayL</tt>
<tt>XLALCreate\<type\>Array</tt> allocates an array with dimensions specifi * <tt>XLALCreate\<type\>ArrayV</tt>
ed * all create an object of type <tt>\<type\>Array</tt>. They differ in the
by the \c UINT4Vector \c dimLength which is a vector of dimension way
lengths for the array. The function * that the dimensions of the array are specified. The function
<tt>XLALCreate\<type\>ArrayV</tt> provides these dimensions with two argume * <tt>XLALCreate\<type\>Array</tt> allocates an array with dimensions spec
nts: ified
\c ndim is the number of dimensions and \c dims is an array of * by the \c UINT4Vector \c dimLength which is a vector of dimension
\c UINT4 values for the dimensions. The function * lengths for the array. The function
<tt>XLALCreate\<type\>ArrayL</tt> also specifies the dimensions as argument * <tt>XLALCreate\<type\>ArrayV</tt> provides these dimensions with two arg
s. uments:
Here, the first argument, \c ndim, is the number of dimensions, and * \c ndim is the number of dimensions and \c dims is an array of
this is followed by \c ndim arguments that provide the dimensions. * \c UINT4 values for the dimensions. The function
Note that for this function, a maximum of 16 dimensions can be provided * <tt>XLALCreate\<type\>ArrayL</tt> also specifies the dimensions as argum
(that is, \c ndim cannot be more than 16 and there cannot be more than ents.
16 arguments after the first). * Here, the first argument, \c ndim, is the number of dimensions, and
The \c XLALCreateArray() * this is followed by \c ndim arguments that provide the dimensions.
\c XLALCreateArrayL() * Note that for this function, a maximum of 16 dimensions can be provided
\c XLALCreateArrayV() * (that is, \c ndim cannot be more than 16 and there cannot be more than
functions are equivalent to the * 16 arguments after the first).
\c XLALCreateREAL4Array() * The \c XLALCreateArray()
\c XLALCreateREAL4ArrayL() * \c XLALCreateArrayL()
\c XLALCreateREAL4ArrayV() * \c XLALCreateArrayV()
functions respectively. * functions are equivalent to the
* \c XLALCreateREAL4Array()
The <tt>XLALDestroy\<type\>Array</tt> functions deallocate the memory alloc * \c XLALCreateREAL4ArrayL()
ation * \c XLALCreateREAL4ArrayV()
pointed to by \c array including its contents. The function * functions respectively.
\c XLALDestroyArray() is the same as \c XLALDestroyREAL4Array(). *
* The <tt>XLALDestroy\<type\>Array</tt> functions deallocate the memory al
The <tt>XLALResize\<type\>Array</tt> location
<tt>XLALResize\<type\>ArrayL</tt> * pointed to by \c array including its contents. The function
<tt>XLALResize\<type\>ArrayV</tt> * \c XLALDestroyArray() is the same as \c XLALDestroyREAL4Array().
functions resize the provided array \c array. The arguments after the *
first are interpreted in the same way as for the * The <tt>XLALResize\<type\>Array</tt>
<tt>XLALCreate\<type\>Array</tt> * <tt>XLALResize\<type\>ArrayL</tt>
<tt>XLALCreate\<type\>ArrayL</tt> * <tt>XLALResize\<type\>ArrayV</tt>
<tt>XLALCreate\<type\>ArrayV</tt> * functions resize the provided array \c array. The arguments after the
functions. If \c array is \c NULL, the resize functions are equivalent * first are interpreted in the same way as for the
to the corresponding create function. If \c ndim is zero for * <tt>XLALCreate\<type\>Array</tt>
<tt>XLALResize\<type\>ArrayL</tt> or * <tt>XLALCreate\<type\>ArrayL</tt>
<tt>XLALResize\<type\>ArrayV</tt>, or if \c dimLength is \c NULL for * <tt>XLALCreate\<type\>ArrayV</tt>
<tt>XLALResize\<type\>Array</tt>, then these functions are equivalent to * functions. If \c array is \c NULL, the resize functions are equivalent
<tt>XLALDestroy\<type\>Array</tt>. * to the corresponding create function. If \c ndim is zero for
The \c XLALResizeArray() * <tt>XLALResize\<type\>ArrayL</tt> or
\c XLALResizeArrayL() * <tt>XLALResize\<type\>ArrayV</tt>, or if \c dimLength is \c NULL for
\c XLALResizeArrayV() * <tt>XLALResize\<type\>Array</tt>, then these functions are equivalent to
functions are equivalent to the * <tt>XLALDestroy\<type\>Array</tt>.
\c XLALResizeREAL4Array() * The \c XLALResizeArray()
\c XLALResizeREAL4ArrayL() * \c XLALResizeArrayL()
\c XLALResizeREAL4ArrayV() * \c XLALResizeArrayV()
functions respectively. * functions are equivalent to the
* \c XLALResizeREAL4Array()
\subsection ss_AVF_return Return Values * \c XLALResizeREAL4ArrayL()
* \c XLALResizeREAL4ArrayV()
If successful, the create and resize functions return a pointer to the same * functions respectively.
data that was passed to the function. The resize functions will return *
a \c NULL pointer if the size of the new object was zero. Upon failure * \subsection ss_AVF_return Return Values
these routines will return \c NULL and will set \c xlalErrno to *
one of these values: \c #XLAL_ENOMEM if a memory allocation failed, * If successful, the create and resize functions return a pointer to the s
\c #XLAL_EBADLEN if an invalid length was provided (for example, a ame
zero-size allocation with a create function), \c XLAL_EINVAL if an * data that was passed to the function. The resize functions will return
invalid argument is provided (for example, if the pointer to an * a \c NULL pointer if the size of the new object was zero. Upon failure
array of dimensions is \c NULL). * these routines will return \c NULL and will set \c xlalErrno to
* one of these values: \c #XLAL_ENOMEM if a memory allocation failed,
The destroy function does not return any value. If the function is passed * \c #XLAL_EBADLEN if an invalid length was provided (for example, a
a * zero-size allocation with a create function), \c XLAL_EINVAL if an
\c NULL pointer, it will set \c xlalErrno to \c #XLAL_EFAULT. * invalid argument is provided (for example, if the pointer to an
If the function is passed an object that appears corrupted (e.g., a * array of dimensions is \c NULL).
vector with zero length or will a \c NULL data pointer) it will set *
\c xlalErrno to \c #XLAL_EINVAL. * The destroy function does not return any value. If the function is pass
ed a
*/ * \c NULL pointer, it will set \c xlalErrno to \c #XLAL_EFAULT.
* If the function is passed an object that appears corrupted (e.g., a
* vector with zero length or will a \c NULL data pointer) it will set
* \c xlalErrno to \c #XLAL_EINVAL.
*
*/
/*@{ */ /*@{ */
/** \name Error Codes */ /** \name Error Codes */
/*@{*/ /*@{*/
#define AVFACTORIESH_ELENGTH 1 /**< Illegal length. */ #define AVFACTORIESH_ELENGTH 1 /**< Illegal length. */
#define AVFACTORIESH_EVPTR 2 /**< Null vector/array handle. */ #define AVFACTORIESH_EVPTR 2 /**< Null vector/array handle. */
#define AVFACTORIESH_EUPTR 4 /**< Non-null vector/array pointer. */ #define AVFACTORIESH_EUPTR 4 /**< Non-null vector/array pointer. */
#define AVFACTORIESH_EDPTR 8 /**< Null vector/array data. */ #define AVFACTORIESH_EDPTR 8 /**< Null vector/array data. */
#define AVFACTORIESH_EMALLOC 16 /**< Malloc failure. */ #define AVFACTORIESH_EMALLOC 16 /**< Malloc failure. */
/*@}*/ /*@}*/
skipping to change at line 191 skipping to change at line 192
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
#define AVFACTORIESH_MSGELENGTH "Illegal length." #define AVFACTORIESH_MSGELENGTH "Illegal length."
#define AVFACTORIESH_MSGEVPTR "Null vector/array handle." #define AVFACTORIESH_MSGEVPTR "Null vector/array handle."
#define AVFACTORIESH_MSGEUPTR "Non-null vector/array pointer." #define AVFACTORIESH_MSGEUPTR "Non-null vector/array pointer."
#define AVFACTORIESH_MSGEDPTR "Null vector/array data." #define AVFACTORIESH_MSGEDPTR "Null vector/array data."
#define AVFACTORIESH_MSGEMALLOC "Malloc failure." #define AVFACTORIESH_MSGEMALLOC "Malloc failure."
/** \endcond */ /** \endcond */
/** /**
\defgroup ArrayFactories_c Module ArrayFactories.c * \defgroup ArrayFactories_c Module ArrayFactories.c
\ingroup AVFactories_h * \ingroup AVFactories_h
*
\brief Create/destroy \<datatype\>Array objects. * \brief Create/destroy \<datatype\>Array objects.
*
\heading{Description} * ### Description ###
*
The \c CreateArray family of functions create a \<datatype\>Array of the ap * The \c CreateArray family of functions create a \<datatype\>Array of the
propriate dimensions. appropriate dimensions.
*
The \c DestroyArray family of functions return the storage allocated by the * The \c DestroyArray family of functions return the storage allocated by
\c CreateArray functions to the system. the \c CreateArray functions to the system.
*
*/ */
/*@{*/ /*@{*/
/** \name INT2 array prototypes */ /** \name INT2 array prototypes */
/*@{*/ /*@{*/
INT2Array * XLALCreateINT2ArrayL ( UINT4, ... ); INT2Array * XLALCreateINT2ArrayL ( UINT4, ... );
INT2Array * XLALCreateINT2ArrayV ( UINT4, UINT4 * ); INT2Array * XLALCreateINT2ArrayV ( UINT4, UINT4 * );
INT2Array * XLALCreateINT2Array ( UINT4Vector * ); INT2Array * XLALCreateINT2Array ( UINT4Vector * );
INT2Array * XLALResizeINT2ArrayL ( INT2Array *, UINT4, ... ); INT2Array * XLALResizeINT2ArrayL ( INT2Array *, UINT4, ... );
INT2Array * XLALResizeINT2ArrayV ( INT2Array *, UINT4, UINT4 * ); INT2Array * XLALResizeINT2ArrayV ( INT2Array *, UINT4, UINT4 * );
INT2Array * XLALResizeINT2Array ( INT2Array *, UINT4Vector * ); INT2Array * XLALResizeINT2Array ( INT2Array *, UINT4Vector * );
skipping to change at line 311 skipping to change at line 312
/*@}*/ /*@}*/
/** \name REAL4 array prototypes (default name) */ /** \name REAL4 array prototypes (default name) */
/*@{*/ /*@{*/
REAL4Array * XLALCreateArrayL ( UINT4, ... ); REAL4Array * XLALCreateArrayL ( UINT4, ... );
REAL4Array * XLALCreateArrayV ( UINT4, UINT4 * ); REAL4Array * XLALCreateArrayV ( UINT4, UINT4 * );
REAL4Array * XLALCreateArray ( UINT4Vector * ); REAL4Array * XLALCreateArray ( UINT4Vector * );
REAL4Array * XLALResizeArrayL ( REAL4Array *, UINT4, ... ); REAL4Array * XLALResizeArrayL ( REAL4Array *, UINT4, ... );
REAL4Array * XLALResizeArrayV ( REAL4Array *, UINT4, UINT4 * ); REAL4Array * XLALResizeArrayV ( REAL4Array *, UINT4, UINT4 * );
REAL4Array * XLALResizeArray ( REAL4Array *, UINT4Vector * ); REAL4Array * XLALResizeArray ( REAL4Array *, UINT4Vector * );
#ifndef SWIG /* exclude from SWIG interface */
void XLALDestroyArray ( REAL4Array * ); void XLALDestroyArray ( REAL4Array * );
#endif /* SWIG */
void LALCreateArray ( LALStatus *, REAL4Array **, UINT4Vector * ); void LALCreateArray ( LALStatus *, REAL4Array **, UINT4Vector * );
void LALResizeArray ( LALStatus *, REAL4Array **, UINT4Vector * ); void LALResizeArray ( LALStatus *, REAL4Array **, UINT4Vector * );
void LALDestroyArray ( LALStatus *, REAL4Array ** ); void LALDestroyArray ( LALStatus *, REAL4Array ** );
/*@}*/ /*@}*/
/** \name REAL8 array prototypes */ /** \name REAL8 array prototypes */
/*@{*/ /*@{*/
REAL8Array * XLALCreateREAL8ArrayL ( UINT4, ... ); REAL8Array * XLALCreateREAL8ArrayL ( UINT4, ... );
REAL8Array * XLALCreateREAL8ArrayV ( UINT4, UINT4 * ); REAL8Array * XLALCreateREAL8ArrayV ( UINT4, UINT4 * );
REAL8Array * XLALCreateREAL8Array ( UINT4Vector * ); REAL8Array * XLALCreateREAL8Array ( UINT4Vector * );
skipping to change at line 362 skipping to change at line 365
COMPLEX16Array * XLALResizeCOMPLEX16Array ( COMPLEX16Array *, UINT4Vector * ); COMPLEX16Array * XLALResizeCOMPLEX16Array ( COMPLEX16Array *, UINT4Vector * );
void XLALDestroyCOMPLEX16Array ( COMPLEX16Array * ); void XLALDestroyCOMPLEX16Array ( COMPLEX16Array * );
void LALZCreateArray ( LALStatus *, COMPLEX16Array **, UINT4Vector * ); void LALZCreateArray ( LALStatus *, COMPLEX16Array **, UINT4Vector * );
void LALZResizeArray ( LALStatus *, COMPLEX16Array **, UINT4Vector * ); void LALZResizeArray ( LALStatus *, COMPLEX16Array **, UINT4Vector * );
void LALZDestroyArray ( LALStatus *, COMPLEX16Array ** ); void LALZDestroyArray ( LALStatus *, COMPLEX16Array ** );
/*@}*/ /*@}*/
/*@}*/ /*@}*/
/* ---------- end: ArrayFactories_c ---------- */ /* ---------- end: ArrayFactories_c ---------- */
/** \defgroup VectorFactories_c Module VectorFactories.c /**
\ingroup AVFactories_h * \defgroup VectorFactories_c Module VectorFactories.c
* \ingroup AVFactories_h
\brief Create/destroy \<datatype\>%Vector objects. *
* \brief Create/destroy \<datatype\>%Vector objects.
\heading{Description} *
* ### Description ###
The \c CreateVector family of functions create a \<datatype\>%Vector of the *
appropriate dimensions. * The \c CreateVector family of functions create a \<datatype\>%Vector of
the appropriate dimensions.
The \c ResizeVector family of functions changes the amount of storage alloc *
ated by the \c CreateVector functions. * The \c ResizeVector family of functions changes the amount of storage al
located by the \c CreateVector functions.
The \c DestroyVector family of functions return the storage allocated by th *
e \c CreateVector functions to the system. * The \c DestroyVector family of functions return the storage allocated by
the \c CreateVector functions to the system.
*/ *
*/
/*@{*/ /*@{*/
/** \name CHAR vector prototypes */ /** \name CHAR vector prototypes */
/*@{*/ /*@{*/
CHARVector * XLALCreateCHARVector ( UINT4 length ); CHARVector * XLALCreateCHARVector ( UINT4 length );
CHARVector * XLALResizeCHARVector ( CHARVector * vector, UINT4 length ); CHARVector * XLALResizeCHARVector ( CHARVector * vector, UINT4 length );
void XLALDestroyCHARVector ( CHARVector * vector ); void XLALDestroyCHARVector ( CHARVector * vector );
void LALCHARCreateVector ( LALStatus *, CHARVector **, UINT4 ); void LALCHARCreateVector ( LALStatus *, CHARVector **, UINT4 );
void LALCHARResizeVector ( LALStatus *, CHARVector **, UINT4 ); void LALCHARResizeVector ( LALStatus *, CHARVector **, UINT4 );
void LALCHARDestroyVector ( LALStatus *, CHARVector ** ); void LALCHARDestroyVector ( LALStatus *, CHARVector ** );
skipping to change at line 462 skipping to change at line 466
void XLALDestroyREAL4Vector ( REAL4Vector * vector ); void XLALDestroyREAL4Vector ( REAL4Vector * vector );
void LALSCreateVector ( LALStatus *, REAL4Vector **, UINT4 ); void LALSCreateVector ( LALStatus *, REAL4Vector **, UINT4 );
void LALSResizeVector ( LALStatus *, REAL4Vector **, UINT4 ); void LALSResizeVector ( LALStatus *, REAL4Vector **, UINT4 );
void LALSDestroyVector ( LALStatus *, REAL4Vector ** ); void LALSDestroyVector ( LALStatus *, REAL4Vector ** );
/*@}*/ /*@}*/
/** \name REAL4 vector prototypes (default name) */ /** \name REAL4 vector prototypes (default name) */
/*@{*/ /*@{*/
REAL4Vector * XLALCreateVector ( UINT4 length ); REAL4Vector * XLALCreateVector ( UINT4 length );
REAL4Vector * XLALResizeVector ( REAL4Vector * vector, UINT4 length ); REAL4Vector * XLALResizeVector ( REAL4Vector * vector, UINT4 length );
#ifndef SWIG /* exclude from SWIG interface */
void XLALDestroyVector ( REAL4Vector * vector ); void XLALDestroyVector ( REAL4Vector * vector );
#endif /* SWIG */
void LALCreateVector ( LALStatus *, REAL4Vector **, UINT4 ); void LALCreateVector ( LALStatus *, REAL4Vector **, UINT4 );
void LALResizeVector ( LALStatus *, REAL4Vector **, UINT4 ); void LALResizeVector ( LALStatus *, REAL4Vector **, UINT4 );
void LALDestroyVector ( LALStatus *, REAL4Vector ** ); void LALDestroyVector ( LALStatus *, REAL4Vector ** );
/*@}*/ /*@}*/
/** \name REAL8 vector prototypes */ /** \name REAL8 vector prototypes */
/*@{*/ /*@{*/
REAL8Vector * XLALCreateREAL8Vector ( UINT4 length ); REAL8Vector * XLALCreateREAL8Vector ( UINT4 length );
REAL8Vector * XLALResizeREAL8Vector ( REAL8Vector * vector, UINT4 length ); REAL8Vector * XLALResizeREAL8Vector ( REAL8Vector * vector, UINT4 length );
void XLALDestroyREAL8Vector ( REAL8Vector * vector ); void XLALDestroyREAL8Vector ( REAL8Vector * vector );
 End of changes. 7 change blocks. 
195 lines changed or deleted 205 lines changed or added


 Audio.h   Audio.h 
skipping to change at line 21 skipping to change at line 21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with with program; see the file COPYING. If not, write to the * along with with program; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA * MA 02111-1307 USA
*/ */
/* vim: set noet ts=4 sw=4: */ /* vim: set noet ts=4 sw=4: */
/** \file /**
* \file
* \ingroup std * \ingroup std
* \author Creighton, J. D. E. * \author Creighton, J. D. E.
* \brief Routines for exporting time series data as sound files. * \brief Routines for exporting time series data as sound files.
* *
* Supported formats are AU and WAVE. AIFF is not supported at this time. * Supported formats are AU and WAVE. AIFF is not supported at this time.
* *
* This code is based on code written by Paul Bourke. See: * This code is based on code written by Paul Bourke. See:
* http://local.wasp.uwa.edu.au/~pbourke/dataformats/au/ * http://local.wasp.uwa.edu.au/~pbourke/dataformats/au/
* http://local.wasp.uwa.edu.au/~pbourke/dataformats/wave/ * http://local.wasp.uwa.edu.au/~pbourke/dataformats/wave/
* *
 End of changes. 1 change blocks. 
1 lines changed or deleted 2 lines changed or added


 BandPassTimeSeries.h   BandPassTimeSeries.h 
skipping to change at line 34 skipping to change at line 34
#include <lal/IIRFilter.h> #include <lal/IIRFilter.h>
#include <lal/ZPGFilter.h> #include <lal/ZPGFilter.h>
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
\addtogroup BandPassTimeSeries_h * \addtogroup BandPassTimeSeries_h
\author Creighton, T. D. * \author Creighton, T. D.
*
\brief Provides routines to low- or high-pass filter a time series. * \brief Provides routines to low- or high-pass filter a time series.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/BandPassTimeSeries.h> * \code
\endcode * #include <lal/BandPassTimeSeries.h>
* \endcode
This header covers routines that apply a time-domain low- or *
high-pass filter to a data series of type <tt>\<datatype\>TimeSeries</tt>. * This header covers routines that apply a time-domain low- or
Further documentation is given in the individual routines' modules. * high-pass filter to a data series of type <tt>\<datatype\>TimeSeries</tt
>.
*/ * Further documentation is given in the individual routines' modules.
*
*/
/*@{*/ /*@{*/
/** \name Error Codes */ /** \name Error Codes */
/*@{*/ /*@{*/
#define BANDPASSTIMESERIESH_ENUL 1 /**< Unexpected null pointer in argu ments */ #define BANDPASSTIMESERIESH_ENUL 1 /**< Unexpected null pointer in argu ments */
#define BANDPASSTIMESERIESH_EBAD 2 /**< Bad filter parameters */ #define BANDPASSTIMESERIESH_EBAD 2 /**< Bad filter parameters */
/*@}*/ /*@}*/
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
#define BANDPASSTIMESERIESH_MSGENUL "Unexpected null pointer in arguments" #define BANDPASSTIMESERIESH_MSGENUL "Unexpected null pointer in arguments"
#define BANDPASSTIMESERIESH_MSGEBAD "Bad filter parameters" #define BANDPASSTIMESERIESH_MSGEBAD "Bad filter parameters"
/** \endcond */ /** \endcond */
/** This structure stores data used for constructing a low- or high-pass /**
* This structure stores data used for constructing a low- or high-pass
* filter: either the order and characteristic frequency of the filter, * filter: either the order and characteristic frequency of the filter,
* or the frequencies and desired attenuations at the ends of some * or the frequencies and desired attenuations at the ends of some
* transition band. In the latter case, a nonzero filter order parameter * transition band. In the latter case, a nonzero filter order parameter
* \c n indicates a maximum allowed order * \c n indicates a maximum allowed order
*/ */
typedef struct tagPassBandParamStruc{ typedef struct tagPassBandParamStruc{
CHAR *name; /**< A user-assigned name */ CHAR *name; /**< A user-assigned name */
INT4 nMax; /**< The maximum desired filter order (actual order may be l ess if specified attenuations do not require a high order) */ INT4 nMax; /**< The maximum desired filter order (actual order may be l ess if specified attenuations do not require a high order) */
REAL8 f1; /**< The reference frequencies of the transition band */ REAL8 f1; /**< The reference frequencies of the transition band */
REAL8 f2; /**< The reference frequencies of the transition band */ REAL8 f2; /**< The reference frequencies of the transition band */
 End of changes. 2 change blocks. 
16 lines changed or deleted 19 lines changed or added


 Calibration.h   Calibration.h 
skipping to change at line 32 skipping to change at line 32
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#include <lal/BandPassTimeSeries.h> #include <lal/BandPassTimeSeries.h>
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** \addtogroup Calibration_h /**
* \addtogroup Calibration_h
* \author P. R. Brady, J. D. E. Creighton * \author P. R. Brady, J. D. E. Creighton
* \brief Calibration API * \brief Calibration API
* *
* \heading{Synopsis} * ### Synopsis ###
*
* \code * \code
* #include <lal/Calibration.h> * #include <lal/Calibration.h>
* \endcode * \endcode
* *
*/ */
/*@{*/ /*@{*/
/**\name Error Codes */ /**\name Error Codes */
/*@{*/ /*@{*/
#define CALIBRATIONH_ENULL 001 /**< Null pointer */ #define CALIBRATIONH_ENULL 001 /**< Null pointer */
skipping to change at line 121 skipping to change at line 123
REAL8 conversion; REAL8 conversion;
REAL8 offset; REAL8 offset;
REAL8 delay; REAL8 delay;
COMPLEX8FrequencySeries *transfer; COMPLEX8FrequencySeries *transfer;
REAL8Vector *zeros; REAL8Vector *zeros;
REAL8Vector *poles; REAL8Vector *poles;
REAL8 gain; REAL8 gain;
} }
CalibrationRecord; CalibrationRecord;
/** The type CalibrationFunctions contains two calibration functions, /**
* The type CalibrationFunctions contains two calibration functions,
* the sensing function \f$C(f)\f$ and the response function \f$R(f)\f$. W hile the * the sensing function \f$C(f)\f$ and the response function \f$R(f)\f$. W hile the
* response function is the function that is most often wanted, the sensing * response function is the function that is most often wanted, the sensing
* function is needed in updating calibration from one epoch to another. * function is needed in updating calibration from one epoch to another.
*/ */
typedef struct typedef struct
tagCalibrationFunctions tagCalibrationFunctions
{ {
COMPLEX8FrequencySeries *responseFunction; COMPLEX8FrequencySeries *responseFunction;
COMPLEX8FrequencySeries *sensingFunction; COMPLEX8FrequencySeries *sensingFunction;
} }
CalibrationFunctions; CalibrationFunctions;
/** The type \c CalibrationUpdateParams contains two time series /**
* The type \c CalibrationUpdateParams contains two time series
* representing an overall gain factor for the open-loop gain function \f$H (f)\f$ * representing an overall gain factor for the open-loop gain function \f$H (f)\f$
* and the sensing function \f$C(f)\f$. These transfer functions are known to * and the sensing function \f$C(f)\f$. These transfer functions are known to
* change (by an overall factor) with time, and these two factors can be * change (by an overall factor) with time, and these two factors can be
* tracked using the injected calibration lines. The factors are stored * tracked using the injected calibration lines. The factors are stored
* in this structure as (very-slowly varying) time series, and are to be * in this structure as (very-slowly varying) time series, and are to be
* used in updating the calibration functions described previously. * used in updating the calibration functions described previously.
* (The response function can be computed from the open-loop gain and the * (The response function can be computed from the open-loop gain and the
* sensing function. It is simply \f$R(f)=[1+H(f)]/C(f)\f$.) In addition, this * sensing function. It is simply \f$R(f)=[1+H(f)]/C(f)\f$.) In addition, this
* structure contains the present epoch and the duration of the data to be * structure contains the present epoch and the duration of the data to be
* calibrated to identify the particular set of * calibrated to identify the particular set of
 End of changes. 4 change blocks. 
4 lines changed or deleted 8 lines changed or added


 CoarseGrainFrequencySeries.h   CoarseGrainFrequencySeries.h 
skipping to change at line 30 skipping to change at line 30
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#ifndef _COARSEGRAINFREQUENCYSERIES_H #ifndef _COARSEGRAINFREQUENCYSERIES_H
#define _COARSEGRAINFREQUENCYSERIES_H #define _COARSEGRAINFREQUENCYSERIES_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup CoarseGrainFrequencySeries_h * \addtogroup CoarseGrainFrequencySeries_h
\author UTB Relativity Group; contact whelan@phys.utb.edu (original by S * \author UTB Relativity Group; contact whelan@phys.utb.edu (original by S
. Drasco) . Drasco)
*
\brief Provides prototype, structure and error code information for rout * \brief Provides prototype, structure and error code information for rout
ines which coarse-grain a frequency series. ines which coarse-grain a frequency series.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/CoarseGrainFrequencySeries.h> * \code
\endcode * #include <lal/CoarseGrainFrequencySeries.h>
* \endcode
\heading{Description} *
* ### Description ###
These functions are designed to facilitate approximation of integrals *
such as * These functions are designed to facilitate approximation of integrals
\f[ * such as
\int g(f)\,h(f)\,df * \f[
\f] * \int g(f)\,h(f)\,df
when \f$g(f)\f$ and \f$h(f)\f$ are sampled with different frequency * \f]
resolutions. If the frequency resolution were the same for both * when \f$g(f)\f$ and \f$h(f)\f$ are sampled with different frequency
functions, e.g., a frequency spacing of \f$\delta f\f$ and a start * resolutions. If the frequency resolution were the same for both
frequency of \f$f_0\f$, so that the \f$k\f$th element corresponded to a * functions, e.g., a frequency spacing of \f$\delta f\f$ and a start
frequency \f$f_k = f_0 + k\delta f\f$, the approximation would be defined * frequency of \f$f_0\f$, so that the \f$k\f$th element corresponded to a
as * frequency \f$f_k = f_0 + k\delta f\f$, the approximation would be define
\f[ d
\int g(f)\,h(f)\,df \approx \delta f \sum_k g_k h_k * as
\f] * \f[
whose contribution from the \f$k\f$th element is [It is * \int g(f)\,h(f)\,df \approx \delta f \sum_k g_k h_k
important to make the limits of integration symmetric about \f$f_k\f$ to * \f]
maintain reality conditions when dealing with Fourier transforms of * whose contribution from the \f$k\f$th element is [It is
real quantities.] * important to make the limits of integration symmetric about \f$f_k\f$ to
\f[ * maintain reality conditions when dealing with Fourier transforms of
\int_{f_k-\delta f/2}^{f_k+\delta f/2} g(f)\,h(f)\,df \approx * real quantities.]
\delta f g_k h_k * \f[
\ . * \int_{f_k-\delta f/2}^{f_k+\delta f/2} g(f)\,h(f)\,df \approx
\f] * \delta f g_k h_k
The central idea in our definitions of coarse graining will thus be * \ .
the correspondence * \f]
\anchor utilities_e_coarse \f{equation}{ * The central idea in our definitions of coarse graining will thus be
\label{utilities_e_coarse} * the correspondence
h_k \approx \frac{1}{\delta f} * \f{equation}{
\int_{f_k-\delta f/2}^{f_k+\delta f/2} h(f)\,df * \label{utilities_e_coarse}
\f} * h_k \approx \frac{1}{\delta f}
* \int_{f_k-\delta f/2}^{f_k+\delta f/2} h(f)\,df
The purpose of this function is to obtain a frequency series \f$\{h_k\}\f$ * \f}
with start frequency \f$f_0\f$ and frequency spacing \f$\delta f\f$ from a *
finer-grained frequency series \f$\{h'_\ell\}\f$ with start frequency * The purpose of this function is to obtain a frequency series \f$\{h_k\}\
\f$f'_0\f$ and frequency spacing \f$\delta f'\f$. Focussing on the \f$k\f$ f$
th * with start frequency \f$f_0\f$ and frequency spacing \f$\delta f\f$ from
element of the coarse-grained series, which represents a frequency a
range from \f$f_k-\delta f/2\f$ to \f$f_k+\delta f/2\f$, we consider the * finer-grained frequency series \f$\{h'_\ell\}\f$ with start frequency
elements of the fine-grained series whose frequency ranges overlap * \f$f'_0\f$ and frequency spacing \f$\delta f'\f$. Focussing on the \f$k
with this. (Fig.\figref{utilities_f_coarse} \f$th
* element of the coarse-grained series, which represents a frequency
\floatfig{htbp,utilities_f_coarse} * range from \f$f_k-\delta f/2\f$ to \f$f_k+\delta f/2\f$, we consider the
\image html utilitiesCoarseGrain.png "Fig. [utilities_f_coarse]: Coarse gr * elements of the fine-grained series whose frequency ranges overlap
aining a frequency series" * with this (\figref{utilitiesCoarseGrain}).
\image latex utilitiesCoarseGrain.pdf "Coarse graining a frequency series" *
* \figure{utilitiesCoarseGrain,pdf,0.6,Coarse graining a frequency series}
We define \f$\ell^{\scriptstyle\textrm{min}}_k\f$ and \f$\ell^{\scriptstyle *
{\rm min}}_k\f$ * We define \f$\ell^{\scriptstyle\textrm{min}}_k\f$ and \f$\ell^{\scriptst
to be the indices of the first and last elements of yle{\rm min}}_k\f$
\f$h'_\ell\f$ which overlap \e completely with the frequency range * to be the indices of the first and last elements of
corresponding to \f$h_k\f$. These are most easily defined in terms of * \f$h'_\ell\f$ which overlap \e completely with the frequency range
non-integer indices \f$\lambda^{\scriptstyle\textrm{min}}_k\f$ and * corresponding to \f$h_k\f$. These are most easily defined in terms of
\f$\lambda^{\scriptstyle\textrm{max}}_k\f$ which correspond to the location * non-integer indices \f$\lambda^{\scriptstyle\textrm{min}}_k\f$ and
s * \f$\lambda^{\scriptstyle\textrm{max}}_k\f$ which correspond to the locat
of fine-grained elements which would exactly reach the edges of the ions
coarse-grained element with index \f$k\f$. These are defined by * of fine-grained elements which would exactly reach the edges of the
\f{eqnarray*}{ * coarse-grained element with index \f$k\f$. These are defined by
f_0 + \left(k-\frac{1}{2}\right) \delta f * \f{eqnarray}{
&=& f'_0 + \left(\lambda^{\scriptstyle\textrm{min}}_k-\frac{1}{2}\right) * f_0 + \left(k-\frac{1}{2}\right) \delta f
\delta f' \\ * &=& f'_0 + \left(\lambda^{\scriptstyle\textrm{min}}_k-\frac{1}{2}\right)
f_0 + \left(k+\frac{1}{2}\right) \delta f * \delta f' \\
&=& f'_0 + \left(\lambda^{\scriptstyle\textrm{max}}_k+\frac{1}{2}\right) * f_0 + \left(k+\frac{1}{2}\right) \delta f
\delta f' * &=& f'_0 + \left(\lambda^{\scriptstyle\textrm{max}}_k+\frac{1}{2}\right)
\f} * \delta f'
or, defining the offset \f$\Omega=(f_0-f'_0)/\delta f'\f$ and the coarse * \f}
graining ratio \f$\rho = \delta f / \delta f'\f$, * or, defining the offset \f$\Omega=(f_0-f'_0)/\delta f'\f$ and the coarse
\f{eqnarray*}{ * graining ratio \f$\rho = \delta f / \delta f'\f$,
\lambda^{\scriptstyle\textrm{min}}_k &=& * \f{eqnarray}{
\Omega + \left(k-\frac{1}{2}\right) \rho + \frac{1}{2}\\ * \lambda^{\scriptstyle\textrm{min}}_k &=&
\lambda^{\scriptstyle\textrm{max}}_k &=& * \Omega + \left(k-\frac{1}{2}\right) \rho + \frac{1}{2}\\
\Omega + \left(k+\frac{1}{2}\right) \rho - \frac{1}{2} * \lambda^{\scriptstyle\textrm{max}}_k &=&
\ . * \Omega + \left(k+\frac{1}{2}\right) \rho - \frac{1}{2}
\f} * \ .
Examination of Fig.\figref{utilities_f_coarse} shows that * \f}
\f$\ell^{\scriptstyle\textrm{min}}_k\f$ is the smallest integer not less th * Examination of \figref{utilitiesCoarseGrain} shows that
an * \f$\ell^{\scriptstyle\textrm{min}}_k\f$ is the smallest integer not less
\f$\lambda^{\scriptstyle\textrm{min}}_k\f$ and \f$\ell^{\scriptstyle{\rm than
min}}_k\f$ is the largest integer not greater than * \f$\lambda^{\scriptstyle\textrm{min}}_k\f$ and \f$\ell^{\scriptstyle{\rm
\f$\lambda^{\scriptstyle\textrm{min}}_k\f$. * min}}_k\f$ is the largest integer not greater than
* \f$\lambda^{\scriptstyle\textrm{min}}_k\f$.
With these definitions, approximating the integral in *
\eqref{utilities_e_coarse} gives * With these definitions, approximating the integral in
\anchor utilities_e_coarseapprox \f{equation}{\label{utilities_e_coarseappr * \eqref{utilities_e_coarse} gives
ox} * \f{equation}{
h_k = \frac{1}{\rho} * \label{utilities_e_coarseapprox}
\left( * h_k = \frac{1}{\rho}
(\ell^{\scriptstyle\textrm{min}}_k - \lambda^{\scriptstyle\textrm{min}}_k * \left(
) * (\ell^{\scriptstyle\textrm{min}}_k - \lambda^{\scriptstyle\textrm{min}}_
h'_{\ell^{\scriptscriptstyle\textrm{min}}_k-1} k)
+ \sum_{\ell=\ell^{\scriptscriptstyle\textrm{min}}_k} * h'_{\ell^{\scriptscriptstyle\textrm{min}}_k-1}
^{\ell^{\scriptscriptstyle\textrm{max}}_k} * + \sum_{\ell=\ell^{\scriptscriptstyle\textrm{min}}_k}
h'_\ell * ^{\ell^{\scriptscriptstyle\textrm{max}}_k}
+ (\lambda^{\scriptstyle\textrm{max}}_k - \ell^{\scriptstyle\textrm{max}} * h'_\ell
_k) * + (\lambda^{\scriptstyle\textrm{max}}_k - \ell^{\scriptstyle\textrm{max}
h'_{\ell^{\scriptscriptstyle\textrm{max}}_k+1} }_k)
\right) * h'_{\ell^{\scriptscriptstyle\textrm{max}}_k+1}
\f} * \right)
* \f}
In the special case \f$f_0=f'_0\f$, we assume both frequency series *
represent the independent parts of larger frequency series * In the special case \f$f_0=f'_0\f$, we assume both frequency series
\f$\{h_k|k=-(N-1)\ldots(N-1)\}\f$ and \f$\{h'_\ell|\ell=-(N-1)\ldots(N-1)\} * represent the independent parts of larger frequency series
\f$ * \f$\{h_k|k=-(N-1)\ldots(N-1)\}\f$ and \f$\{h'_\ell|\ell=-(N-1)\ldots(N-1
which obey \f$h_{-k}=h_k^*\f$ and \f$h'_{-\ell}{}=h'_\ell{}^*\f$ (e.g., )\}\f$
fourier transforms of real data). In that case, the DC element of the * which obey \f$h_{-k}=h_k^*\f$ and \f$h'_{-\ell}{}=h'_\ell{}^*\f$ (e.g.,
coarse-grained series can be built out of both positive- and implied * fourier transforms of real data). In that case, the DC element of the
negative-frequency elements in the fine-grained series. * coarse-grained series can be built out of both positive- and implied
\f{equation}{ * negative-frequency elements in the fine-grained series.
h_0 = \frac{1}{\rho} * \f{equation}{
\left[ * h_0 = \frac{1}{\rho}
h'_0 * \left[
+ 2\ \mathrm{Re} * h'_0
\left( * + 2\ \mathrm{Re}
\sum_{\ell=1}^{\ell^{\scriptscriptstyle\textrm{max}}_0} * \left(
h'_\ell * \sum_{\ell=1}^{\ell^{\scriptscriptstyle\textrm{max}}_0}
+ (\lambda^{\scriptstyle\textrm{max}}_0 - \ell^{\scriptstyle\textrm{m * h'_\ell
ax}}_0) * + (\lambda^{\scriptstyle\textrm{max}}_0 - \ell^{\scriptstyle\textrm{max}
h'_{\ell^{\scriptscriptstyle\textrm{max}}_0+1} }_0)
\right) * h'_{\ell^{\scriptscriptstyle\textrm{max}}_0+1}
\right] * \right)
\f} * \right]
* \f}
\heading{Algorithm} *
* ### Algorithm ###
These routines move through the output series, using *
\eqref{utilities_e_coarseapprox} to add up the contributions from the * These routines move through the output series, using
bins in the fine-grained series. * \eqref{utilities_e_coarseapprox} to add up the contributions from the
* bins in the fine-grained series.
\heading{Notes} *
<ul> * ### Notes ###
<li> The coarse graining ratio must obey \f$\rho\ge 1\f$ (so the *
coarse-grained frequency spacing must be less than the fine-grained * <ul>
one). Additionally, the bins in the fine-grained frequency series * <li> The coarse graining ratio must obey \f$\rho\ge 1\f$ (so the
must \e completely overlap those in the coarse-grained frequency * coarse-grained frequency spacing must be less than the fine-grained
series. In particular, since the lowest frequency in the first bin * one). Additionally, the bins in the fine-grained frequency series
of the coarse-grained series is \f$f_{\scriptstyle{\rm min}}=f_0-\delta f * must \e completely overlap those in the coarse-grained frequency
/2\f$ * series. In particular, since the lowest frequency in the first bin
and the last is \f$f_{\scriptstyle{\rm max}}=f_0 + (N-1) \delta f +\delta * of the coarse-grained series is \f$f_{\scriptstyle{\rm min}}=f_0-\delta
f/2\f$ f/2\f$
(taking into account the width of the bins), the conitions are * and the last is \f$f_{\scriptstyle{\rm max}}=f_0 + (N-1) \delta f +\delt
\f{eqnarray*}{ a f/2\f$
f_0 - \frac{\delta f}{2} &\ge& f'_0 - \frac{\delta f'}{2}\\ * (taking into account the width of the bins), the conitions are
f_0 + \left(N-\frac{1}{2}\right)\,\delta f &\le& * \f{eqnarray}{
f'_0 + \left(N'-\frac{1}{2}\right)\,\delta f' * f_0 - \frac{\delta f}{2} &\ge& f'_0 - \frac{\delta f'}{2}\\
\f} * f_0 + \left(N-\frac{1}{2}\right)\,\delta f &\le&
(The special case \f$f_0=f'_0=0\f$ is an * f'_0 + \left(N'-\frac{1}{2}\right)\,\delta f'
exception to the condition on the minimum frequency.)</li> * \f}
<li> The routines return an error if either minimum frequency * (The special case \f$f_0=f'_0=0\f$ is an
(\f$f_{\scriptstyle\textrm{min}}\f$ or \f$f'_{\scriptstyle\textrm{min}}\f * exception to the condition on the minimum frequency.)</li>
$) is * <li> The routines return an error if either minimum frequency
negative (unless \f$f_0=0\f$ or \f$f'_0=0\f$, respectively).</li> * (\f$f_{\scriptstyle\textrm{min}}\f$ or \f$f'_{\scriptstyle\textrm{min}}\
</ul> f$) is
* negative (unless \f$f_0=0\f$ or \f$f'_0=0\f$, respectively).</li>
*/ * </ul>
*
*/
/*@{*/ /*@{*/
/**\name Error Codes */ /**\name Error Codes */
/*@{*/ /*@{*/
#define COARSEGRAINFREQUENCYSERIESH_ENULLPTR 1 /**< Null po inter */ #define COARSEGRAINFREQUENCYSERIESH_ENULLPTR 1 /**< Null po inter */
#define COARSEGRAINFREQUENCYSERIESH_ESAMEPTR 2 /**< Input a nd Output pointers the same */ #define COARSEGRAINFREQUENCYSERIESH_ESAMEPTR 2 /**< Input a nd Output pointers the same */
#define COARSEGRAINFREQUENCYSERIESH_EZEROLEN 3 /**< Zero le ngth for data member of series */ #define COARSEGRAINFREQUENCYSERIESH_EZEROLEN 3 /**< Zero le ngth for data member of series */
#define COARSEGRAINFREQUENCYSERIESH_ENONPOSDELTAF 4 /**< Negativ e or zero frequency spacing */ #define COARSEGRAINFREQUENCYSERIESH_ENONPOSDELTAF 4 /**< Negativ e or zero frequency spacing */
#define COARSEGRAINFREQUENCYSERIESH_ENEGFMIN 5 /**< Negativ e start frequency */ #define COARSEGRAINFREQUENCYSERIESH_ENEGFMIN 5 /**< Negativ e start frequency */
#define COARSEGRAINFREQUENCYSERIESH_EMMHETERO 7 /**< Mismatc h in heterodyning frequencies */ #define COARSEGRAINFREQUENCYSERIESH_EMMHETERO 7 /**< Mismatc h in heterodyning frequencies */
 End of changes. 1 change blocks. 
167 lines changed or deleted 169 lines changed or added


 ComplexFFT.h   ComplexFFT.h 
skipping to change at line 37 skipping to change at line 37
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
* \addtogroup ComplexFFT_h * \addtogroup ComplexFFT_h
* *
* \brief Performs complex-to-complex FFTs. * \brief Performs complex-to-complex FFTs.
* *
* \heading{Synopsis} * ### Synopsis ###
*
* \code * \code
* #include <lal/ComplexFFT.h> * #include <lal/ComplexFFT.h>
* \endcode * \endcode
* *
* Perform complex-to-complex fast Fourier transforms of vectors using the * Perform complex-to-complex fast Fourier transforms of vectors using the
* package FFTW [\ref fj_1998]. * package FFTW \cite fj_1998.
* *
*/ */
/*@{*/ /*@{*/
/** \name Error Codes */ /** \name Error Codes */
/*@{*/ /*@{*/
#define COMPLEXFFTH_ENULL 1 /**< Null pointer */ #define COMPLEXFFTH_ENULL 1 /**< Null pointer */
#define COMPLEXFFTH_ENNUL 2 /**< Non-null pointer */ #define COMPLEXFFTH_ENNUL 2 /**< Non-null pointer */
#define COMPLEXFFTH_ESIZE 4 /**< Invalid input size */ #define COMPLEXFFTH_ESIZE 4 /**< Invalid input size */
#define COMPLEXFFTH_ESZMM 8 /**< Size mismatch */ #define COMPLEXFFTH_ESZMM 8 /**< Size mismatch */
#define COMPLEXFFTH_ESLEN 16 /**< Invalid/mismatched sequence lengths */ #define COMPLEXFFTH_ESLEN 16 /**< Invalid/mismatched sequence lengths */
#define COMPLEXFFTH_ESAME 32 /**< Input/Output data vectors are the same */ #define COMPLEXFFTH_ESAME 32 /**< Input/Output data vectors are the same */
skipping to change at line 90 skipping to change at line 91
typedef struct tagCOMPLEX16FFTPlan COMPLEX16FFTPlan; typedef struct tagCOMPLEX16FFTPlan COMPLEX16FFTPlan;
#define tagComplexFFTPlan tagCOMPLEX8FFTPlan #define tagComplexFFTPlan tagCOMPLEX8FFTPlan
#define ComplexFFTPlan COMPLEX8FFTPlan #define ComplexFFTPlan COMPLEX8FFTPlan
/* /*
* *
* XLAL COMPLEX8 functions * XLAL COMPLEX8 functions
* *
*/ */
/** Returns a new COMPLEX8FFTPlan /**
* * Returns a new COMPLEX8FFTPlan
* A COMPLEX8FFTPlan is required to perform a FFT that involves complex dat a. * A COMPLEX8FFTPlan is required to perform a FFT that involves complex dat a.
* A different plan is required for each size of the complex data vectors * A different plan is required for each size of the complex data vectors
* and for each direction of transform (forward or reverse). * and for each direction of transform (forward or reverse).
* A forward transform performs * A forward transform performs
* \f[Z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,z[j]\f] * \f[Z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,z[j]\f]
* where N, the size of the transform, is the length of the vectors z and Z . * where N, the size of the transform, is the length of the vectors z and Z .
* A reverse transform performs * A reverse transform performs
* \f[w[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,W[k]\f] * \f[w[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,W[k]\f]
* where N, the size of the transform, is the length of the vectors w and W . * where N, the size of the transform, is the length of the vectors w and W .
* *
* @note * @note
* The reverse transform of the forward transform of some data is * The reverse transform of the forward transform of some data is
* equal to N times the original data (we therefore call it a "reverse" * equal to N times the original data (we therefore call it a "reverse"
* transform rather than an "inverse" transform). * transform rather than an "inverse" transform).
* *
* @param[in] size The number of points in the complex data. * @param[in] size The number of points in the complex data.
* @param[in] fwdflg Set non-zero for a forward FFT plan; * @param[in] fwdflg Set non-zero for a forward FFT plan;
* otherwise create a reverse plan * otherwise create a reverse plan
* @param[in] measurelvl Measurement level for plan creation: * @param[in] measurelvl Measurement level for plan creation:
* - 0: no measurement, just estimate the plan; * - 0: no measurement, just estimate the plan;
* - 1: measure the best plan; * - 1: measure the best plan;
* - 2: perform a lengthy measurement of the best plan * - 2: perform a lengthy measurement of the best plan;
; * - 3: perform an exhasutive measurement of the best plan.
* - 3: perform an exhasutive measurement of the best
plan.
* @return A pointer to an allocated \c COMPLEX8FFTPlan structure is return ed * @return A pointer to an allocated \c COMPLEX8FFTPlan structure is return ed
* upon successful completion. Otherwise, a \c NULL pointer is returned * upon successful completion. Otherwise, a \c NULL pointer is returned
* and \c xlalErrno is set to indicate the error. * and \c xlalErrno is set to indicate the error.
* @par Errors: * @par Errors:
* The \c XLALCreateCOMPLEX8Plan() function shall fail if: * The \c XLALCreateCOMPLEX8Plan() function shall fail if:
* - [\c XLAL_EBADLEN] The size of the requested plan is 0. * - [\c XLAL_EBADLEN] The size of the requested plan is 0.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed.
* . * .
*/ */
COMPLEX8FFTPlan * XLALCreateCOMPLEX8FFTPlan( UINT4 size, int fwdflg, int me asurelvl ); COMPLEX8FFTPlan * XLALCreateCOMPLEX8FFTPlan( UINT4 size, int fwdflg, int me asurelvl );
/** Returns a new COMPLEX8FFTPlan for a forward transform /**
* Returns a new COMPLEX8FFTPlan for a forward transform
* *
* A COMPLEX8FFTPlan is required to perform a FFT that involves complex dat a. * A COMPLEX8FFTPlan is required to perform a FFT that involves complex dat a.
* A different plan is required for each size of the complex data vectors. * A different plan is required for each size of the complex data vectors.
* A forward transform performs * A forward transform performs
* \f[Z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,z[j]\f] * \f[Z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,z[j]\f]
* where N, the size of the transform, is the length of the vector z and Z. * where N, the size of the transform, is the length of the vector z and Z.
* *
* @param[in] size The number of points in the complex data. * @param[in] size The number of points in the complex data.
* @param[in] measurelvl Measurement level for plan creation: * @param[in] measurelvl Measurement level for plan creation:
* - 0: no measurement, just estimate the plan; * - 0: no measurement, just estimate the plan;
* - 1: measure the best plan; * - 1: measure the best plan;
* - 2: perform a lengthy measurement of the best plan * - 2: perform a lengthy measurement of the best plan;
; * - 3: perform an exhasutive measurement of the best plan.
* - 3: perform an exhasutive measurement of the best
plan.
* @return A pointer to an allocated \c COMPLEX8FFTPlan structure is return ed * @return A pointer to an allocated \c COMPLEX8FFTPlan structure is return ed
* upon successful completion. Otherwise, a \c NULL pointer is returned * upon successful completion. Otherwise, a \c NULL pointer is returned
* and \c xlalErrno is set to indicate the error. * and \c xlalErrno is set to indicate the error.
* @par Errors: * @par Errors:
* The \c XLALCreateForwardCOMPLEX8Plan() function shall fail if: * The \c XLALCreateForwardCOMPLEX8Plan() function shall fail if:
* - [\c XLAL_EBADLEN] The size of the requested plan is 0. * - [\c XLAL_EBADLEN] The size of the requested plan is 0.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed.
* . * .
*/ */
COMPLEX8FFTPlan * XLALCreateForwardCOMPLEX8FFTPlan( UINT4 size, int measure lvl ); COMPLEX8FFTPlan * XLALCreateForwardCOMPLEX8FFTPlan( UINT4 size, int measure lvl );
/** Returns a new COMPLEX8FFTPlan for a reverse transform /**
* Returns a new COMPLEX8FFTPlan for a reverse transform
* *
* A COMPLEX8FFTPlan is required to perform a FFT that involves complex dat a. * A COMPLEX8FFTPlan is required to perform a FFT that involves complex dat a.
* A reverse transform performs * A reverse transform performs
* \f[w[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,W[k]\f] * \f[w[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,W[k]\f]
* where N, the size of the transform, is the length of the vectors w and W . * where N, the size of the transform, is the length of the vectors w and W .
* *
* @note * @note
* The reverse transform of the forward transform of some data is * The reverse transform of the forward transform of some data is
* equal to N times the original data (we therefore call it a "reverse" * equal to N times the original data (we therefore call it a "reverse"
* transform rather than an "inverse" transform). * transform rather than an "inverse" transform).
* *
* @param[in] size The number of points in the complex data. * @param[in] size The number of points in the complex data.
* @param[in] measurelvl Measurement level for plan creation: * @param[in] measurelvl Measurement level for plan creation:
* - 0: no measurement, just estimate the plan; * - 0: no measurement, just estimate the plan;
* - 1: measure the best plan; * - 1: measure the best plan;
* - 2: perform a lengthy measurement of the best plan * - 2: perform a lengthy measurement of the best plan;
; * - 3: perform an exhasutive measurement of the best plan.
* - 3: perform an exhasutive measurement of the best
plan.
* @return A pointer to an allocated \c COMPLEX8FFTPlan structure is return ed * @return A pointer to an allocated \c COMPLEX8FFTPlan structure is return ed
* upon successful completion. Otherwise, a \c NULL pointer is returned * upon successful completion. Otherwise, a \c NULL pointer is returned
* and \c xlalErrno is set to indicate the error. * and \c xlalErrno is set to indicate the error.
* @par Errors: * @par Errors:
* The \c XLALCreateReverseCOMPLEX8Plan() function shall fail if: * The \c XLALCreateReverseCOMPLEX8Plan() function shall fail if:
* - [\c XLAL_EBADLEN] The size of the requested plan is 0. * - [\c XLAL_EBADLEN] The size of the requested plan is 0.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed.
* . * .
*/ */
COMPLEX8FFTPlan * XLALCreateReverseCOMPLEX8FFTPlan( UINT4 size, int measure lvl ); COMPLEX8FFTPlan * XLALCreateReverseCOMPLEX8FFTPlan( UINT4 size, int measure lvl );
/** Destroys a COMPLEX8FFTPlan /**
* Destroys a COMPLEX8FFTPlan
* @param[in] plan A pointer to the COMPLEX8FFTPlan to be destroyed. * @param[in] plan A pointer to the COMPLEX8FFTPlan to be destroyed.
* @return None. * @return None.
*/ */
void XLALDestroyCOMPLEX8FFTPlan( COMPLEX8FFTPlan *plan ); void XLALDestroyCOMPLEX8FFTPlan( COMPLEX8FFTPlan *plan );
/** Perform a COMPLEX8Vector to COMPLEX8Vector FFT /**
* Perform a COMPLEX8Vector to COMPLEX8Vector FFT
* *
* This routine computes * This routine computes
* \f[Z[k] = \sum_{j=0}^{N-1} e^{\mp2\pi ijk/N}\,z[j],\f] * \f[Z[k] = \sum_{j=0}^{N-1} e^{\mp2\pi ijk/N}\,z[j],\f]
* and where the minus sign is used if a forward plan is provided as the ar gument * and where the minus sign is used if a forward plan is provided as the ar gument
* and the plus sign is used if a reverse plan is provided as the argument; * and the plus sign is used if a reverse plan is provided as the argument;
* here N is the length of the input and output vectors z and Z. * here N is the length of the input and output vectors z and Z.
* *
* @param[out] output The complex output data vector Z of length N * @param[out] output The complex output data vector Z of length N
* @param[in] input The input complex data vector z of length N * @param[in] input The input complex data vector z of length N
* @param[in] plan The FFT plan to use for the transform * @param[in] plan The FFT plan to use for the transform
* @note * @note
* The input and output vectors must be distinct. * The input and output vectors must be distinct.
* @return 0 upon successful completion or non-zero upon failure. * @return 0 upon successful completion or non-zero upon failure.
* @par Errors: * @par Errors:
* The \c XLALCOMPLEX8VectorFFT() function shall fail if: * The \c XLALCOMPLEX8VectorFFT() function shall fail if:
* - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments
s. .
* - [\c XLAL_EINVAL] A argument is invalid or the input and output data * - [\c XLAL_EINVAL] A argument is invalid or the input and output data
* vectors are the same. * vectors are the same.
* - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are
* incompatible. * incompatible.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* . * .
*/ */
int XLALCOMPLEX8VectorFFT( COMPLEX8Vector * restrict output, COMPLEX8Vector * restrict input, int XLALCOMPLEX8VectorFFT( COMPLEX8Vector * _LAL_RESTRICT_ output, const CO MPLEX8Vector * _LAL_RESTRICT_ input,
const COMPLEX8FFTPlan *plan ); const COMPLEX8FFTPlan *plan );
/* /*
* *
* XLAL COMPLEX16 functions * XLAL COMPLEX16 functions
* *
*/ */
/** Returns a new COMPLEX16FFTPlan /**
* Returns a new COMPLEX16FFTPlan
* *
* A COMPLEX16FFTPlan is required to perform a FFT that involves complex da ta. * A COMPLEX16FFTPlan is required to perform a FFT that involves complex da ta.
* A different plan is required for each size of the complex data vectors * A different plan is required for each size of the complex data vectors
* and for each direction of transform (forward or reverse). * and for each direction of transform (forward or reverse).
* A forward transform performs * A forward transform performs
* \f[Z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,z[j]\f] * \f[Z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,z[j]\f]
* where N, the size of the transform, is the length of the vectors z and Z . * where N, the size of the transform, is the length of the vectors z and Z .
* A reverse transform performs * A reverse transform performs
* \f[w[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,W[k]\f] * \f[w[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,W[k]\f]
* where N, the size of the transform, is the length of the vectors w and W . * where N, the size of the transform, is the length of the vectors w and W .
* *
* @note * @note
* The reverse transform of the forward transform of some data is * The reverse transform of the forward transform of some data is
* equal to N times the original data (we therefore call it a "reverse" * equal to N times the original data (we therefore call it a "reverse"
* transform rather than an "inverse" transform). * transform rather than an "inverse" transform).
* *
* @param[in] size The number of points in the complex data. * @param[in] size The number of points in the complex data.
* @param[in] fwdflg Set non-zero for a forward FFT plan; * @param[in] fwdflg Set non-zero for a forward FFT plan;
* otherwise create a reverse plan * otherwise create a reverse plan
* @param[in] measurelvl Measurement level for plan creation: * @param[in] measurelvl Measurement level for plan creation:
* - 0: no measurement, just estimate the plan; * - 0: no measurement, just estimate the plan;
* - 1: measure the best plan; * - 1: measure the best plan;
* - 2: perform a lengthy measurement of the best plan * - 2: perform a lengthy measurement of the best plan;
; * - 3: perform an exhasutive measurement of the best plan.
* - 3: perform an exhasutive measurement of the best
plan.
* @return A pointer to an allocated \c COMPLEX16FFTPlan structure is retur ned * @return A pointer to an allocated \c COMPLEX16FFTPlan structure is retur ned
* upon successful completion. Otherwise, a \c NULL pointer is returned * upon successful completion. Otherwise, a \c NULL pointer is returned
* and \c xlalErrno is set to indicate the error. * and \c xlalErrno is set to indicate the error.
* @par Errors: * @par Errors:
* The \c XLALCreateCOMPLEX16Plan() function shall fail if: * The \c XLALCreateCOMPLEX16Plan() function shall fail if:
* - [\c XLAL_EBADLEN] The size of the requested plan is 0. * - [\c XLAL_EBADLEN] The size of the requested plan is 0.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed.
* . * .
*/ */
COMPLEX16FFTPlan * XLALCreateCOMPLEX16FFTPlan( UINT4 size, int fwdflg, int measurelvl ); COMPLEX16FFTPlan * XLALCreateCOMPLEX16FFTPlan( UINT4 size, int fwdflg, int measurelvl );
/** Returns a new COMPLEX16FFTPlan for a forward transform /**
* Returns a new COMPLEX16FFTPlan for a forward transform
* *
* A COMPLEX16FFTPlan is required to perform a FFT that involves complex da ta. * A COMPLEX16FFTPlan is required to perform a FFT that involves complex da ta.
* A different plan is required for each size of the complex data vectors. * A different plan is required for each size of the complex data vectors.
* A forward transform performs * A forward transform performs
* \f[Z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,z[j]\f] * \f[Z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,z[j]\f]
* where N, the size of the transform, is the length of the vector z and Z. * where N, the size of the transform, is the length of the vector z and Z.
* *
* @param[in] size The number of points in the complex data. * @param[in] size The number of points in the complex data.
* @param[in] measurelvl Measurement level for plan creation: * @param[in] measurelvl Measurement level for plan creation:
* - 0: no measurement, just estimate the plan; * - 0: no measurement, just estimate the plan;
* - 1: measure the best plan; * - 1: measure the best plan;
* - 2: perform a lengthy measurement of the best plan * - 2: perform a lengthy measurement of the best plan;
; * - 3: perform an exhasutive measurement of the best plan.
* - 3: perform an exhasutive measurement of the best
plan.
* @return A pointer to an allocated \c COMPLEX16FFTPlan structure is retur ned * @return A pointer to an allocated \c COMPLEX16FFTPlan structure is retur ned
* upon successful completion. Otherwise, a \c NULL pointer is returned * upon successful completion. Otherwise, a \c NULL pointer is returned
* and \c xlalErrno is set to indicate the error. * and \c xlalErrno is set to indicate the error.
* @par Errors: * @par Errors:
* The \c XLALCreateForwardCOMPLEX16Plan() function shall fail if: * The \c XLALCreateForwardCOMPLEX16Plan() function shall fail if:
* - [\c XLAL_EBADLEN] The size of the requested plan is 0. * - [\c XLAL_EBADLEN] The size of the requested plan is 0.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed.
* . * .
*/ */
COMPLEX16FFTPlan * XLALCreateForwardCOMPLEX16FFTPlan( UINT4 size, int measu relvl ); COMPLEX16FFTPlan * XLALCreateForwardCOMPLEX16FFTPlan( UINT4 size, int measu relvl );
/** Returns a new COMPLEX16FFTPlan for a reverse transform /**
* Returns a new COMPLEX16FFTPlan for a reverse transform
* *
* A COMPLEX16FFTPlan is required to perform a FFT that involves complex da ta. * A COMPLEX16FFTPlan is required to perform a FFT that involves complex da ta.
* A reverse transform performs * A reverse transform performs
* \f[w[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,W[k]\f] * \f[w[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,W[k]\f]
* where N, the size of the transform, is the length of the vectors w and W . * where N, the size of the transform, is the length of the vectors w and W .
* *
* @note * @note
* The reverse transform of the forward transform of some data is * The reverse transform of the forward transform of some data is
* equal to N times the original data (we therefore call it a "reverse" * equal to N times the original data (we therefore call it a "reverse"
* transform rather than an "inverse" transform). * transform rather than an "inverse" transform).
* *
* @param[in] size The number of points in the complex data. * @param[in] size The number of points in the complex data.
* @param[in] measurelvl Measurement level for plan creation: * @param[in] measurelvl Measurement level for plan creation:
* - 0: no measurement, just estimate the plan; * - 0: no measurement, just estimate the plan;
* - 1: measure the best plan; * - 1: measure the best plan;
* - 2: perform a lengthy measurement of the best plan * - 2: perform a lengthy measurement of the best plan;
; * - 3: perform an exhasutive measurement of the best plan.
* - 3: perform an exhasutive measurement of the best
plan.
* @return A pointer to an allocated \c COMPLEX16FFTPlan structure is retur ned * @return A pointer to an allocated \c COMPLEX16FFTPlan structure is retur ned
* upon successful completion. Otherwise, a \c NULL pointer is returned * upon successful completion. Otherwise, a \c NULL pointer is returned
* and \c xlalErrno is set to indicate the error. * and \c xlalErrno is set to indicate the error.
* @par Errors: * @par Errors:
* The \c XLALCreateReverseCOMPLEX16Plan() function shall fail if: * The \c XLALCreateReverseCOMPLEX16Plan() function shall fail if:
* - [\c XLAL_EBADLEN] The size of the requested plan is 0. * - [\c XLAL_EBADLEN] The size of the requested plan is 0.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed.
* . * .
*/ */
COMPLEX16FFTPlan * XLALCreateReverseCOMPLEX16FFTPlan( UINT4 size, int measu relvl ); COMPLEX16FFTPlan * XLALCreateReverseCOMPLEX16FFTPlan( UINT4 size, int measu relvl );
/** Destroys a COMPLEX16FFTPlan /**
* Destroys a COMPLEX16FFTPlan
* @param[in] plan A pointer to the COMPLEX16FFTPlan to be destroyed. * @param[in] plan A pointer to the COMPLEX16FFTPlan to be destroyed.
* @return None. * @return None.
*/ */
void XLALDestroyCOMPLEX16FFTPlan( COMPLEX16FFTPlan *plan ); void XLALDestroyCOMPLEX16FFTPlan( COMPLEX16FFTPlan *plan );
/** Perform a COMPLEX16Vector to COMPLEX16Vector FFT /**
* Perform a COMPLEX16Vector to COMPLEX16Vector FFT
* *
* This routine computes * This routine computes
* \f[Z[k] = \sum_{j=0}^{N-1} e^{\mp2\pi ijk/N}\,z[j],\f] * \f[Z[k] = \sum_{j=0}^{N-1} e^{\mp2\pi ijk/N}\,z[j],\f]
* and where the minus sign is used if a forward plan is provided as the ar gument * and where the minus sign is used if a forward plan is provided as the ar gument
* and the plus sign is used if a reverse plan is provided as the argument; * and the plus sign is used if a reverse plan is provided as the argument;
* here N is the length of the input and output vectors z and Z. * here N is the length of the input and output vectors z and Z.
* *
* @param[out] output The complex output data vector Z of length N * @param[out] output The complex output data vector Z of length N
* @param[in] input The input complex data vector z of length N * @param[in] input The input complex data vector z of length N
* @param[in] plan The FFT plan to use for the transform * @param[in] plan The FFT plan to use for the transform
* @note * @note
* The input and output vectors must be distinct. * The input and output vectors must be distinct.
* @return 0 upon successful completion or non-zero upon failure. * @return 0 upon successful completion or non-zero upon failure.
* @par Errors: * @par Errors:
* The \c XLALCOMPLEX16VectorFFT() function shall fail if: * The \c XLALCOMPLEX16VectorFFT() function shall fail if:
* - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments
s. .
* - [\c XLAL_EINVAL] A argument is invalid or the input and output data * - [\c XLAL_EINVAL] A argument is invalid or the input and output data
* vectors are the same. * vectors are the same.
* - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are
* incompatible. * incompatible.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* . * .
*/ */
int XLALCOMPLEX16VectorFFT( COMPLEX16Vector * restrict output, COMPLEX16Vec tor * restrict input, int XLALCOMPLEX16VectorFFT( COMPLEX16Vector * _LAL_RESTRICT_ output, const COMPLEX16Vector * _LAL_RESTRICT_ input,
const COMPLEX16FFTPlan *plan ); const COMPLEX16FFTPlan *plan );
/* /*
* *
* LAL COMPLEX8 functions * LAL COMPLEX8 functions
* *
*/ */
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALCreateForwardCOMPLEX8FFTPlan() instead. * @deprecated Use XLALCreateForwardCOMPLEX8FFTPlan() instead.
*/ */
void void
LALCreateForwardCOMPLEX8FFTPlan( LALCreateForwardCOMPLEX8FFTPlan(
LALStatus *status, LALStatus *status,
COMPLEX8FFTPlan **plan, COMPLEX8FFTPlan **plan,
UINT4 size, UINT4 size,
INT4 measure INT4 measure
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALCreateForwardCOMPLEX8FFTPlan() instead. * @deprecated Use XLALCreateForwardCOMPLEX8FFTPlan() instead.
*/ */
#define LALCreateForwardComplexFFTPlan LALCreateForwardCOMPLEX8FFTPlan #define LALCreateForwardComplexFFTPlan LALCreateForwardCOMPLEX8FFTPlan
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALCreateReverseCOMPLEX8FFTPlan() instead. * @deprecated Use XLALCreateReverseCOMPLEX8FFTPlan() instead.
*/ */
void void
LALCreateReverseCOMPLEX8FFTPlan( LALCreateReverseCOMPLEX8FFTPlan(
LALStatus *status, LALStatus *status,
COMPLEX8FFTPlan **plan, COMPLEX8FFTPlan **plan,
UINT4 size, UINT4 size,
INT4 measure INT4 measure
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALCreateReverseCOMPLEX8FFTPlan() instead. * @deprecated Use XLALCreateReverseCOMPLEX8FFTPlan() instead.
*/ */
#define LALCreateReverseComplexFFTPlan LALCreateReverseCOMPLEX8FFTPlan #define LALCreateReverseComplexFFTPlan LALCreateReverseCOMPLEX8FFTPlan
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALDestroyCOMPLEX8FFTPlan() instead. * @deprecated Use XLALDestroyCOMPLEX8FFTPlan() instead.
*/ */
void void
LALDestroyCOMPLEX8FFTPlan ( LALDestroyCOMPLEX8FFTPlan (
LALStatus *status, LALStatus *status,
COMPLEX8FFTPlan **plan COMPLEX8FFTPlan **plan
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALDestroyCOMPLEX8FFTPlan() instead. * @deprecated Use XLALDestroyCOMPLEX8FFTPlan() instead.
*/ */
#define LALDestroyComplexFFTPlan LALDestroyCOMPLEX8FFTPlan #define LALDestroyComplexFFTPlan LALDestroyCOMPLEX8FFTPlan
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALCOMPLEX8VectorFFT() instead. * @deprecated Use XLALCOMPLEX8VectorFFT() instead.
*/ */
void void
LALCOMPLEX8VectorFFT ( LALCOMPLEX8VectorFFT (
LALStatus *status, LALStatus *status,
COMPLEX8Vector *output, COMPLEX8Vector *output,
COMPLEX8Vector *input, COMPLEX8Vector *input,
COMPLEX8FFTPlan *plan COMPLEX8FFTPlan *plan
); );
/* /*
* *
* LAL COMPLEX16 functions * LAL COMPLEX16 functions
* *
*/ */
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALCreateForwardCOMPLEX16FFTPlan() instead. * @deprecated Use XLALCreateForwardCOMPLEX16FFTPlan() instead.
*/ */
void void
LALCreateForwardCOMPLEX16FFTPlan( LALCreateForwardCOMPLEX16FFTPlan(
LALStatus *status, LALStatus *status,
COMPLEX16FFTPlan **plan, COMPLEX16FFTPlan **plan,
UINT4 size, UINT4 size,
INT4 measure INT4 measure
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALCreateReverseCOMPLEX16FFTPlan() instead. * @deprecated Use XLALCreateReverseCOMPLEX16FFTPlan() instead.
*/ */
void void
LALCreateReverseCOMPLEX16FFTPlan( LALCreateReverseCOMPLEX16FFTPlan(
LALStatus *status, LALStatus *status,
COMPLEX16FFTPlan **plan, COMPLEX16FFTPlan **plan,
UINT4 size, UINT4 size,
INT4 measure INT4 measure
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALDestroyCOMPLEX16FFTPlan() instead. * @deprecated Use XLALDestroyCOMPLEX16FFTPlan() instead.
*/ */
void void
LALDestroyCOMPLEX16FFTPlan ( LALDestroyCOMPLEX16FFTPlan (
LALStatus *status, LALStatus *status,
COMPLEX16FFTPlan **plan COMPLEX16FFTPlan **plan
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALCOMPLEX16VectorFFT() instead. * @deprecated Use XLALCOMPLEX16VectorFFT() instead.
*/ */
void void
LALCOMPLEX16VectorFFT ( LALCOMPLEX16VectorFFT (
LALStatus *status, LALStatus *status,
COMPLEX16Vector *output, COMPLEX16Vector *output,
COMPLEX16Vector *input, COMPLEX16Vector *input,
COMPLEX16FFTPlan *plan COMPLEX16FFTPlan *plan
); );
 End of changes. 42 change blocks. 
105 lines changed or deleted 114 lines changed or added


 ConfigFile.h   ConfigFile.h 
skipping to change at line 31 skipping to change at line 31
#define _CONFIGFILE_H #define _CONFIGFILE_H
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#include <lal/StringInput.h> #include <lal/StringInput.h>
/* C++ protection. */ /* C++ protection. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** \addtogroup ConfigFile_h /**
* \addtogroup ConfigFile_h
* \author Reinhard Prix * \author Reinhard Prix
* \brief Module for general parsing of simple ASCII-based config-files. * \brief Module for general parsing of simple ASCII-based config-files.
*
\heading{Description} * ### Description ###
*
This module provides routines for reading formatted * This module provides routines for reading formatted
config-files containing definitions of the form <tt>variable = value</tt>. * config-files containing definitions of the form <tt>variable = value</tt
The general syntax is somewhat similar to the one provided by the >.
perl-module <tt>ConfigParser</tt> (cf. * The general syntax is somewhat similar to the one provided by the
http://www.python.org/doc/current/lib/module-ConfigParser.html) * perl-module <tt>ConfigParser</tt> (cf.
* http://www.python.org/doc/current/lib/module-ConfigParser.html)
Comments are allowed using either '<tt>\#</tt>' or <tt>\%</tt>. *
You can also use line-continuation using a '<tt>\\</tt>' at the end of the * Comments are allowed using either '<tt>\#</tt>' or <tt>\%</tt>.
line. * You can also use line-continuation using a '<tt>\\</tt>' at the end of
Also note that comment-signs '<tt>\#\%</tt>' within double-quotes &quot;... the line.
&quot; * Also note that comment-signs '<tt>\#\%</tt>' within double-quotes &quot;
are <em>not</em> treated as comment-characters. ...&quot;
Semi-colons <tt>;</tt> are ignored, but can be used to separate several ass * are <em>not</em> treated as comment-characters.
ignments on the same line. * Semi-colons <tt>;</tt> are ignored, but can be used to separate several
The general syntax is best illustrated assignments on the same line.
using a simple example: * The general syntax is best illustrated
\code * using a simple example:
# comment line * \code
var1 = 1.0; var2 = 3.1; ## several assignments on a line, separated by '; * # comment line
' * var1 = 1.0; var2 = 3.1; ## several assignments on a line, separated by
somevar = some text.\ ';'
You can also use\ * somevar = some text.\
line-continuation * You can also use\
var3 = 4 # whatever that means * line-continuation
note = "this is also possible, and # here does nothing" * var3 = 4 # whatever that means
a_switch = true #possible values: 0,1,true,false,yes,no, case insensitive * note = "this is also possible, and # here does nothing"
... * a_switch = true #possible values: 0,1,true,false,yes,no, case insensiti
\endcode ve
* ...
Note that TABS generally get replaced by a single space, which can be * \endcode
useful in the case of line-continuation (see example). All leading and *
trailing spaces in are ignore (except within double-quotes). * Note that TABS generally get replaced by a single space, which can be
* useful in the case of line-continuation (see example). All leading and
The general approach of reading from such a config-file, is to first * trailing spaces in are ignore (except within double-quotes).
call XLALParseDataFile() which loads and pre-parses the contents of the *
config-file into the structure LALParsedDataFile. Then one can read in * The general approach of reading from such a config-file, is to first
config-variables either using one of the type-strict custom-wrappers * call XLALParseDataFile() which loads and pre-parses the contents of the
<tt>XLALReadConfig<TYPE>Variable()</tt> or the general-purpose reading func * config-file into the structure LALParsedDataFile. Then one can read in
tion * config-variables either using one of the type-strict custom-wrappers
XLALReadConfigVariable(). * <tt>XLALReadConfig<TYPE>Variable()</tt> or the general-purpose reading f
unction
A boolean variable read by XLALReadConfigBOOLVariable() can have any of the * XLALReadConfigVariable().
values *
<tt>{1, 0, yes, no, true, false}</tt>, where the comparison is done * A boolean variable read by XLALReadConfigBOOLVariable() can have any of
<em>case-insensitively</em>, i.e. you can also use 'True' or 'FALSE'.... the values
* <tt>{1, 0, yes, no, true, false}</tt>, where the comparison is done
If one wishes a tight sytnax for the config-file, one can check * <em>case-insensitively</em>, i.e. you can also use 'True' or 'FALSE'....
that there are no illegal entries in the config-file. This is done *
by checking at the end that all config-file entries have been * If one wishes a tight sytnax for the config-file, one can check
successfully parsed, using: * that there are no illegal entries in the config-file. This is done
XLALCheckConfigReadComplete(), where \a strictness is either * by checking at the end that all config-file entries have been
CONFIGFILE_WARN or CONFIGFILE_ERROR. * successfully parsed, using:
In the first case only a warning is issued, while in the second it is * XLALCheckConfigReadComplete(), where \a strictness is either
treated as a LAL-error if some config-file entries have not been * CONFIGFILE_WARN or CONFIGFILE_ERROR.
read-in. (The use of this function is optional). * In the first case only a warning is issued, while in the second it is
* treated as a LAL-error if some config-file entries have not been
The configfile-data should be freed at the end using * read-in. (The use of this function is optional).
XLALDestroyParsedDataFile(). *
* The configfile-data should be freed at the end using
\par Notes * XLALDestroyParsedDataFile().
*
XLALReadConfigSTRINGVariable() and XLALReadConfigSTRINGVariable() are not * \par Notes
the same as using <tt>%quot;\%s&quot;</tt> as a format string, as they read *
the * XLALReadConfigSTRINGVariable() and XLALReadConfigSTRINGVariable() are no
<em>rest</em> of the logical line (excluding comments) as a string. t
* the same as using <tt>%quot;\%s&quot;</tt> as a format string, as they r
In the case of XLALReadConfigSTRINGVariable(), the required ead the
memory is allocated and has to be freed by the caller, while for * <em>rest</em> of the logical line (excluding comments) as a string.
XLALReadConfigSTRINGVariable() the caller has to provide a *
CHARVector of length N, which defines the maximum length of * In the case of XLALReadConfigSTRINGVariable(), the required
string to be read. * memory is allocated and has to be freed by the caller, while for
* XLALReadConfigSTRINGVariable() the caller has to provide a
\note instead of using these functions directly, it might be * CHARVector of length N, which defines the maximum length of
more convenient to use the \ref UserInput_h. * string to be read.
*
*/ * \note instead of using these functions directly, it might be
* more convenient to use the \ref UserInput_h.
*
*/
/*@{*/ /*@{*/
/** Levels of strictness for config-file parsing. */ /** Levels of strictness for config-file parsing. */
typedef enum { typedef enum {
CONFIGFILE_IGNORE = 0, /**< ignore missing config-variable or unpar sed config-entries */ CONFIGFILE_IGNORE = 0, /**< ignore missing config-variable or unpar sed config-entries */
CONFIGFILE_WARN, /**< issue a warning but don't report an err or. */ CONFIGFILE_WARN, /**< issue a warning but don't report an err or. */
CONFIGFILE_ERROR, /**< issue an error-message and report a LAL -error */ CONFIGFILE_ERROR, /**< issue an error-message and report a LAL -error */
CONFIGFILE_LAST CONFIGFILE_LAST
} ConfigStrictness; } ConfigStrictness;
/** This structure defines a config-variable to be read in using the /**
* general-purpose reading function LALReadConfigVariable(). */ * This structure defines a config-variable to be read in using the
* general-purpose reading function LALReadConfigVariable().
*/
#ifdef SWIG /* SWIG interface directives */ #ifdef SWIG /* SWIG interface directives */
SWIGLAL(IMMUTABLE_MEMBERS(tagLALConfigVar, secName, varName, fmt)); SWIGLAL(IMMUTABLE_MEMBERS(tagLALConfigVar, secName, varName, fmt));
#endif /* SWIG */ #endif /* SWIG */
typedef struct tagLALConfigVar { typedef struct tagLALConfigVar {
const CHAR *secName; /**< Section name within which to find varN ame. May be NULL */ const CHAR *secName; /**< Section name within which to find varN ame. May be NULL */
const CHAR *varName; /**< Variable-name to be read in the config- file */ const CHAR *varName; /**< Variable-name to be read in the config- file */
const CHAR *fmt; /**< Format string for reading (<tt>sscanf() </tt>-style) */ const CHAR *fmt; /**< Format string for reading (<tt>sscanf() </tt>-style) */
ConfigStrictness strictness; /**< what to do if variable not found: ignor e, warn, error */ ConfigStrictness strictness; /**< what to do if variable not found: ignor e, warn, error */
} LALConfigVar; } LALConfigVar;
/** This structure is returned by LALParseDataFile() and holds the contents /**
of an * This structure is returned by LALParseDataFile() and holds the contents
of an
* ASCII data-file in a pre-parsed form, namely stripped from all comments ('\#', '\%'), * ASCII data-file in a pre-parsed form, namely stripped from all comments ('\#', '\%'),
* spurious whitespaces, and separated into lines (taking into account line -continuation * spurious whitespaces, and separated into lines (taking into account line -continuation
* by '\\' at the end of lines). * by '\\' at the end of lines).
* This is used as the input structure in the config-variable reading routi nes. * This is used as the input structure in the config-variable reading routi nes.
*/ */
typedef struct tagLALParsedDataFile { typedef struct tagLALParsedDataFile {
TokenList *lines; /**< list of pre-parsed data-file lines */ TokenList *lines; /**< list of pre-parsed data-file lines */
BOOLEAN *wasRead; /**< keep track of successfully read lines for stric tness-checking */ BOOLEAN *wasRead; /**< keep track of successfully read lines for stric tness-checking */
} LALParsedDataFile; } LALParsedDataFile;
/* Function prototypes */ /* Function prototypes */
int XLALParseDataFile (LALParsedDataFile **cfgdata, const CHAR *fname); int XLALParseDataFile (LALParsedDataFile **cfgdata, const CHAR *fname);
int XLALParseDataFileContent (LALParsedDataFile **cfgdata, const CHAR *stri
ng );
void XLALDestroyParsedDataFile (LALParsedDataFile *cfgdata); void XLALDestroyParsedDataFile (LALParsedDataFile *cfgdata);
int XLALConfigSectionExists(const LALParsedDataFile *, const CHAR *); int XLALConfigSectionExists(const LALParsedDataFile *, const CHAR *);
LALStringVector *XLALListConfigFileSections ( const LALParsedDataFile *cfgd ata );
int int
XLALReadConfigBOOLVariable (BOOLEAN *varp, XLALReadConfigBOOLVariable (BOOLEAN *varp,
const LALParsedDataFile *cfgdata, const LALParsedDataFile *cfgdata,
const CHAR *secName, const CHAR *secName,
const CHAR *varName, const CHAR *varName,
BOOLEAN *wasRead); BOOLEAN *wasRead);
int int
XLALReadConfigINT4Variable (INT4 *varp, XLALReadConfigINT4Variable (INT4 *varp,
const LALParsedDataFile *cfgdata, const LALParsedDataFile *cfgdata,
skipping to change at line 220 skipping to change at line 227
#define CONFIGFILEH_MSGEFMT "Config variable not readable using given format-string." #define CONFIGFILEH_MSGEFMT "Config variable not readable using given format-string."
#define CONFIGFILEH_MSGETOKENS "The input ConfigData seems corrupte d." #define CONFIGFILEH_MSGETOKENS "The input ConfigData seems corrupte d."
#define CONFIGFILEH_MSGENONULL "Output pointer is not NULL" #define CONFIGFILEH_MSGENONULL "Output pointer is not NULL"
#define CONFIGFILEH_MSGEUNKNOWN "Unknown config-file entry f ound" #define CONFIGFILEH_MSGEUNKNOWN "Unknown config-file entry f ound"
#define CONFIGFILEH_MSGEMEM "Out of memory" #define CONFIGFILEH_MSGEMEM "Out of memory"
#define CONFIGFILEH_MSGEBOOL "Illegal BOOLEAN entry" #define CONFIGFILEH_MSGEBOOL "Illegal BOOLEAN entry"
#define CONFIGFILEH_MSGESTRING "Malformed quoted string" #define CONFIGFILEH_MSGESTRING "Malformed quoted string"
#define CONFIGFILEH_MSGEXLAL "Failure in XLAL function" #define CONFIGFILEH_MSGEXLAL "Failure in XLAL function"
/** \endcond */ /** \endcond */
/** \name Deprecated LAL-interface /**
* \name Deprecated LAL-interface
* These functions are deprecated, and you should user their XLAL-equivalen ts instead. * These functions are deprecated, and you should user their XLAL-equivalen ts instead.
*/ /*@{*/ */
/*@{*/
void LALParseDataFile (LALStatus *, LALParsedDataFile **cfgdata, const CHAR *fname); void LALParseDataFile (LALStatus *, LALParsedDataFile **cfgdata, const CHAR *fname);
void LALDestroyParsedDataFile (LALStatus *, LALParsedDataFile **cfgdata); void LALDestroyParsedDataFile (LALStatus *, LALParsedDataFile **cfgdata);
void LALReadConfigBOOLVariable (LALStatus *, BOOLEAN *varp, const LALParsed DataFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead); void LALReadConfigBOOLVariable (LALStatus *, BOOLEAN *varp, const LALParsed DataFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead);
void LALReadConfigINT4Variable (LALStatus *, INT4 *varp, const LALParsedDat aFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead); void LALReadConfigINT4Variable (LALStatus *, INT4 *varp, const LALParsedDat aFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead);
void LALReadConfigREAL8Variable (LALStatus *, REAL8 *varp, const LALParsedD ataFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead); void LALReadConfigREAL8Variable (LALStatus *, REAL8 *varp, const LALParsedD ataFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead);
void LALReadConfigSTRINGVariable (LALStatus *, CHAR **varp, const LALParsed DataFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead); void LALReadConfigSTRINGVariable (LALStatus *, CHAR **varp, const LALParsed DataFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead);
void LALReadConfigSTRINGNVariable (LALStatus *, CHARVector *varp, const LAL ParsedDataFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead); void LALReadConfigSTRINGNVariable (LALStatus *, CHARVector *varp, const LAL ParsedDataFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead);
void LALReadConfigVariable (LALStatus *, void *varp, const LALParsedDataFil e *cfgdata, const LALConfigVar *param, BOOLEAN *wasRead); void LALReadConfigVariable (LALStatus *, void *varp, const LALParsedDataFil e *cfgdata, const LALConfigVar *param, BOOLEAN *wasRead);
void LALCheckConfigReadComplete (LALStatus *, const LALParsedDataFile *cfgd ata, ConfigStrictness strict); void LALCheckConfigReadComplete (LALStatus *, const LALParsedDataFile *cfgd ata, ConfigStrictness strict);
 End of changes. 8 change blocks. 
86 lines changed or deleted 99 lines changed or added


 Date.h   Date.h 
skipping to change at line 48 skipping to change at line 48
#endif #endif
#define XLAL_BILLION_INT4 1000000000 #define XLAL_BILLION_INT4 1000000000
#define XLAL_BILLION_INT8 LAL_INT8_C( 1000000000 ) #define XLAL_BILLION_INT8 LAL_INT8_C( 1000000000 )
#define XLAL_BILLION_REAL8 1e9 #define XLAL_BILLION_REAL8 1e9
/** /**
* \addtogroup Date_h * \addtogroup Date_h
* \author D.W. Chin, J.D.E. Creighton and Kipp Cannon * \author D.W. Chin, J.D.E. Creighton and Kipp Cannon
* \brief Provides routines for manipulating date and time information. * \brief Provides routines for manipulating date and time information.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/Date.h> * \code
\endcode * #include <lal/Date.h>
* \endcode
This header covers routines for manipulating date and time *
information. The various time systems are discussed in [\ref esaa1992]. * This header covers routines for manipulating date and time
* information. The various time systems are discussed in \cite esaa1992.
*/ *
*/
/*@{*/ /*@{*/
/** The UNIX time of the GPS origin epoch. /**
* * The UNIX time of the GPS origin epoch.
* 1980 6 JAN 0h UTC is 3657 days after 1970 1 JAN 0h UTC: * 1980 6 JAN 0h UTC is 3657 days after 1970 1 JAN 0h UTC:
* 8 standard years of 365 days = 2920 days * 8 standard years of 365 days = 2920 days
* 2 leap years of 366 days = 734 days * 2 leap years of 366 days = 734 days
* 5 extra days. * 5 extra days.
* Hence 3657*86400=315964800. * Hence 3657*86400=315964800.
* *
* Note that this deliberately does not account for any leap seconds in the * Note that this deliberately does not account for any leap seconds in the
* interval. POSIX:2001 defines the relation between the UNIX time * interval. POSIX:2001 defines the relation between the UNIX time
* \c time_t \c t and a broken down time \c struct \c tm \c utc as * \c time_t \c t and a broken down time \c struct \c tm \c utc as
* \code * \code
* t = utc.tm_sec + utc.tm_min*60 + utc.tm_hour*3600 * t = utc.tm_sec + utc.tm_min*60 + utc.tm_hour*3600
* + utc.tm_yday*86400 + (utc.tm_year-70)*31536000 * + utc.tm_yday*86400 + (utc.tm_year-70)*31536000
* + ((utc.tm_year-69)/4)*86400 - ((utc.tm_year-1)/100)*86400 * + ((utc.tm_year-69)/4)*86400 - ((utc.tm_year-1)/100)*86400
* + ((utc.tm_year+299)/400)*86400; * + ((utc.tm_year+299)/400)*86400;
* \endcode * \endcode
* so if you were to set \c utc.tm_sec=utc.tm_min=utc.tm_hour=0, * so if you were to set \c utc.tm_sec=utc.tm_min=utc.tm_hour=0,
* \c utc.tm_yday=5, and \c utc.tm_year=80, then you get * \c utc.tm_yday=5, and \c utc.tm_year=80, then you get
* \c t=315964800. That is what this is. * \c t=315964800. That is what this is.
*/ */
#define XLAL_EPOCH_UNIX_GPS 315964800 #define XLAL_EPOCH_UNIX_GPS 315964800
#define XLAL_EPOCH_J2000_0_JD 2451545.0 /**< Julian Day of the J200 0.0 epoch (2000 JAN 1 12h UTC). */ #define XLAL_EPOCH_J2000_0_JD 2451545.0 /**< Julian Day of the J200 0.0 epoch (2000 JAN 1 12h UTC). */
#define XLAL_EPOCH_J2000_0_TAI_UTC 32 /**< Leap seconds (TAI-UTC) on the J2000.0 epoch (2000 JAN 1 12h UTC). */ #define XLAL_EPOCH_J2000_0_TAI_UTC 32 /**< Leap seconds (TAI-UTC) on the J2000.0 epoch (2000 JAN 1 12h UTC). */
#define XLAL_EPOCH_J2000_0_GPS 630763213 /**< GPS seconds of the J20 00.0 epoch (2000 JAN 1 12h UTC). */ #define XLAL_EPOCH_J2000_0_GPS 630763213 /**< GPS seconds of the J20 00.0 epoch (2000 JAN 1 12h UTC). */
#define XLAL_EPOCH_GPS_JD 2444244.5 /**< Julian Day of the GPS epoch (1980 JAN 6 0h UTC) */ #define XLAL_EPOCH_GPS_JD 2444244.5 /**< Julian Day of the GPS epoch (1980 JAN 6 0h UTC) */
#define XLAL_EPOCH_GPS_TAI_UTC 19 /**< Leap seconds (TAI-UTC) on the GPS epoch (1980 JAN 6 0h UTC) */ #define XLAL_EPOCH_GPS_TAI_UTC 19 /**< Leap seconds (TAI-UTC) on the GPS epoch (1980 JAN 6 0h UTC) */
#define XLAL_MJD_REF 2400000.5 /**< Reference Julian Day f or Mean Julian Day. */ #define XLAL_MJD_REF 2400000.5 /**< Reference Julian Day f or Mean Julian Day. */
#define XLAL_MODIFIED_JULIEN_DAY(utc) (XLALJulianDay(utc)-XLAL_MJD_REF) /** < Modified Julian Day for specified civil time structure. */ #define XLAL_MODIFIED_JULIEN_DAY(utc) (XLALJulianDay(utc)-XLAL_MJD_REF) /** < Modified Julian Day for specified civil time structure. */
/** This structure stores pointers to a ::LALDetector and a /**
* This structure stores pointers to a ::LALDetector and a
* ::LIGOTimeGPS. Its sole purpose is to aggregate these * ::LIGOTimeGPS. Its sole purpose is to aggregate these
* structures for passing to functions. * structures for passing to functions.
*/ */
typedef struct typedef struct
tagLALPlaceAndGPS tagLALPlaceAndGPS
{ {
LALDetector *p_detector; /**< pointer to a detector */ const LALDetector *p_detector; /**< pointer to a detector */
LIGOTimeGPS *p_gps; /**< Pointer to a GPS time structure */ LIGOTimeGPS *p_gps; /**< Pointer to a GPS time structure */
} }
LALPlaceAndGPS; LALPlaceAndGPS;
/*@}*/ /*@}*/
/* ---------- Function prototypes : see respective source.c files for doxyg en documentation ---------- */ /* ---------- Function prototypes : see respective source.c files for doxyg en documentation ---------- */
#ifndef SWIG // exclude from SWIG interface #ifndef SWIG /* exclude from SWIG interface */
/* Converts GPS time to nano seconds stored as an INT8. */ /* Converts GPS time to nano seconds stored as an INT8. */
INT8 XLALGPSToINT8NS( const LIGOTimeGPS *epoch ); INT8 XLALGPSToINT8NS( const LIGOTimeGPS *epoch );
/* Converts nano seconds stored as an INT8 to GPS time. */ /* Converts nano seconds stored as an INT8 to GPS time. */
LIGOTimeGPS * XLALINT8NSToGPS( LIGOTimeGPS *epoch, INT8 ns ); LIGOTimeGPS * XLALINT8NSToGPS( LIGOTimeGPS *epoch, INT8 ns );
/* Sets GPS time given GPS integer seconds and residual nanoseconds. */ /* Sets GPS time given GPS integer seconds and residual nanoseconds. */
LIGOTimeGPS * XLALGPSSet( LIGOTimeGPS *epoch, INT4 gpssec, INT8 gpsnan ); LIGOTimeGPS * XLALGPSSet( LIGOTimeGPS *epoch, INT4 gpssec, INT8 gpsnan );
/* Sets GPS time given GPS seconds as a REAL8. */ /* Sets GPS time given GPS seconds as a REAL8. */
LIGOTimeGPS * XLALGPSSetREAL8( LIGOTimeGPS *epoch, REAL8 t ); LIGOTimeGPS * XLALGPSSetREAL8( LIGOTimeGPS *epoch, REAL8 t );
/* Returns GPS time as a REAL8. */ /* Returns GPS time as a REAL8. */
REAL8 XLALGPSGetREAL8( const LIGOTimeGPS *epoch ); REAL8 XLALGPSGetREAL8( const LIGOTimeGPS *epoch );
/** Breaks the GPS time into REAL8 integral and fractional parts, /**
* Breaks the GPS time into REAL8 integral and fractional parts,
* each of which has the same sign as the epoch. Returns the * each of which has the same sign as the epoch. Returns the
* fractional part, and stores the integral part (as a REAL8) * fractional part, and stores the integral part (as a REAL8)
* in the object pointed to by iptr. Like the standard C math * in the object pointed to by iptr. Like the standard C math
* library function modf(). */ * library function modf().
*/
REAL8 XLALGPSModf( REAL8 *iptr, const LIGOTimeGPS *epoch ); REAL8 XLALGPSModf( REAL8 *iptr, const LIGOTimeGPS *epoch );
/* Adds dt to a GPS time. */ /* Adds dt to a GPS time. */
LIGOTimeGPS * XLALGPSAdd( LIGOTimeGPS *epoch, REAL8 dt ); LIGOTimeGPS * XLALGPSAdd( LIGOTimeGPS *epoch, REAL8 dt );
/* Adds two GPS times. */ /* Adds two GPS times. */
LIGOTimeGPS * XLALGPSAddGPS( LIGOTimeGPS *epoch, const LIGOTimeGPS *dt ); LIGOTimeGPS * XLALGPSAddGPS( LIGOTimeGPS *epoch, const LIGOTimeGPS *dt );
/* Difference between two GPS times. */ /* Difference between two GPS times. */
REAL8 XLALGPSDiff( const LIGOTimeGPS *t1, const LIGOTimeGPS *t0 ); REAL8 XLALGPSDiff( const LIGOTimeGPS *t1, const LIGOTimeGPS *t0 );
skipping to change at line 155 skipping to change at line 159
/* Divide a GPS time by a REAL8 */ /* Divide a GPS time by a REAL8 */
LIGOTimeGPS *XLALGPSDivide( LIGOTimeGPS *gps, REAL8 x ); LIGOTimeGPS *XLALGPSDivide( LIGOTimeGPS *gps, REAL8 x );
/* Parse an ASCII string into a LIGOTimeGPS structure */ /* Parse an ASCII string into a LIGOTimeGPS structure */
int XLALStrToGPS(LIGOTimeGPS *t, const char *nptr, char **endptr); int XLALStrToGPS(LIGOTimeGPS *t, const char *nptr, char **endptr);
/* Return a string containing the ASCII base 10 representation of a LIGOTim eGPS. */ /* Return a string containing the ASCII base 10 representation of a LIGOTim eGPS. */
char *XLALGPSToStr(char *, const LIGOTimeGPS *t); char *XLALGPSToStr(char *, const LIGOTimeGPS *t);
#endif // !SWIG #endif /* !SWIG */
#ifdef SWIG // SWIG interface directives #ifdef SWIG /* SWIG interface directives */
SWIGLAL(NEW_EMPTY_ARGUMENT(LIGOTimeGPS*, gpstime)); SWIGLAL(NEW_EMPTY_ARGUMENT(LIGOTimeGPS*, gpstime));
#endif #endif
/* This function returns the current GPS time according to the system clock */ /* This function returns the current GPS time according to the system clock */
LIGOTimeGPS* XLALGPSTimeNow( LIGOTimeGPS *gpstime ); LIGOTimeGPS* XLALGPSTimeNow( LIGOTimeGPS *gpstime );
#ifdef SWIG // SWIG interface directives #ifdef SWIG /* SWIG interface directives */
SWIGLAL_CLEAR(NEW_EMPTY_ARGUMENT(LIGOTimeGPS*, gpstime)); SWIGLAL_CLEAR(NEW_EMPTY_ARGUMENT(LIGOTimeGPS*, gpstime));
#endif #endif
/* Returns the leap seconds TAI-UTC at a given GPS second. */ /* Returns the leap seconds TAI-UTC at a given GPS second. */
int XLALLeapSeconds( INT4 gpssec ); int XLALLeapSeconds( INT4 gpssec );
/* Returns the leap seconds GPS-UTC at a given GPS second. */ /* Returns the leap seconds GPS-UTC at a given GPS second. */
int XLALGPSLeapSeconds( INT4 gpssec ); int XLALGPSLeapSeconds( INT4 gpssec );
/* Returns the leap seconds TAI-UTC for a given UTC broken down time. */ /* Returns the leap seconds TAI-UTC for a given UTC broken down time. */
int XLALLeapSecondsUTC( const struct tm *utc ); int XLALLeapSecondsUTC( const struct tm *utc );
/* Returns the GPS seconds since the GPS epoch for a specified UTC time str ucture. */ /* Returns the GPS seconds since the GPS epoch for a specified UTC time str ucture. */
INT4 XLALUTCToGPS( const struct tm *utc ); INT4 XLALUTCToGPS( const struct tm *utc );
#ifdef SWIG // SWIG interface directives #ifdef SWIG /* SWIG interface directives */
SWIGLAL(EMPTY_ARGUMENT(struct tm*, utc)); SWIGLAL(EMPTY_ARGUMENT(struct tm*, utc));
#endif #endif
/* Returns a pointer to a tm structure representing the time /* Returns a pointer to a tm structure representing the time
* specified in seconds since the GPS epoch. */ * specified in seconds since the GPS epoch. */
struct tm* XLALGPSToUTC( struct tm *utc, INT4 gpssec ); struct tm* XLALGPSToUTC( struct tm *utc, INT4 gpssec );
#ifdef SWIG // SWIG interface directives #ifdef SWIG /* SWIG interface directives */
SWIGLAL_CLEAR(EMPTY_ARGUMENT(struct tm*, utc)); SWIGLAL_CLEAR(EMPTY_ARGUMENT(struct tm*, utc));
#endif #endif
/* Returns the Julian Day (JD) corresponding to the date given in a broken /* Returns the Julian Day (JD) corresponding to the date given in a broken
* down time structure. */ * down time structure. */
REAL8 XLALJulianDay( const struct tm *utc ); REAL8 XLALJulianDay( const struct tm *utc );
/* Returns the Modified Julian Day (MJD) corresponding to the date given in a broken down time structure.*/ /* Returns the Modified Julian Day (MJD) corresponding to the date given in a broken down time structure.*/
INT4 XLALModifiedJulianDay( const struct tm *utc ); INT4 XLALModifiedJulianDay( const struct tm *utc );
 End of changes. 13 change blocks. 
25 lines changed or deleted 29 lines changed or added


 DetResponse.h   DetResponse.h 
skipping to change at line 36 skipping to change at line 36
#include <lal/LALConstants.h> #include <lal/LALConstants.h>
#include <lal/DetectorSite.h> #include <lal/DetectorSite.h>
#include <lal/SkyCoordinates.h> #include <lal/SkyCoordinates.h>
#include <lal/Date.h> #include <lal/Date.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif #endif
/** \addtogroup DetResponse_h /**
\author David Chin <dwchin@umich.edu>, Kipp Cannon <kipp@gravity.phys.u * \addtogroup DetResponse_h
wm.edu> * \author David Chin <dwchin@umich.edu>, Kipp Cannon <kipp@gravity.phys.uw
m.edu>
\brief Provides routines to compute gravitational wave detector respons *
e to * \brief Provides routines to compute gravitational wave detector response
polarized planar gravitational wave originating from a given source, to
detected at a given time. * polarized planar gravitational wave originating from a given source,
* detected at a given time.
\heading{Synopsis} *
* ### Synopsis ###
\code *
#include <lal/DetResponse.h> * \code
\endcode * #include <lal/DetResponse.h>
* \endcode
\heading{Description} *
* ### Description ###
These routines compute the antenna beam pattern for all supported detector *
types. <tt>XLALComputeDetAMResponse()</tt> computes the response at one * These routines compute the antenna beam pattern for all supported detect
instance in time, and <tt>XLALComputeDetAMResponseSeries()</tt> computes a or
vector of response for some length of time. * types. <tt>XLALComputeDetAMResponse()</tt> computes the response at one
* instance in time, and <tt>XLALComputeDetAMResponseSeries()</tt> computes
\heading{Algorithm} a
* vector of response for some length of time.
This code is a translation of the algorithm in the Maple worksheet by *
Anderson, <em>et al.</em> [\ref Anderson_2000]. We compute the \f$h\f$-ten * ### Algorithm ###
sors for *
\f$+\f$- and \f$\times\f$-polarized in the Earth-fixed frame, and then cont * This code is a translation of the algorithm in the Maple worksheet by
ract * Anderson, <em>et al.</em> \cite ABCCRW_2001. We compute the \f$h\f$-ten
them (take the scalar product) with the detector response tensors as sors for
described in the \ref LALDetectors_h section of the \c tools package. * \f$+\f$- and \f$\times\f$-polarized in the Earth-fixed frame, and then c
ontract
\ref LALDetectors_h provides predefined * them (take the scalar product) with the detector response tensors as
\c LALDetector structures representing most current detectors, * described in the \ref LALDetectors_h section of the \c tools package.
including LIGO (Hanford and Livingston), and GEO. *
* \ref LALDetectors_h provides predefined
\heading{Notes} * \c LALDetector structures representing most current detectors,
* including LIGO (Hanford and Livingston), and GEO.
For examples of usage, please see the test programs in the \c test director *
y. * ### Notes ###
*
*/ * For examples of usage, please see the test programs in the \c test direc
tory.
*
*/
/*@{*/ /*@{*/
/** \name Error Codes */ /** \name Error Codes */
/*@{*/ /*@{*/
#define DETRESPONSEH_ENULLINPUT 1 /**< Input is NULL */ #define DETRESPONSEH_ENULLINPUT 1 /**< Input is NULL */
#define DETRESPONSEH_ENULLOUTPUT 2 /**< Output is NULL */ #define DETRESPONSEH_ENULLOUTPUT 2 /**< Output is NULL */
#define DETRESPONSEH_ESRCNOTEQUATORIAL 3 /**< Source coordinates not in Equatorial system */ #define DETRESPONSEH_ESRCNOTEQUATORIAL 3 /**< Source coordinates not in Equatorial system */
/*@}*/ /*@}*/
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
#define DETRESPONSEH_MSGENULLINPUT "Input is NULL" #define DETRESPONSEH_MSGENULLINPUT "Input is NULL"
#define DETRESPONSEH_MSGENULLOUTPUT "Output is NULL" #define DETRESPONSEH_MSGENULLOUTPUT "Output is NULL"
#define DETRESPONSEH_MSGESRCNOTEQUATORIAL "Source coordinates not in Equato rial system" #define DETRESPONSEH_MSGESRCNOTEQUATORIAL "Source coordinates not in Equato rial system"
/** \endcond */ /** \endcond */
/** This structure contains gravitational wave source position (in Equatori /**
al * This structure contains gravitational wave source position (in Equatoria
l
* coördinates), and orientation angle. * coördinates), and orientation angle.
* The orientation is measured counter-clockwise with respect to the "line of ascending nodes", * The orientation is measured counter-clockwise with respect to the "line of ascending nodes",
* i.e. counter-clockwise with respect to a line perpendicular to the * i.e. counter-clockwise with respect to a line perpendicular to the
* source's meridian and extending westwards. For a source in the Northern * source's meridian and extending westwards. For a source in the Northern
* celestial hemisphere, and an observer in the Northern hemisphere standin g * celestial hemisphere, and an observer in the Northern hemisphere standin g
* such that they are facing South, this angle is measured counter-clockwis e * such that they are facing South, this angle is measured counter-clockwis e
* from a 3 o'clock position (pointing West) at the source. The polarizati on * from a 3 o'clock position (pointing West) at the source. The polarizati on
* convention is chosen such that if the source orientation were zero, the * convention is chosen such that if the source orientation were zero, the
* source would be a pure \f$+\f$-polarized source. * source would be a pure \f$+\f$-polarized source.
*/ */
skipping to change at line 112 skipping to change at line 114
CHAR name[LALNameLength]; /**< name of source, eg catalog number */ CHAR name[LALNameLength]; /**< name of source, eg catalog number */
SkyPosition equatorialCoords; /**< equatorial coordinates of source, in decimal RADIANS */ SkyPosition equatorialCoords; /**< equatorial coordinates of source, in decimal RADIANS */
REAL8 orientation; /**< Orientation angle (\f$\psi\f$) of source: REAL8 orientation; /**< Orientation angle (\f$\psi\f$) of source:
* counter-clockwise angle \f$x\f$-axi s makes with a line perpendicular to * counter-clockwise angle \f$x\f$-axi s makes with a line perpendicular to
* meridian of source in Westward dire ction (i.e. North of West), * meridian of source in Westward dire ction (i.e. North of West),
* in decimal radians. * in decimal radians.
*/ */
} }
LALSource; LALSource;
/** This structure aggregates a pointer to a \c LALDetector and a /**
* This structure aggregates a pointer to a \c LALDetector and a
* \c LALSource. Its sole function is to allow the user to pass * \c LALSource. Its sole function is to allow the user to pass
* detector and source parameters to the functions * detector and source parameters to the functions
* LALComputeDetAMResponse() and * LALComputeDetAMResponse() and
* LALComputeDetAMResponseSeries(). * LALComputeDetAMResponseSeries().
*/ */
typedef struct typedef struct
tagLALDetAndSource tagLALDetAndSource
{ {
LALDetector *pDetector; /**< Pointer to ::LALDetector object contain ing information about the detector */ const LALDetector *pDetector;/**< Pointer to ::LALDetector object contai ning information about the detector */
LALSource *pSource; /**< Pointer to ::LALSource object containin g information about the source */ LALSource *pSource; /**< Pointer to ::LALSource object containin g information about the source */
} }
LALDetAndSource; LALDetAndSource;
/** This structure encapsulates the detector AM (beam pattern) coefficients /**
for * This structure encapsulates the detector AM (beam pattern) coefficients
for
* one source at one instance in time. * one source at one instance in time.
*/ */
typedef struct typedef struct
tagLALDetAMResponse tagLALDetAMResponse
{ {
REAL4 plus; /**< Detector response to \f$+\f$-polarized gravitational ra diation */ REAL4 plus; /**< Detector response to \f$+\f$-polarized gravitational ra diation */
REAL4 cross; /**< Detector response to \f$\times\f$-polarized gravitation al radiation */ REAL4 cross; /**< Detector response to \f$\times\f$-polarized gravitation al radiation */
REAL4 scalar; /**< Detector response to scalar gravitational radia tion (NB: ignored at present -- scalar response computation not yet impleme nted) */ REAL4 scalar; /**< Detector response to scalar gravitational radia tion (NB: ignored at present -- scalar response computation not yet impleme nted) */
} }
LALDetAMResponse; LALDetAMResponse;
/** This structure aggregates together three ::REAL4TimeSeries objects cont /**
aining * This structure aggregates together three ::REAL4TimeSeries objects conta
ining
* time series of detector AM response. * time series of detector AM response.
*/ */
typedef struct typedef struct
tagLALDetAMResponseSeries tagLALDetAMResponseSeries
{ {
REAL4TimeSeries *pPlus; /**< timeseries of detector response to \f$+ \f$-polarized gravitational radiation */ REAL4TimeSeries *pPlus; /**< timeseries of detector response to \f$+ \f$-polarized gravitational radiation */
REAL4TimeSeries *pCross; /**< timeseries of detector response to \f$\ times\f$-polarized gravitational radiation */ REAL4TimeSeries *pCross; /**< timeseries of detector response to \f$\ times\f$-polarized gravitational radiation */
REAL4TimeSeries *pScalar; /**< timeseries of detector response to scal ar gravitational radiation (NB: not yet implemented.) */ REAL4TimeSeries *pScalar; /**< timeseries of detector response to scal ar gravitational radiation (NB: not yet implemented.) */
} }
LALDetAMResponseSeries; LALDetAMResponseSeries;
/** This structure encapsulates time and sampling information for computing /**
a * This structure encapsulates time and sampling information for computing
a
* ::LALDetAMResponseSeries. Its fields correspond to some fields of the * ::LALDetAMResponseSeries. Its fields correspond to some fields of the
* TimeSeries structures for easy conversion. * TimeSeries structures for easy conversion.
*/ */
typedef struct typedef struct
tagLALTimeIntervalAndNSample tagLALTimeIntervalAndNSample
{ {
LIGOTimeGPS epoch; /**< The start time \f$t_0\f$ of the time se ries */ LIGOTimeGPS epoch; /**< The start time \f$t_0\f$ of the time se ries */
REAL8 deltaT; /**< The sampling interval \f$\Delta t\f$, i n seconds */ REAL8 deltaT; /**< The sampling interval \f$\Delta t\f$, i n seconds */
UINT4 nSample; /**< The total number of samples to be compu ted */ UINT4 nSample; /**< The total number of samples to be compu ted */
} }
skipping to change at line 176 skipping to change at line 182
void void
LALComputeDetAMResponse( LALStatus *status, LALComputeDetAMResponse( LALStatus *status,
LALDetAMResponse *pResponse, LALDetAMResponse *pResponse,
const LALDetAndSource *pDetAndSrc, const LALDetAndSource *pDetAndSrc,
const LIGOTimeGPS *gps); const LIGOTimeGPS *gps);
void XLALComputeDetAMResponse( void XLALComputeDetAMResponse(
double *fplus, double *fplus,
double *fcross, double *fcross,
REAL4 D[3][3], const REAL4 D[3][3],
const double ra, const double ra,
const double dec, const double dec,
const double psi, const double psi,
const double gmst const double gmst
); );
void XLALComputeDetAMResponseExtraModes( void XLALComputeDetAMResponseExtraModes(
double *fplus, double *fplus,
double *fcross, double *fcross,
double *fb, double *fb,
double *fl, double *fl,
double *fx, double *fx,
double *fy, double *fy,
REAL4 D[3][3], const REAL4 D[3][3],
const double ra, const double ra,
const double dec, const double dec,
const double psi, const double psi,
const double gmst const double gmst
); );
/* /*
* Gives a time series of the detector's response to plus and cross * Gives a time series of the detector's response to plus and cross
* polarization * polarization
*/ */
void void
LALComputeDetAMResponseSeries( LALStatus *status, LALComputeDetAMResponseSeries( LALStatus *status,
LALDetAMResponseSeries *pResponseSer ies, LALDetAMResponseSeries *pResponseSer ies,
const LALDetAndSource *pDetAndSourc e, const LALDetAndSource *pDetAndSourc e,
const LALTimeIntervalAndNSample *pTimeInfo); const LALTimeIntervalAndNSample *pTimeInfo);
int XLALComputeDetAMResponseSeries( int XLALComputeDetAMResponseSeries(
REAL4TimeSeries **fplus, REAL4TimeSeries **fplus,
REAL4TimeSeries **fcross, REAL4TimeSeries **fcross,
REAL4 D[3][3], const REAL4 D[3][3],
const double ra, const double ra,
const double dec, const double dec,
const double psi, const double psi,
const LIGOTimeGPS *start, const LIGOTimeGPS *start,
const double deltaT, const double deltaT,
const int n const int n
); );
int XLALComputeDetAMResponseExtraModesSeries( int XLALComputeDetAMResponseExtraModesSeries(
REAL4TimeSeries **fplus, REAL4TimeSeries **fplus,
REAL4TimeSeries **fcross, REAL4TimeSeries **fcross,
REAL4TimeSeries **fb, REAL4TimeSeries **fb,
REAL4TimeSeries **fl, REAL4TimeSeries **fl,
REAL4TimeSeries **fx, REAL4TimeSeries **fx,
REAL4TimeSeries **fy, REAL4TimeSeries **fy,
REAL4 D[3][3], const REAL4 D[3][3],
const double ra, const double ra,
const double dec, const double dec,
const double psi, const double psi,
const LIGOTimeGPS *start, const LIGOTimeGPS *start,
const double deltaT, const double deltaT,
const int n const int n
); );
/*@}*/ /*@}*/
 End of changes. 11 change blocks. 
56 lines changed or deleted 64 lines changed or added


 Dirichlet.h   Dirichlet.h 
skipping to change at line 30 skipping to change at line 30
#ifndef _DIRICHLET_H #ifndef _DIRICHLET_H
#define _DIRICHLET_H #define _DIRICHLET_H
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup Dirichlet_h * \addtogroup Dirichlet_h
\author UTB Relativity Group; contact whelan@phys.utb.edu * \author UTB Relativity Group; contact whelan@phys.utb.edu
*
\brief Provides prototype and error code information for <tt>LALDirichle * \brief Provides prototype and error code information for <tt>LALDirichle
t()</tt>, t()</tt>,
a routine which calculates the values of the Dirichlet kernel * a routine which calculates the values of the Dirichlet kernel
\f${\cal D}_N(x)\f$. * \f${\cal D}_N(x)\f$.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include "Dirichlet.h" * \code
\endcode * #include "Dirichlet.h"
* \endcode
*/ *
*/
/*@{*/ /*@{*/
/**\name Error Codes */ /**\name Error Codes */
/*@{*/ /*@{*/
#define DIRICHLETH_ENULLPIN 1 /**< Null pointer to input p arameters */ #define DIRICHLETH_ENULLPIN 1 /**< Null pointer to input p arameters */
#define DIRICHLETH_ENVALUE 2 /**< Dirichlet parameter N l ess than or equal to zero */ #define DIRICHLETH_ENVALUE 2 /**< Dirichlet parameter N l ess than or equal to zero */
#define DIRICHLETH_ESIZE 3 /**< Length parameter less t han or equal to zero */ #define DIRICHLETH_ESIZE 3 /**< Length parameter less t han or equal to zero */
#define DIRICHLETH_EDELTAX 4 /**< Spacing of x values les s than or equal to zero */ #define DIRICHLETH_EDELTAX 4 /**< Spacing of x values les s than or equal to zero */
#define DIRICHLETH_ENULLPOUT 5 /**< Null pointer to ouput v ector */ #define DIRICHLETH_ENULLPOUT 5 /**< Null pointer to ouput v ector */
#define DIRICHLETH_ESIZEMM 6 /**< Length of data member o f output vector does not equal length specified in input parameters */ #define DIRICHLETH_ESIZEMM 6 /**< Length of data member o f output vector does not equal length specified in input parameters */
 End of changes. 1 change blocks. 
14 lines changed or deleted 15 lines changed or added


 FFTWMutex.h   FFTWMutex.h 
skipping to change at line 29 skipping to change at line 29
#ifndef _FFTWMUTEX_H #ifndef _FFTWMUTEX_H
#define _FFTWMUTEX_H #define _FFTWMUTEX_H
#include <lal/LALConfig.h> #include <lal/LALConfig.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void XLALFFTWWisdomLock(void);
void XLALFFTWWisdomUnlock(void);
#if defined(LAL_PTHREAD_LOCK) && defined(LAL_FFTW3_ENABLED) #if defined(LAL_PTHREAD_LOCK) && defined(LAL_FFTW3_ENABLED)
# include <pthread.h> # define LAL_FFTW_WISDOM_LOCK XLALFFTWWisdomLock()
extern pthread_mutex_t lalFFTWMutex; # define LAL_FFTW_WISDOM_UNLOCK XLALFFTWWisdomUnlock()
# define LAL_FFTW_PTHREAD_MUTEX_LOCK pthread_mutex_lock( &lalFFTWMutex )
# define LAL_FFTW_PTHREAD_MUTEX_UNLOCK pthread_mutex_unlock( &lalFFTWMutex
)
#else #else
# define LAL_FFTW_PTHREAD_MUTEX_LOCK # define LAL_FFTW_WISDOM_LOCK
# define LAL_FFTW_PTHREAD_MUTEX_UNLOCK # define LAL_FFTW_WISDOM_UNLOCK
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _FFTWMUTEX_H */ #endif /* _FFTWMUTEX_H */
 End of changes. 3 change blocks. 
7 lines changed or deleted 7 lines changed or added


 Factorial.h   Factorial.h 
skipping to change at line 30 skipping to change at line 30
#ifndef _FACTORIAL_H #ifndef _FACTORIAL_H
#define _FACTORIAL_H #define _FACTORIAL_H
#include <lal/LALAtomicDatatypes.h> #include <lal/LALAtomicDatatypes.h>
/** /**
* \addtogroup Factorial_h * \addtogroup Factorial_h
* \author Karl Wette * \author Karl Wette
* \brief Static tables of the factorial and double-factorial functions, an d derived quantities. * \brief Static tables of the factorial and double-factorial functions, an d derived quantities.
* *
* \heading{Description} * ### Description ###
* *
* The following tables of the factorial function are provided: * The following tables of the factorial function are provided:
* <ul> * <ul>
* <li>UINT8 LAL_FACT[\f$i\f$] = \f$i!\f$ * <li>UINT8 LAL_FACT[\f$i\f$] = \f$i!\f$
* <li>REAL8 LAL_FACT_INV[\f$i\f$] = \f$1/i!\f$ * <li>REAL8 LAL_FACT_INV[\f$i\f$] = \f$1/i!\f$
* <li>REAL8 LAL_FACT_LOG[\f$i\f$] = \f$\log i!\f$ * <li>REAL8 LAL_FACT_LOG[\f$i\f$] = \f$\log i!\f$
* </ul> * </ul>
* The maximum allowable index \f$i\f$ of these tables is LAL_FACT_MAX. * The maximum allowable index \f$i\f$ of these tables is LAL_FACT_MAX.
* This value is determines by the maximum value of \f$i!\f$ that can be st ored in an UINT8. * This value is determines by the maximum value of \f$i!\f$ that can be st ored in an UINT8.
* *
skipping to change at line 54 skipping to change at line 54
* <li>REAL8 LAL_FACT2_INV[\f$i\f$] = \f$1/i!!\f$ * <li>REAL8 LAL_FACT2_INV[\f$i\f$] = \f$1/i!!\f$
* <li>REAL8 LAL_FACT2_LOG[\f$i\f$] = \f$\log i!!\f$ * <li>REAL8 LAL_FACT2_LOG[\f$i\f$] = \f$\log i!!\f$
* </ul> * </ul>
* The maximum allowable index \f$i\f$ of these tables is LAL_FACT2_MAX. * The maximum allowable index \f$i\f$ of these tables is LAL_FACT2_MAX.
* This value is determines by the maximum value of \f$i!!\f$ that can be s tored in an UINT8. * This value is determines by the maximum value of \f$i!!\f$ that can be s tored in an UINT8.
* *
* All values were computed to 35 significant figures with Mathematica v8.0 .1.0 on 64-bit Linux. * All values were computed to 35 significant figures with Mathematica v8.0 .1.0 on 64-bit Linux.
*/ */
/*@{*/ /*@{*/
#ifndef SWIG // exclude from SWIG wrappings #ifndef SWIG /* exclude from SWIG wrappings */
#define LAL_FACT_MAX 20 #define LAL_FACT_MAX 20
static const UINT8 LAL_FACT[] = { \ static const UINT8 LAL_FACT[] = { \
1, \ 1, \
1, \ 1, \
2, \ 2, \
6, \ 6, \
24, \ 24, \
120, \ 120, \
skipping to change at line 243 skipping to change at line 243
31.5630772004027119079948674075766925, \ 31.5630772004027119079948674075766925, \
32.9944614266036191509564506162729398, \ 32.9944614266036191509564506162729398, \
34.8952817105779158319346843939362254, \ 34.8952817105779158319346843939362254, \
36.3617572565900931781397226486348514, \ 36.3617572565900931781397226486348514, \
38.2964790922400712073479210855431153, \ 38.2964790922400712073479210855431153, \
39.7957444610752394240688869731772086, \ 39.7957444610752394240688869731772086, \
41.7622149950397977544340816928339981, \ 41.7622149950397977544340816928339981, \
43.2922520225417196595260757880648636 \ 43.2922520225417196595260757880648636 \
}; };
#endif // SWIG #endif /* SWIG */
/*@}*/ /*@}*/
#endif /*_FACTORIAL_H*/ #endif /*_FACTORIAL_H*/
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 FileIO.h   FileIO.h 
skipping to change at line 31 skipping to change at line 31
#define _FILEIO_H #define _FILEIO_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
#include <lal/LALStdio.h> #include <lal/LALStdio.h>
/* maximum string size to print with LAL Printf routines */
#define LAL_PRINTF_BUFSIZE 4096
/** /**
\addtogroup FileIO_h * \addtogroup FileIO_h
*
\brief Provides standard LAL support IO functions. * \brief Provides standard LAL support IO functions.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/LALStdio.h> * \code
#include <lal/FileIO.h> * #include <lal/LALStdio.h>
\endcode * #include <lal/FileIO.h>
* \endcode
Only use \ref FileIO.h in test code that links to the \c lalsupport libr *
ary. * Only use \ref FileIO.h in test code that links to the \c lalsupport libr
*/ ary.
*/
/*@{*/ /*@{*/
FILE *LALOpenDataFile( const char* ); FILE *LALOpenDataFile( const char* );
typedef struct tagLALFILE LALFILE; typedef struct tagLALFILE LALFILE;
LALFILE *lalstdin(void); LALFILE *lalstdin(void);
LALFILE *lalstdout(void); LALFILE *lalstdout(void);
LALFILE *lalstderr(void); LALFILE *lalstderr(void);
#define LALSTDIN (lalstdin()) #define LALSTDIN (lalstdin())
 End of changes. 2 change blocks. 
16 lines changed or deleted 14 lines changed or added


 FindRoot.h   FindRoot.h 
skipping to change at line 30 skipping to change at line 30
#ifndef _FINDROOT_H #ifndef _FINDROOT_H
#define _FINDROOT_H #define _FINDROOT_H
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup FindRoot_h * \addtogroup FindRoot_h
*
\brief Root finding routines. * \brief Root finding routines.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/FindRoot.h> * \code
\endcode * #include <lal/FindRoot.h>
* \endcode
This header covers the routines for root finding. *
* This header covers the routines for root finding.
\heading{Description} *
* ### Description ###
The routine <tt>LALSBracketRoot()</tt> expands the specified domain until a *
root * The routine <tt>LALSBracketRoot()</tt> expands the specified domain unti
is contained. The routine <tt>LALDBracketRoot()</tt> is the same but for a l a root
double-precision function. * is contained. The routine <tt>LALDBracketRoot()</tt> is the same but fo
r a
The routine <tt>LALSBisectionFindRoot()</tt> bisects the domain (which must * double-precision function.
contain one *
root) until the root is found with the desired accuracy. The routine * The routine <tt>LALSBisectionFindRoot()</tt> bisects the domain (which m
<tt>LALDBisectionFindRoot()</tt> is the same but for a double-precision fun ust contain one
ction. * root) until the root is found with the desired accuracy. The routine
* <tt>LALDBisectionFindRoot()</tt> is the same but for a double-precision
\heading{Operating Instructions} function.
*
Suppose we want to find the root of the function \f$y = F(x;y_0) = y_0 + x^ * ### Operating Instructions ###
2\f$. *
Define the function: * Suppose we want to find the root of the function \f$y = F(x;y_0) = y_0 +
\code x^2\f$.
static void F( LALStatus *status, REAL4 *y, REAL4 x, void *y0 ) * Define the function:
{ * \code
INITSTATUS(status); * static void F( LALStatus *status, REAL4 *y, REAL4 x, void *y0 )
ASSERT( y0, status, 1, "Null pointer" ); * {
*y = *(REAL4 *)y0 + x*x; * INITSTATUS(status);
RETURN( status ); * ASSERT( y0, status, 1, "Null pointer" );
} * y = *(REAL4 *)y0 + x*x;
\endcode * RETURN( status );
* }
Then use the following code to bracket and find the root \f$x_0=1\f$ where * \endcode
\f$F(x_0;y_0=-1)=0\f$: *
\code * Then use the following code to bracket and find the root \f$x_0=1\f$ whe
static LALStatus status; re
SFindRootIn input; * \f$F(x_0;y_0=-1)=0\f$:
REAL4 y0; * \code
REAL4 x0; * static LALStatus status;
* SFindRootIn input;
y0 = -1; * REAL4 y0;
input.function = F; * REAL4 x0;
input.xmin = 0.1; *
input.xmax = 0.2; * y0 = -1;
input.xacc = 1e-5; * input.function = F;
* input.xmin = 0.1;
/\* expand domain until a root is bracketed *\/ * input.xmax = 0.2;
LALSBracketRoot( &status, &input, &y0 ); * input.xacc = 1e-5;
*
/\* bisect domain until root is found *\/ * /\* expand domain until a root is bracketed *\/
LALSBisectionFindRoot( &status, &x0, &input, &y0 ); * LALSBracketRoot( &status, &input, &y0 );
\endcode *
* /\* bisect domain until root is found *\/
\heading{Algorithm} * LALSBisectionFindRoot( &status, &x0, &input, &y0 );
* \endcode
This is an implementation of the root bracketing and bisection finding *
routines \c zbrac and \c rtbis in Numerical Recipes [\ref ptvf1992]. * ### Algorithm ###
*
*/ * This is an implementation of the root bracketing and bisection finding
* routines \c zbrac and \c rtbis in Numerical Recipes \cite ptvf1992.
*
*/
/*@{*/ /*@{*/
/** \name Error Codes */ /** \name Error Codes */
/*@{*/ /*@{*/
#define FINDROOTH_ENULL 1 /**< Null pointer */ #define FINDROOTH_ENULL 1 /**< Null pointer */
#define FINDROOTH_EIDOM 2 /**< Invalid initial domain */ #define FINDROOTH_EIDOM 2 /**< Invalid initial domain */
#define FINDROOTH_EMXIT 4 /**< Maximum iterations exceeded */ #define FINDROOTH_EMXIT 4 /**< Maximum iterations exceeded */
#define FINDROOTH_EBRKT 8 /**< Root not bracketed */ #define FINDROOTH_EBRKT 8 /**< Root not bracketed */
/*@}*/ /*@}*/
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
#define FINDROOTH_MSGENULL "Null pointer" #define FINDROOTH_MSGENULL "Null pointer"
#define FINDROOTH_MSGEIDOM "Invalid initial domain" #define FINDROOTH_MSGEIDOM "Invalid initial domain"
#define FINDROOTH_MSGEMXIT "Maximum iterations exceeded" #define FINDROOTH_MSGEMXIT "Maximum iterations exceeded"
#define FINDROOTH_MSGEBRKT "Root not bracketed" #define FINDROOTH_MSGEBRKT "Root not bracketed"
/** \endcond */ /** \endcond */
/** These are function pointers to functions that map REAL4 numbers to REAL /**
4 numbers. * These are function pointers to functions that map REAL4 numbers to REAL4
numbers.
*/ */
typedef struct typedef struct
tagSFindRootIn tagSFindRootIn
{ {
void (*function)(LALStatus *s, REAL4 *y, REAL4 x, void *p); /**< The fun ction to find the root of */ void (*function)(LALStatus *s, REAL4 *y, REAL4 x, void *p); /**< The fun ction to find the root of */
REAL4 xmax; /**< The maximum value of the domain interval to look for th e root */ REAL4 xmax; /**< The maximum value of the domain interval to look for th e root */
REAL4 xmin; /**< The minimum value of the domain interval to look for th e root */ REAL4 xmin; /**< The minimum value of the domain interval to look for th e root */
REAL4 xacc; /**< The accuracy desired for the root */ REAL4 xacc; /**< The accuracy desired for the root */
} }
SFindRootIn; SFindRootIn;
/** These are function pointers to functions that map REAL8 numbers to REAL /**
8 numbers. * These are function pointers to functions that map REAL8 numbers to REAL8
numbers.
*/ */
typedef struct typedef struct
tagDFindRootIn tagDFindRootIn
{ {
void (*function)(LALStatus *s, REAL8 *y, REAL8 x, void *p); /**< The fun ction to find the root of */ void (*function)(LALStatus *s, REAL8 *y, REAL8 x, void *p); /**< The fun ction to find the root of */
REAL8 xmax; /**< The maximum value of the domain interval to look for th e root */ REAL8 xmax; /**< The maximum value of the domain interval to look for th e root */
REAL8 xmin; /**< The minimum value of the domain interval to look for th e root */ REAL8 xmin; /**< The minimum value of the domain interval to look for th e root */
REAL8 xacc; /**< The accuracy desired for the root */ REAL8 xacc; /**< The accuracy desired for the root */
} }
DFindRootIn; DFindRootIn;
 End of changes. 3 change blocks. 
70 lines changed or deleted 75 lines changed or added


 FlatLatticeTiling.h   FlatLatticeTiling.h 
// /*
// Copyright (C) 2007, 2008, 2012 Karl Wette * Copyright (C) 2007, 2008, 2012 Karl Wette
// *
// This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version. * (at your option) any later version.
// *
// This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. * GNU General Public License for more details.
// *
// You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
// along with with program; see the file COPYING. If not, write to the * along with with program; see the file COPYING. If not, write to the
// Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
// MA 02111-1307 USA * MA 02111-1307 USA
// */
#ifndef _FLATLATTICETILING_H #ifndef _FLATLATTICETILING_H
#define _FLATLATTICETILING_H #define _FLATLATTICETILING_H
#include <stdbool.h> #include <stdbool.h>
#include <gsl/gsl_vector.h> #include <gsl/gsl_vector.h>
#include <gsl/gsl_matrix.h> #include <gsl/gsl_matrix.h>
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#include <lal/Random.h> #include <lal/Random.h>
#include <lal/GSLSupport.h> #include <lal/GSLSupport.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/// /**
/// \addtogroup FlatLatticeTiling_h * \addtogroup FlatLatticeTiling_h
/// \author Karl Wette * \author Karl Wette
/// \brief Lattice-based template generation for flat metric parameter spac * \brief Lattice-based template generation for flat metric parameter spac
es es
/// *
/// @{ * @{
*/
///
/// Flat lattice tiling bound function /** Flat lattice tiling bound function */
///
typedef void (*FlatLatticeBound)( typedef void (*FlatLatticeBound)(
const size_t dimension, ///< [in] Dimension on which bound applies const size_t dimension, /**< [in] Dimension on which bound applies *
const gsl_vector_uint* bound, ///< [in] Indices of current bounds /
const gsl_vector* point, ///< [in] Point on which to find bounds const gsl_vector_uint* bound, /**< [in] Indices of current bounds
const void* data, ///< [in] Arbitrary data describing paramete */
r space const gsl_vector* point, /**< [in] Point on which to find bounds */
const gsl_vector* incr, ///< [in] Increments of the lattice tiling g const void* data, /**< [in] Arbitrary data describing paramete
enerator r space */
const gsl_vector* bbox, ///< [in] Metric ellipse bounding box extent const gsl_vector* incr, /**< [in] Increments of the lattice tiling g
s enerator */
gsl_vector* lower, ///< [out] Lower bounds on point in dimensio const gsl_vector* bbox, /**< [in] Metric ellipse bounding box extent
n s */
gsl_vector* upper, ///< [out] Upper bounds on point in dimensio gsl_vector* lower, /**< [out] Lower bounds on point in dimensio
n n */
double* lower_pad, ///< [out] Padding of lower parameter space gsl_vector* upper, /**< [out] Upper bounds on point in dimensio
bounds n */
double* upper_pad ///< [out] Padding of upper parameter space double* lower_pad, /**< [out] Padding of lower parameter space
bounds bounds */
double* upper_pad /**< [out] Padding of upper parameter space
bounds */
); );
/// /** Flat tiling lattice generator function */
/// Flat tiling lattice generator function
///
typedef int (*FlatLatticeGenerator)( typedef int (*FlatLatticeGenerator)(
const size_t dimensions, ///< [in] Number of dimensions const size_t dimensions, /**< [in] Number of dimensions */
gsl_matrix** generator, ///< [out] Generator matrix gsl_matrix** generator, /**< [out] Generator matrix */
double* norm_thickness ///< [out] Normalised thickness double* norm_thickness /**< [out] Normalised thickness */
); );
/// /** Flat lattice tiling state structure */
/// Flat lattice tiling state structure
///
typedef struct tagFlatLatticeTiling FlatLatticeTiling; typedef struct tagFlatLatticeTiling FlatLatticeTiling;
/// /** Create a new flat lattice tiling state structure */
/// Create a new flat lattice tiling state structure
///
FlatLatticeTiling* XLALCreateFlatLatticeTiling( FlatLatticeTiling* XLALCreateFlatLatticeTiling(
const size_t dimensions ///< [in] Number of parameter space dimensio ns const size_t dimensions /**< [in] Number of parameter space dimensio ns */
); );
/// /** Destroy a flat lattice tiling state structure */
/// Destroy a flat lattice tiling state structure
///
void XLALDestroyFlatLatticeTiling( void XLALDestroyFlatLatticeTiling(
FlatLatticeTiling* tiling ///< [in] Tiling state FlatLatticeTiling* tiling /**< [in] Tiling state */
); );
/// /** Return the number of dimensions being tiled */
/// Return the number of dimensions being tiled
///
size_t XLALGetFlatLatticeDimensions( size_t XLALGetFlatLatticeDimensions(
FlatLatticeTiling* tiling ///< [in] Tiling state FlatLatticeTiling* tiling /**< [in] Tiling state */
); );
#ifdef SWIG // SWIG interface directives #ifdef SWIG /* SWIG interface directives */
SWIGLAL(GET_OBJECT(XLALGetFlatLatticePoint)); SWIGLAL(RETURNS_PROPERTY(XLALGetFlatLatticePoint));
#endif #endif
/// /** Return the current lattice tiling parameter space point */
/// Return the current lattice tiling parameter space point
///
const gsl_vector* XLALGetFlatLatticePoint( const gsl_vector* XLALGetFlatLatticePoint(
FlatLatticeTiling* tiling ///< [in] Tiling state FlatLatticeTiling* tiling /**< [in] Tiling state */
); );
/// /** Return the current number of flat lattice tiling parameter space points
/// Return the current number of flat lattice tiling parameter space points */
///
unsigned long XLALGetFlatLatticePointCount( unsigned long XLALGetFlatLatticePointCount(
FlatLatticeTiling* tiling ///< [in] Tiling state FlatLatticeTiling* tiling /**< [in] Tiling state */
); );
/// /** Return the increment vectors which are used to generate the lattice. */
/// Return the increment vectors which are used to generate the lattice.
///
gsl_matrix* XLALGetFlatLatticeIncrements( gsl_matrix* XLALGetFlatLatticeIncrements(
FlatLatticeTiling* tiling ///< [in] Tiling state FlatLatticeTiling* tiling /**< [in] Tiling state */
); );
/// /** Set a parameter space bound on the flat lattice tiling */
/// Set a parameter space bound on the flat lattice tiling
///
int XLALSetFlatLatticeBound( int XLALSetFlatLatticeBound(
FlatLatticeTiling* tiling, ///< [in] Tiling state FlatLatticeTiling* tiling, /**< [in] Tiling state */
const size_t dimension, ///< [in] Dimension on which bound a const size_t dimension, /**< [in] Dimension on which bound a
pplies pplies */
const bool singular, ///< [in] Is bound composed of singl const bool singular, /**< [in] Is bound composed of singl
e points? e points? */
const FlatLatticeBound func, ///< [in] Parameter space bound func const FlatLatticeBound func, /**< [in] Parameter space bound func
tion tion */
void* data ///< [in] Arbitrary data describing void* data /**< [in] Arbitrary data describing
parameter space parameter space */
); );
/// /** Set the flat tiling lattice generator */
/// Set the flat tiling lattice generator
///
int XLALSetFlatLatticeGenerator( int XLALSetFlatLatticeGenerator(
FlatLatticeTiling* tiling, ///< [in] Tiling state FlatLatticeTiling* tiling, /**< [in] Tiling state */
const FlatLatticeGenerator generator ///< [in] Lattice generator function const FlatLatticeGenerator generator /**< [in] Lattice generator function
*/
); );
/// /** Set the flat lattice tiling metric and maximum mismatch */
/// Set the flat lattice tiling metric and maximum mismatch
///
int XLALSetFlatLatticeMetric( int XLALSetFlatLatticeMetric(
FlatLatticeTiling* tiling, ///< [in] Tiling state FlatLatticeTiling* tiling, /**< [in] Tiling state */
const gsl_matrix* metric, ///< [in] Parameter space metric const gsl_matrix* metric, /**< [in] Parameter space metric */
const double max_mismatch ///< [in] Maximum prescribed mismatc const double max_mismatch /**< [in] Maximum prescribed mismatc
h h */
); );
/// /** Move to the next point in the flat lattice tiling parameter space. */
/// Move to the next point in the flat lattice tiling parameter space. /** Returns the index of the lowest dimension where the point has changed,
/// Returns the index of the lowest dimension where the point has changed, */
/// or a negative number when the template bank is exhausted. /** or a negative number when the template bank is exhausted. */
///
int XLALNextFlatLatticePoint( int XLALNextFlatLatticePoint(
FlatLatticeTiling* tiling ///< [in] Tiling state FlatLatticeTiling* tiling /**< [in] Tiling state */
); );
/// /** Return to the beginning of a flat lattice tiling */
/// Return to the beginning of a flat lattice tiling
///
int XLALRestartFlatLatticeTiling( int XLALRestartFlatLatticeTiling(
FlatLatticeTiling* tiling ///< [in] Tiling state FlatLatticeTiling* tiling /**< [in] Tiling state */
); );
/// /** Calculate the total number of flat lattice tiling parameter space point
/// Calculate the total number of flat lattice tiling parameter space point s */
s
///
unsigned long XLALCountTotalFlatLatticePoints( unsigned long XLALCountTotalFlatLatticePoints(
FlatLatticeTiling* tiling ///< [in] Tiling state FlatLatticeTiling* tiling /**< [in] Tiling state */
); );
#ifdef SWIG // SWIG interface directives #ifdef SWIG /* SWIG interface directives */
SWIGLAL(INOUT_STRUCTS(gsl_matrix**, random_points, workspace)); SWIGLAL(INOUT_STRUCTS(gsl_matrix**, random_points, workspace));
SWIGLAL(INOUT_STRUCTS(gsl_vector**, nearest_distances)); SWIGLAL(INOUT_STRUCTS(gsl_vector**, nearest_distances));
SWIGLAL(INOUT_STRUCTS(gsl_vector_ulong**, nearest_indices)); SWIGLAL(INOUT_STRUCTS(gsl_vector_ulong**, nearest_indices));
#endif #endif
/// /** Generate random points within the flat lattice tiling parameter space,
/// Generate random points within the flat lattice tiling parameter space, */
/// then calculate the nearest flat lattice point to each random point /** then calculate the nearest flat lattice point to each random point */
///
int XLALNearestFlatLatticePointToRandomPoints( int XLALNearestFlatLatticePointToRandomPoints(
FlatLatticeTiling* tiling, ///< [in] Tiling state FlatLatticeTiling* tiling, /**< [in] Tiling state */
RandomParams* rng, ///< [in] Random number generator RandomParams* rng, /**< [in] Random number generator */
const size_t num_random_points, ///< [in] Number of random points to const size_t num_random_points, /**< [in] Number of random points to
generate generate */
gsl_matrix** random_points, ///< [in/out] Pointer to matrix of r gsl_matrix** random_points, /**< [in/out] Pointer to matrix of r
andom points andom points */
gsl_vector_ulong** nearest_indices, ///< [in/out] Pointer to vector of i gsl_vector_ulong** nearest_indices, /**< [in/out] Pointer to vector of i
ndices of nearest lattice point ndices of nearest lattice point */
gsl_vector** nearest_distances, ///< [in/out] Pointer to vector of d gsl_vector** nearest_distances, /**< [in/out] Pointer to vector of d
istances to nearest lattice point istances to nearest lattice point */
gsl_matrix** workspace ///< [in/out] Pointer to workspace m gsl_matrix** workspace /**< [in/out] Pointer to workspace m
atrix for computing distances atrix for computing distances */
); );
/// /** Find the bounding box of the mismatch ellipses of a metric */
/// Find the bounding box of the mismatch ellipses of a metric
///
gsl_vector* XLALMetricEllipseBoundingBox( gsl_vector* XLALMetricEllipseBoundingBox(
const gsl_matrix* metric, ///< [in] Metric to bound const gsl_matrix* metric, /**< [in] Metric to bound */
const double max_mismatch ///< [in] Maximum mismatch with respect to m const double max_mismatch /**< [in] Maximum mismatch with respect to m
etric etric */
); );
/// /** Find the lattice increment vectors for a given metric and mismatch */
/// Find the lattice increment vectors for a given metric and mismatch
///
gsl_matrix* XLALMetricLatticeIncrements( gsl_matrix* XLALMetricLatticeIncrements(
const FlatLatticeGenerator generator, ///< [in] Lattice generator const FlatLatticeGenerator generator, /**< [in] Lattice generator
function function */
const gsl_matrix* metric, ///< [in] Parameter space metric const gsl_matrix* metric, /**< [in] Parameter space metric */
const double max_mismatch ///< [in] Maximum prescribed mismatc const double max_mismatch /**< [in] Maximum prescribed mismatc
h h */
); );
#ifdef SWIG // SWIG interface directives #ifdef SWIG /* SWIG interface directives */
SWIGLAL(FUNCTION_POINTER(XLALCubicLatticeGenerator)); SWIGLAL(FUNCTION_POINTER(XLALCubicLatticeGenerator));
#endif #endif
/// /** Calculate the generator matrix for a cubic (\f$Z_n\f$) lattice */
/// Calculate the generator matrix for a cubic (\f$Z_n\f$) lattice
///
int XLALCubicLatticeGenerator( int XLALCubicLatticeGenerator(
const size_t dimensions, ///< [in] Number of dimensions const size_t dimensions, /**< [in] Number of dimensions */
gsl_matrix** generator, ///< [out] Generator matrix gsl_matrix** generator, /**< [out] Generator matrix */
double* norm_thickness ///< [out] Normalised thickness double* norm_thickness /**< [out] Normalised thickness */
); );
#ifdef SWIG // SWIG interface directives #ifdef SWIG /* SWIG interface directives */
SWIGLAL(FUNCTION_POINTER(XLALAnstarLatticeGenerator)); SWIGLAL(FUNCTION_POINTER(XLALAnstarLatticeGenerator));
#endif #endif
/// /** Calculate the generator matrix for a \f$A_n^*\f$ lattice */
/// Calculate the generator matrix for a \f$A_n^*\f$ lattice
///
int XLALAnstarLatticeGenerator( int XLALAnstarLatticeGenerator(
const size_t dimensions, ///< [in] Number of dimensions const size_t dimensions, /**< [in] Number of dimensions */
gsl_matrix** generator, ///< [out] Generator matrix gsl_matrix** generator, /**< [out] Generator matrix */
double* norm_thickness ///< [out] Normalised thickness double* norm_thickness /**< [out] Normalised thickness */
); );
/// /** Set a constant parameter space bound, given by the minimum and */
/// Set a constant parameter space bound, given by the minimum and /** maximum of the two supplied bounds, on the flat lattice tiling */
/// maximum of the two supplied bounds, on the flat lattice tiling
///
int XLALSetFlatLatticeConstantBound( int XLALSetFlatLatticeConstantBound(
FlatLatticeTiling* tiling, ///< [in] Tiling state FlatLatticeTiling* tiling, /**< [in] Tiling state */
const size_t dimension, ///< [in] Dimension on which bound applies const size_t dimension, /**< [in] Dimension on which bound applies *
const double bound1, ///< [in] First bound on dimension /
const double bound2 ///< [in] Second bound on dimension const double bound1, /**< [in] First bound on dimension */
const double bound2 /**< [in] Second bound on dimension */
); );
/// /** Set elliptical bounds in two dimensions on the flat lattice tiling */
/// Set elliptical bounds in two dimensions on the flat lattice tiling
///
int XLALSetFlatLatticeEllipticalBounds( int XLALSetFlatLatticeEllipticalBounds(
FlatLatticeTiling* tiling, ///< [in] Tiling state FlatLatticeTiling* tiling, /**< [in] Tiling state */
const size_t dimension, ///< [in] Dimension of X bound (Y bound is o const size_t dimension, /**< [in] Dimension of X bound (Y bound is o
ne higher) ne higher) */
const double x_centre, ///< [in] X centre of ellipse const double x_centre, /**< [in] X centre of ellipse */
const double y_centre, ///< [in] Y centre of ellipse const double y_centre, /**< [in] Y centre of ellipse */
const double x_semi, ///< [in] Length of X semi-diameter const double x_semi, /**< [in] Length of X semi-diameter */
const double y_semi ///< [in] Length of Y semi-diameter const double y_semi /**< [in] Length of Y semi-diameter */
); );
/// @} /** @} */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 49 change blocks. 
184 lines changed or deleted 148 lines changed or added


 FrequencySeries.h   FrequencySeries.h 
skipping to change at line 33 skipping to change at line 33
#include <stddef.h> #include <stddef.h>
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
\addtogroup FrequencySeriesManipulation * \addtogroup FrequencySeriesManipulation
\author Kipp Cannon <kipp@gravity.phys.uwm.edu> * \author Kipp Cannon <kipp@gravity.phys.uwm.edu>
*
\brief This is a suite of functions for creating, destroying, and manipulat * \brief This is a suite of functions for creating, destroying, and manipu
ing LAL lating LAL
frequency series. One pair of functions (the XLAL version and its LAL * frequency series. One pair of functions (the XLAL version and its LAL
counterpart) is available for each method and frequency series type. For * counterpart) is available for each method and frequency series type. Fo
example XLALCreateREAL4FrequencySeries() is available for creating r
frequency series of \c REAL4 data, and the LAL-stype wrapper * example XLALCreateREAL4FrequencySeries() is available for creating
LALCreateREAL4FrequencySeries() is provided which is equivalent to * frequency series of \c REAL4 data, and the LAL-stype wrapper
the XLAL version in all respects except that it adheres to the LAL calling * LALCreateREAL4FrequencySeries() is provided which is equivalent to
conventions (eg.\ it takes a \c LALStatus pointer as its first * the XLAL version in all respects except that it adheres to the LAL calli
argument, its return type is \c void, etc.). ng
* conventions (eg.\ it takes a \c LALStatus pointer as its first
*/ * argument, its return type is \c void, etc.).
*
*/
/*@{*/ /*@{*/
/** \name Creation Functions /**
* \name Creation Functions
\heading{Synopsis} *
* ### Synopsis ###
\code *
#include <lal/FrequencySeries.h> * \code
* #include <lal/FrequencySeries.h>
XLALCreate<frequencyseriestype>() *
LALCreate<frequencyseriestype>() * XLALCreate<frequencyseriestype>()
\endcode * LALCreate<frequencyseriestype>()
* \endcode
\heading{Description} *
* ### Description ###
These functions create LAL frequency series. An XLAL function returns a *
pointer to the newly created series or \c NULL on failure. The LAL * These functions create LAL frequency series. An XLAL function returns a
counterpart accepts the address of a pointer which it fills with the * pointer to the newly created series or \c NULL on failure. The LAL
address of the newly created series or \c NULL on failure. * counterpart accepts the address of a pointer which it fills with the
Additionally, the LAL wrapper provides standard LAL-style error checking * address of the newly created series or \c NULL on failure.
via a \c LALStatus pointer. * Additionally, the LAL wrapper provides standard LAL-style error checking
* via a \c LALStatus pointer.
*/ *
*/
/*@{*/ /*@{*/
COMPLEX8FrequencySeries *XLALCreateCOMPLEX8FrequencySeries ( const CHAR *na me, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sample Units, size_t length ); COMPLEX8FrequencySeries *XLALCreateCOMPLEX8FrequencySeries ( const CHAR *na me, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sample Units, size_t length );
COMPLEX16FrequencySeries *XLALCreateCOMPLEX16FrequencySeries ( const CHAR * name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *samp leUnits, size_t length ); COMPLEX16FrequencySeries *XLALCreateCOMPLEX16FrequencySeries ( const CHAR * name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *samp leUnits, size_t length );
REAL4FrequencySeries *XLALCreateREAL4FrequencySeries ( const CHAR *name, co nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length ); REAL4FrequencySeries *XLALCreateREAL4FrequencySeries ( const CHAR *name, co nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length );
REAL8FrequencySeries *XLALCreateREAL8FrequencySeries ( const CHAR *name, co nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length ); REAL8FrequencySeries *XLALCreateREAL8FrequencySeries ( const CHAR *name, co nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length );
INT2FrequencySeries *XLALCreateINT2FrequencySeries ( const CHAR *name, cons t LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, s ize_t length ); INT2FrequencySeries *XLALCreateINT2FrequencySeries ( const CHAR *name, cons t LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, s ize_t length );
INT4FrequencySeries *XLALCreateINT4FrequencySeries ( const CHAR *name, cons t LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, s ize_t length ); INT4FrequencySeries *XLALCreateINT4FrequencySeries ( const CHAR *name, cons t LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, s ize_t length );
INT8FrequencySeries *XLALCreateINT8FrequencySeries ( const CHAR *name, cons t LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, s ize_t length ); INT8FrequencySeries *XLALCreateINT8FrequencySeries ( const CHAR *name, cons t LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, s ize_t length );
UINT2FrequencySeries *XLALCreateUINT2FrequencySeries ( const CHAR *name, co nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length ); UINT2FrequencySeries *XLALCreateUINT2FrequencySeries ( const CHAR *name, co nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length );
UINT4FrequencySeries *XLALCreateUINT4FrequencySeries ( const CHAR *name, co nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length ); UINT4FrequencySeries *XLALCreateUINT4FrequencySeries ( const CHAR *name, co nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length );
UINT8FrequencySeries *XLALCreateUINT8FrequencySeries ( const CHAR *name, co nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length ); UINT8FrequencySeries *XLALCreateUINT8FrequencySeries ( const CHAR *name, co nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length );
/*@}*/ /*@}*/
/** \name Destruction Functions /**
* \name Destruction Functions
\heading{Synopsis} *
* ### Synopsis ###
\code *
#include <lal/FrequencySeries.h> * \code
* #include <lal/FrequencySeries.h>
XLALDestroy<frequencyseriestype>() *
LALDestroy<frequencyseriestype>() * XLALDestroy<frequencyseriestype>()
\endcode * LALDestroy<frequencyseriestype>()
* \endcode
\heading{Description} *
* ### Description ###
These functions free all memory associated with a LAL frequency series. It *
is safe to pass \c NULL to these functions. * These functions free all memory associated with a LAL frequency series.
It
*/ * is safe to pass \c NULL to these functions.
*
*/
/*@{*/ /*@{*/
void XLALDestroyCOMPLEX8FrequencySeries ( COMPLEX8FrequencySeries *series ) ; void XLALDestroyCOMPLEX8FrequencySeries ( COMPLEX8FrequencySeries *series ) ;
void XLALDestroyCOMPLEX16FrequencySeries ( COMPLEX16FrequencySeries *series ); void XLALDestroyCOMPLEX16FrequencySeries ( COMPLEX16FrequencySeries *series );
void XLALDestroyREAL4FrequencySeries ( REAL4FrequencySeries *series ); void XLALDestroyREAL4FrequencySeries ( REAL4FrequencySeries *series );
void XLALDestroyREAL8FrequencySeries ( REAL8FrequencySeries *series ); void XLALDestroyREAL8FrequencySeries ( REAL8FrequencySeries *series );
void XLALDestroyINT2FrequencySeries ( INT2FrequencySeries *series ); void XLALDestroyINT2FrequencySeries ( INT2FrequencySeries *series );
void XLALDestroyINT4FrequencySeries ( INT4FrequencySeries *series ); void XLALDestroyINT4FrequencySeries ( INT4FrequencySeries *series );
void XLALDestroyINT8FrequencySeries ( INT8FrequencySeries *series ); void XLALDestroyINT8FrequencySeries ( INT8FrequencySeries *series );
void XLALDestroyUINT2FrequencySeries ( UINT2FrequencySeries *series ); void XLALDestroyUINT2FrequencySeries ( UINT2FrequencySeries *series );
void XLALDestroyUINT4FrequencySeries ( UINT4FrequencySeries *series ); void XLALDestroyUINT4FrequencySeries ( UINT4FrequencySeries *series );
void XLALDestroyUINT8FrequencySeries ( UINT8FrequencySeries *series ); void XLALDestroyUINT8FrequencySeries ( UINT8FrequencySeries *series );
/*@}*/ /*@}*/
/** \name Cutting Functions /**
* \name Cutting Functions
\heading{Synopsis} *
* ### Synopsis ###
\code *
#include <lal/FrequencySeries.h> * \code
* #include <lal/FrequencySeries.h>
XLALCut<frequencyseriestype>() *
\endcode * XLALCut<frequencyseriestype>()
* \endcode
\heading{Description} *
* ### Description ###
These functions create a new frequency series by extracting a section of an *
existing frequency series. * These functions create a new frequency series by extracting a section of
an
*/ * existing frequency series.
*
*/
/*@{*/ /*@{*/
COMPLEX8FrequencySeries *XLALCutCOMPLEX8FrequencySeries ( const COMPLEX8Fre quencySeries *series, size_t first, size_t length ); COMPLEX8FrequencySeries *XLALCutCOMPLEX8FrequencySeries ( const COMPLEX8Fre quencySeries *series, size_t first, size_t length );
COMPLEX16FrequencySeries *XLALCutCOMPLEX16FrequencySeries ( const COMPLEX16 FrequencySeries *series, size_t first, size_t length ); COMPLEX16FrequencySeries *XLALCutCOMPLEX16FrequencySeries ( const COMPLEX16 FrequencySeries *series, size_t first, size_t length );
REAL4FrequencySeries *XLALCutREAL4FrequencySeries ( const REAL4FrequencySer ies *series, size_t first, size_t length ); REAL4FrequencySeries *XLALCutREAL4FrequencySeries ( const REAL4FrequencySer ies *series, size_t first, size_t length );
REAL8FrequencySeries *XLALCutREAL8FrequencySeries ( const REAL8FrequencySer ies *series, size_t first, size_t length ); REAL8FrequencySeries *XLALCutREAL8FrequencySeries ( const REAL8FrequencySer ies *series, size_t first, size_t length );
INT2FrequencySeries *XLALCutINT2FrequencySeries ( const INT2FrequencySeries *series, size_t first, size_t length ); INT2FrequencySeries *XLALCutINT2FrequencySeries ( const INT2FrequencySeries *series, size_t first, size_t length );
INT4FrequencySeries *XLALCutINT4FrequencySeries ( const INT4FrequencySeries *series, size_t first, size_t length ); INT4FrequencySeries *XLALCutINT4FrequencySeries ( const INT4FrequencySeries *series, size_t first, size_t length );
INT8FrequencySeries *XLALCutINT8FrequencySeries ( const INT8FrequencySeries *series, size_t first, size_t length ); INT8FrequencySeries *XLALCutINT8FrequencySeries ( const INT8FrequencySeries *series, size_t first, size_t length );
UINT2FrequencySeries *XLALCutUINT2FrequencySeries ( const UINT2FrequencySer ies *series, size_t first, size_t length ); UINT2FrequencySeries *XLALCutUINT2FrequencySeries ( const UINT2FrequencySer ies *series, size_t first, size_t length );
UINT4FrequencySeries *XLALCutUINT4FrequencySeries ( const UINT4FrequencySer ies *series, size_t first, size_t length ); UINT4FrequencySeries *XLALCutUINT4FrequencySeries ( const UINT4FrequencySer ies *series, size_t first, size_t length );
UINT8FrequencySeries *XLALCutUINT8FrequencySeries ( const UINT8FrequencySer ies *series, size_t first, size_t length ); UINT8FrequencySeries *XLALCutUINT8FrequencySeries ( const UINT8FrequencySer ies *series, size_t first, size_t length );
/*@}*/ /*@}*/
/** \name Resizing Functions /**
* \name Resizing Functions
\heading{Synopsis} *
* ### Synopsis ###
\code *
#include <lal/FrequencySeries.h> * \code
* #include <lal/FrequencySeries.h>
XLALResize<frequencyseriestype>() *
XLALShrink<frequencyseriestype>() * XLALResize<frequencyseriestype>()
LALShrink<frequencyseriestype>() * XLALShrink<frequencyseriestype>()
\endcode * LALShrink<frequencyseriestype>()
* \endcode
\heading{Description} *
* ### Description ###
These functions resize an existing frequency series. The new frequency *
series will have the given length, and its contents will consist of that * These functions resize an existing frequency series. The new frequency
part of the original time series that started at sample \c first. If * series will have the given length, and its contents will consist of that
\c first is negative, then the new time series is padded at the start * part of the original time series that started at sample \c first. If
by that many samples. The frequency series' heterodyne frequency, * \c first is negative, then the new time series is padded at the start
(f_{0}), is adjusted appropriately. * by that many samples. The frequency series' heterodyne frequency,
* (f_{0}), is adjusted appropriately.
The "Shrink" functions accept non-negative values for the parameter *
\c first, and are retained only for historical purposes. New code * The "Shrink" functions accept non-negative values for the parameter
should use the "Resize" variants. * \c first, and are retained only for historical purposes. New code
* should use the "Resize" variants.
*/ *
*/
/*@{*/ /*@{*/
COMPLEX8FrequencySeries *XLALResizeCOMPLEX8FrequencySeries ( COMPLEX8Freque ncySeries *series, int first, size_t length ); COMPLEX8FrequencySeries *XLALResizeCOMPLEX8FrequencySeries ( COMPLEX8Freque ncySeries *series, int first, size_t length );
COMPLEX16FrequencySeries *XLALResizeCOMPLEX16FrequencySeries ( COMPLEX16Fre quencySeries *series, int first, size_t length ); COMPLEX16FrequencySeries *XLALResizeCOMPLEX16FrequencySeries ( COMPLEX16Fre quencySeries *series, int first, size_t length );
REAL4FrequencySeries *XLALResizeREAL4FrequencySeries ( REAL4FrequencySeries *series, int first, size_t length ); REAL4FrequencySeries *XLALResizeREAL4FrequencySeries ( REAL4FrequencySeries *series, int first, size_t length );
REAL8FrequencySeries *XLALResizeREAL8FrequencySeries ( REAL8FrequencySeries *series, int first, size_t length ); REAL8FrequencySeries *XLALResizeREAL8FrequencySeries ( REAL8FrequencySeries *series, int first, size_t length );
INT2FrequencySeries *XLALResizeINT2FrequencySeries ( INT2FrequencySeries *s eries, int first, size_t length ); INT2FrequencySeries *XLALResizeINT2FrequencySeries ( INT2FrequencySeries *s eries, int first, size_t length );
INT4FrequencySeries *XLALResizeINT4FrequencySeries ( INT4FrequencySeries *s eries, int first, size_t length ); INT4FrequencySeries *XLALResizeINT4FrequencySeries ( INT4FrequencySeries *s eries, int first, size_t length );
INT8FrequencySeries *XLALResizeINT8FrequencySeries ( INT8FrequencySeries *s eries, int first, size_t length ); INT8FrequencySeries *XLALResizeINT8FrequencySeries ( INT8FrequencySeries *s eries, int first, size_t length );
UINT2FrequencySeries *XLALResizeUINT2FrequencySeries ( UINT2FrequencySeries *series, int first, size_t length ); UINT2FrequencySeries *XLALResizeUINT2FrequencySeries ( UINT2FrequencySeries *series, int first, size_t length );
UINT4FrequencySeries *XLALResizeUINT4FrequencySeries ( UINT4FrequencySeries *series, int first, size_t length ); UINT4FrequencySeries *XLALResizeUINT4FrequencySeries ( UINT4FrequencySeries *series, int first, size_t length );
skipping to change at line 192 skipping to change at line 196
REAL4FrequencySeries *XLALShrinkREAL4FrequencySeries ( REAL4FrequencySeries *series, size_t first, size_t length ); REAL4FrequencySeries *XLALShrinkREAL4FrequencySeries ( REAL4FrequencySeries *series, size_t first, size_t length );
REAL8FrequencySeries *XLALShrinkREAL8FrequencySeries ( REAL8FrequencySeries *series, size_t first, size_t length ); REAL8FrequencySeries *XLALShrinkREAL8FrequencySeries ( REAL8FrequencySeries *series, size_t first, size_t length );
INT2FrequencySeries *XLALShrinkINT2FrequencySeries ( INT2FrequencySeries *s eries, size_t first, size_t length ); INT2FrequencySeries *XLALShrinkINT2FrequencySeries ( INT2FrequencySeries *s eries, size_t first, size_t length );
INT4FrequencySeries *XLALShrinkINT4FrequencySeries ( INT4FrequencySeries *s eries, size_t first, size_t length ); INT4FrequencySeries *XLALShrinkINT4FrequencySeries ( INT4FrequencySeries *s eries, size_t first, size_t length );
INT8FrequencySeries *XLALShrinkINT8FrequencySeries ( INT8FrequencySeries *s eries, size_t first, size_t length ); INT8FrequencySeries *XLALShrinkINT8FrequencySeries ( INT8FrequencySeries *s eries, size_t first, size_t length );
UINT2FrequencySeries *XLALShrinkUINT2FrequencySeries ( UINT2FrequencySeries *series, size_t first, size_t length ); UINT2FrequencySeries *XLALShrinkUINT2FrequencySeries ( UINT2FrequencySeries *series, size_t first, size_t length );
UINT4FrequencySeries *XLALShrinkUINT4FrequencySeries ( UINT4FrequencySeries *series, size_t first, size_t length ); UINT4FrequencySeries *XLALShrinkUINT4FrequencySeries ( UINT4FrequencySeries *series, size_t first, size_t length );
UINT8FrequencySeries *XLALShrinkUINT8FrequencySeries ( UINT8FrequencySeries *series, size_t first, size_t length ); UINT8FrequencySeries *XLALShrinkUINT8FrequencySeries ( UINT8FrequencySeries *series, size_t first, size_t length );
/*@}*/ /*@}*/
/** \name Addition Functions /**
* \name Addition Functions
\heading{Synopsis} *
* ### Synopsis ###
\code *
#include <lal/FrequencySeries.h> * \code
* #include <lal/FrequencySeries.h>
XLALAdd<frequencyseriestype>() *
\endcode * XLALAdd<frequencyseriestype>()
* \endcode
\heading{Description} *
* ### Description ###
These functions add the second argument to the first argument, returning a *
pointer to the first argument on success or NULL on failure. The two * These functions add the second argument to the first argument, returning
series must have the same epoch and frequency resolution, and have units a
that differ only by a dimensionless factor. * pointer to the first argument on success or NULL on failure. The two
* series must have the same epoch and frequency resolution, and have units
*/ * that differ only by a dimensionless factor.
*
*/
/*@{*/ /*@{*/
COMPLEX8FrequencySeries *XLALAddCOMPLEX8FrequencySeries ( COMPLEX8Frequency Series *arg1, const COMPLEX8FrequencySeries *arg2 ); COMPLEX8FrequencySeries *XLALAddCOMPLEX8FrequencySeries ( COMPLEX8Frequency Series *arg1, const COMPLEX8FrequencySeries *arg2 );
COMPLEX16FrequencySeries *XLALAddCOMPLEX16FrequencySeries ( COMPLEX16Freque ncySeries *arg1, const COMPLEX16FrequencySeries *arg2 ); COMPLEX16FrequencySeries *XLALAddCOMPLEX16FrequencySeries ( COMPLEX16Freque ncySeries *arg1, const COMPLEX16FrequencySeries *arg2 );
REAL4FrequencySeries *XLALAddREAL4FrequencySeries ( REAL4FrequencySeries *a rg1, const REAL4FrequencySeries *arg2 ); REAL4FrequencySeries *XLALAddREAL4FrequencySeries ( REAL4FrequencySeries *a rg1, const REAL4FrequencySeries *arg2 );
REAL8FrequencySeries *XLALAddREAL8FrequencySeries ( REAL8FrequencySeries *a rg1, const REAL8FrequencySeries *arg2 ); REAL8FrequencySeries *XLALAddREAL8FrequencySeries ( REAL8FrequencySeries *a rg1, const REAL8FrequencySeries *arg2 );
INT2FrequencySeries *XLALAddINT2FrequencySeries ( INT2FrequencySeries *arg1 , const INT2FrequencySeries *arg2 ); INT2FrequencySeries *XLALAddINT2FrequencySeries ( INT2FrequencySeries *arg1 , const INT2FrequencySeries *arg2 );
INT4FrequencySeries *XLALAddINT4FrequencySeries ( INT4FrequencySeries *arg1 , const INT4FrequencySeries *arg2 ); INT4FrequencySeries *XLALAddINT4FrequencySeries ( INT4FrequencySeries *arg1 , const INT4FrequencySeries *arg2 );
INT8FrequencySeries *XLALAddINT8FrequencySeries ( INT8FrequencySeries *arg1 , const INT8FrequencySeries *arg2 ); INT8FrequencySeries *XLALAddINT8FrequencySeries ( INT8FrequencySeries *arg1 , const INT8FrequencySeries *arg2 );
UINT2FrequencySeries *XLALAddUINT2FrequencySeries ( UINT2FrequencySeries *a rg1, const UINT2FrequencySeries *arg2 ); UINT2FrequencySeries *XLALAddUINT2FrequencySeries ( UINT2FrequencySeries *a rg1, const UINT2FrequencySeries *arg2 );
UINT4FrequencySeries *XLALAddUINT4FrequencySeries ( UINT4FrequencySeries *a rg1, const UINT4FrequencySeries *arg2 ); UINT4FrequencySeries *XLALAddUINT4FrequencySeries ( UINT4FrequencySeries *a rg1, const UINT4FrequencySeries *arg2 );
UINT8FrequencySeries *XLALAddUINT8FrequencySeries ( UINT8FrequencySeries *a rg1, const UINT8FrequencySeries *arg2 ); UINT8FrequencySeries *XLALAddUINT8FrequencySeries ( UINT8FrequencySeries *a rg1, const UINT8FrequencySeries *arg2 );
/*@}*/ /*@}*/
/** \name Conjugation Functions /**
* \name Conjugation Functions
\heading{Synopsis} *
* ### Synopsis ###
\code *
#include <lal/FrequencySeries.h> * \code
* #include <lal/FrequencySeries.h>
XLALConjugate<frequencyseriestype>() *
\endcode * XLALConjugate<frequencyseriestype>()
* \endcode
\heading{Description} *
* ### Description ###
These functions replace a frequency series with its complex conjugate. *
* These functions replace a frequency series with its complex conjugate.
*/ *
*/
/*@{*/ /*@{*/
COMPLEX8FrequencySeries *XLALConjugateCOMPLEX8FrequencySeries ( COMPLEX8Fre quencySeries *series ); COMPLEX8FrequencySeries *XLALConjugateCOMPLEX8FrequencySeries ( COMPLEX8Fre quencySeries *series );
COMPLEX16FrequencySeries *XLALConjugateCOMPLEX16FrequencySeries ( COMPLEX16 FrequencySeries *series ); COMPLEX16FrequencySeries *XLALConjugateCOMPLEX16FrequencySeries ( COMPLEX16 FrequencySeries *series );
/*@}*/ /*@}*/
/** \name Multiplication Functions /**
* \name Multiplication Functions
\heading{Synopsis} *
* ### Synopsis ###
\code *
#include <lal/FrequencySeries.h> * \code
* #include <lal/FrequencySeries.h>
XLALMultiply<frequencyseriestype>() *
\endcode * XLALMultiply<frequencyseriestype>()
* \endcode
\heading{Description} *
* ### Description ###
These functions multiply the first argument by the second argument, *
returning a pointer to the first argument on success or NULL on failure. * These functions multiply the first argument by the second argument,
The two series must have the same epoch and frequency resolution, and have * returning a pointer to the first argument on success or NULL on failure.
units that differ only by a dimensionless factor. * The two series must have the same epoch and frequency resolution, and ha
ve
*/ * units that differ only by a dimensionless factor.
*
*/
/*@{*/ /*@{*/
COMPLEX8FrequencySeries *XLALMultiplyCOMPLEX8FrequencySeries ( COMPLEX8Freq uencySeries *arg1, const COMPLEX8FrequencySeries *arg2 ); COMPLEX8FrequencySeries *XLALMultiplyCOMPLEX8FrequencySeries ( COMPLEX8Freq uencySeries *arg1, const COMPLEX8FrequencySeries *arg2 );
COMPLEX16FrequencySeries *XLALMultiplyCOMPLEX16FrequencySeries ( COMPLEX16F requencySeries *arg1, const COMPLEX16FrequencySeries *arg2 ); COMPLEX16FrequencySeries *XLALMultiplyCOMPLEX16FrequencySeries ( COMPLEX16F requencySeries *arg1, const COMPLEX16FrequencySeries *arg2 );
REAL4FrequencySeries *XLALMultiplyREAL4FrequencySeries ( REAL4FrequencySeri es *arg1, const REAL4FrequencySeries *arg2 ); REAL4FrequencySeries *XLALMultiplyREAL4FrequencySeries ( REAL4FrequencySeri es *arg1, const REAL4FrequencySeries *arg2 );
REAL8FrequencySeries *XLALMultiplyREAL8FrequencySeries ( REAL8FrequencySeri es *arg1, const REAL8FrequencySeries *arg2 ); REAL8FrequencySeries *XLALMultiplyREAL8FrequencySeries ( REAL8FrequencySeri es *arg1, const REAL8FrequencySeries *arg2 );
INT2FrequencySeries *XLALMultiplyINT2FrequencySeries ( INT2FrequencySeries *arg1, const INT2FrequencySeries *arg2 ); INT2FrequencySeries *XLALMultiplyINT2FrequencySeries ( INT2FrequencySeries *arg1, const INT2FrequencySeries *arg2 );
INT4FrequencySeries *XLALMultiplyINT4FrequencySeries ( INT4FrequencySeries *arg1, const INT4FrequencySeries *arg2 ); INT4FrequencySeries *XLALMultiplyINT4FrequencySeries ( INT4FrequencySeries *arg1, const INT4FrequencySeries *arg2 );
INT8FrequencySeries *XLALMultiplyINT8FrequencySeries ( INT8FrequencySeries *arg1, const INT8FrequencySeries *arg2 ); INT8FrequencySeries *XLALMultiplyINT8FrequencySeries ( INT8FrequencySeries *arg1, const INT8FrequencySeries *arg2 );
UINT2FrequencySeries *XLALMultiplyUINT2FrequencySeries ( UINT2FrequencySeri es *arg1, const UINT2FrequencySeries *arg2 ); UINT2FrequencySeries *XLALMultiplyUINT2FrequencySeries ( UINT2FrequencySeri es *arg1, const UINT2FrequencySeries *arg2 );
UINT4FrequencySeries *XLALMultiplyUINT4FrequencySeries ( UINT4FrequencySeri es *arg1, const UINT4FrequencySeries *arg2 ); UINT4FrequencySeries *XLALMultiplyUINT4FrequencySeries ( UINT4FrequencySeri es *arg1, const UINT4FrequencySeries *arg2 );
 End of changes. 8 change blocks. 
146 lines changed or deleted 159 lines changed or added


 Grid.h   Grid.h 
skipping to change at line 32 skipping to change at line 32
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
\addtogroup Grid_h * \addtogroup Grid_h
\author Creighton, T. D. * \author Creighton, T. D.
*
\brief Provides a structured datatype for a multidimensional rectilinear * \brief Provides a structured datatype for a multidimensional rectilinear
grid. grid.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/Grid.h> * \code
\endcode * #include <lal/Grid.h>
* \endcode
This header provides a new structured datatype storing data *
on a multidimensional rectilinear grid. It is in some sense a * This header provides a new structured datatype storing data
generalization of the series datatypes (frequency series, time series, * on a multidimensional rectilinear grid. It is in some sense a
etc.), representing evenly-sampled data over some physical parameter * generalization of the series datatypes (frequency series, time series,
space. * etc.), representing evenly-sampled data over some physical parameter
* space.
\heading{Structure <tt>\<datatype\>Grid</tt>} *
* ### Structure <tt>\<datatype\>Grid</tt> ###
This structure is a generalization of the LAL series types, *
storing data on an \f$m\f$-dimensional rectangular grid on a physical * This structure is a generalization of the LAL series types,
parameter space. The values on the grid are of type <tt>\<datatype\></tt> * storing data on an \f$m\f$-dimensional rectangular grid on a physical
which can be any LAL primitive \e numerical datatype (#INT2, * parameter space. The values on the grid are of type <tt>\<datatype\></t
#INT4, #INT8, #UINT2, #UINT4, #UINT8, t>
#REAL4, #REAL8, #COMPLEX8, #COMPLEX16). The * which can be any LAL primitive \e numerical datatype (#INT2,
data are stored in an array of dimension \f$M\geq m\f$: if \f$M=m\f$, then * #INT4, #INT8, #UINT2, #UINT4, #UINT8,
the * #REAL4, #REAL8, #COMPLEX8, #COMPLEX16). The
structure stores a single value for each grid point; if \f$M>m\f$, then * data are stored in an array of dimension \f$M\geq m\f$: if \f$M=m\f$, th
the structure stores a vector or array of values on the ``tangent en the
space'' of each grid point. We refer to \f$m\f$ as the \e grid * structure stores a single value for each grid point; if \f$M>m\f$, then
dimension and \f$M\f$ as the \e data dimension. The fields of the * the structure stores a vector or array of values on the ``tangent
structure are: * space'' of each grid point. We refer to \f$m\f$ as the \e grid
* dimension and \f$M\f$ as the \e data dimension. The fields of the
<dl> * structure are:
<dt><tt>CHAR name[LALNameLength]</tt></dt><dd> A name identifying the grid *
and/or the data being sampled.</dd> * <dl>
* <dt><tt>CHAR name[LALNameLength]</tt></dt><dd> A name identifying the gr
<dt><tt>LALUnit sampleUnits</tt></dt><dd> The physical units of the id
quantities on the grid.</dd> * and/or the data being sampled.</dd>
*
<dt><tt>LALUnit *dimUnits</tt></dt><dd> The physical units of the grid axes * <dt><tt>LALUnit sampleUnits</tt></dt><dd> The physical units of the
. * quantities on the grid.</dd>
This must be allocated as an array of length \f$m\f$.</dd> *
* <dt><tt>LALUnit *dimUnits</tt></dt><dd> The physical units of the grid a
<dt><tt>REAL8Vector *offset</tt></dt><dd> A vector \f$\mathbf{p}_0\f$ xes.
specifying the location of the grid point indexed by \f$(0,\ldots,0)\f$. * This must be allocated as an array of length \f$m\f$.</dd>
Must have dimensionality \f$m\f$.</dd> *
* <dt><tt>REAL8Vector *offset</tt></dt><dd> A vector \f$\mathbf{p}_0\f$
<dt><tt>REAL8Vector *interval</tt></dt><dd> The vector \f$\Delta\mathbf{p}\ * specifying the location of the grid point indexed by \f$(0,\ldots,0)\f$.
f$ * Must have dimensionality \f$m\f$.</dd>
specifying the grid spacing in each dimension. Must have *
dimensionality \f$m\f$.</dd> * <dt><tt>REAL8Vector *interval</tt></dt><dd> The vector \f$\Delta\mathbf{
p}\f$
<dt><tt>\<datatype\>Array *data</tt></dt><dd> Pointer to an array storing t * specifying the grid spacing in each dimension. Must have
he * dimensionality \f$m\f$.</dd>
data values at the corresponding grid points. The data dimension *
\f$M=\f$<tt>data->dimLength->length</tt> must be greater than or equal to * <dt><tt>\<datatype\>Array *data</tt></dt><dd> Pointer to an array storin
the grid dimension \f$m=\f$<tt>offset->length</tt>=<tt>interval->length</tt g the
>. * data values at the corresponding grid points. The data dimension
An index \f$\mathbf{i}=(i_0,\ldots,i_{M-1})\f$, where \f$i_k\f$ are integer * \f$M=\f$<tt>data->dimLength->length</tt> must be greater than or equal t
s o
from 0 to <tt>data->dimLength->data</tt>\f${}_k\f$, specifies a grid point * the grid dimension \f$m=\f$<tt>offset->length</tt>=<tt>interval->length<
located at \f$\mathbf{p}=\mathbf{p}_0+\sum_{k=0}^{n-1}\hat{\mathbf{e}}_k /tt>.
i_k \Delta p_k\f$ if \f$M=m\f$, or an array element \f$\mathsf{A}_{i_m\cdot * An index \f$\mathbf{i}=(i_0,\ldots,i_{M-1})\f$, where \f$i_k\f$ are inte
s gers
i_{M-1}}\f$ at that grid point if \f$M>m\f$. The values in * from 0 to <tt>data->dimLength->data</tt>\f${}_k\f$, specifies a grid poi
<tt>data->data</tt> are the value stored at each grid point (or array nt
element at each grid point), arranged in the manner discussed in * located at \f$\mathbf{p}=\mathbf{p}_0+\sum_{k=0}^{n-1}\hat{\mathbf{e}}_k
\ref LALDatatypes.h.</dd> * i_k \Delta p_k\f$ if \f$M=m\f$, or an array element \f$\mathsf{A}_{i_m\c
</dl> dots
* i_{M-1}}\f$ at that grid point if \f$M>m\f$. The values in
\heading{Prototypes} * <tt>data->data</tt> are the value stored at each grid point (or array
* element at each grid point), arranged in the manner discussed in
\code * \ref LALDatatypes.h.</dd>
void * </dl>
LAL<typecode>CreateGrid( LALStatus *stat, *
<datatype>Grid **grid, * ### Prototypes ###
UINT4Vector *dimLength, *
UINT4 dimension ) * \code
* void
void * LAL<typecode>CreateGrid( LALStatus *stat,
LAL<typecode>DestroyGrid( LALStatus *stat, * <datatype>Grid **grid,
<datatype>Grid **grid ) * UINT4Vector *dimLength,
\endcode * UINT4 dimension )
*
\heading{Description} * void
* LAL<typecode>DestroyGrid( LALStatus *stat,
These routines create or destroy a <tt>\<datatype\>Grid</tt> structure. * <datatype>Grid **grid )
The input vector \c dimLength stores the lengths of each dimension * \endcode
of the grid \e and of the array at each grid point: in the *
notation defined in \ref Grid.h, <tt>dimLength->length</tt>\f$=M\f$. The * ### Description ###
parameter \c dimension gives the dimension \f$m\f$ of the physical *
grid space; if \f$M>m\f$, then the remaining dimensions refer to a tangent * These routines create or destroy a <tt>\<datatype\>Grid</tt> structure.
space at each grid point. When creating a grid, the routines allocate * The input vector \c dimLength stores the lengths of each dimension
space for all the internal vectors and arrays, but no data are filled * of the grid \e and of the array at each grid point: in the
in, with the exception of the <tt>(*grid)->data->dimLength</tt> vector * notation defined in \ref Grid.h, <tt>dimLength->length</tt>\f$=M\f$. Th
(which will contain exactly the same data as the \c dimLength e
input parameter). When calling the <tt>LAL\<typecode\>CreateGrid()</tt> * parameter \c dimension gives the dimension \f$m\f$ of the physical
routines, or on returning from the <tt>LAL\<typecode\>DestroyGrid()</tt> * grid space; if \f$M>m\f$, then the remaining dimensions refer to a tange
routines, \c grid should be a non-\c NULL handle to a nt
\c NULL-valued pointer. * space at each grid point. When creating a grid, the routines allocate
* space for all the internal vectors and arrays, but no data are filled
For each of these prototype templates there are in fact 10 separate * in, with the exception of the <tt>(*grid)->data->dimLength</tt> vector
routines corresponding to all the numerical atomic datatypes * (which will contain exactly the same data as the \c dimLength
<tt>\<datatype\></tt> referred to by <tt>\<typecode\></tt>: * input parameter). When calling the <tt>LAL\<typecode\>CreateGrid()</tt>
* routines, or on returning from the <tt>LAL\<typecode\>DestroyGrid()</tt>
<table> * routines, \c grid should be a non-\c NULL handle to a
<tr><th>\<typecode\></th><th>\<datatype\></th><th>\<typecode\></th><th>\<da * \c NULL-valued pointer.
tatype\></th></tr> *
<tr><td>I2</td><td> INT2</td><td> U2</td><td> UINT2</td></tr> * For each of these prototype templates there are in fact 10 separate
<tr><td>I4</td><td> INT4</td><td> U4</td><td> UINT4</td></tr> * routines corresponding to all the numerical atomic datatypes
<tr><td>I8</td><td> INT8</td><td> U8</td><td> UINT8</td></tr> * <tt>\<datatype\></tt> referred to by <tt>\<typecode\></tt>:
<tr><td> S</td><td> REAL4</td><td> C</td><td> COMPLEX8</td></tr> *
<tr><td> D</td><td> REAL8</td><td> Z</td><td> COMPLEX16</td></tr> * <table>
</table> * <tr><th>\<typecode\></th><th>\<datatype\></th><th>\<typecode\></th><th>\
<datatype\></th></tr>
*/ * <tr><td>I2</td><td> INT2</td><td> U2</td><td> UINT2</td></tr>
* <tr><td>I4</td><td> INT4</td><td> U4</td><td> UINT4</td></tr>
* <tr><td>I8</td><td> INT8</td><td> U8</td><td> UINT8</td></tr>
* <tr><td> S</td><td> REAL4</td><td> C</td><td> COMPLEX8</td></tr>
* <tr><td> D</td><td> REAL8</td><td> Z</td><td> COMPLEX16</td></tr>
* </table>
*
*/
/*@{*/ /*@{*/
/** \name Error Codes *//*@{ */ /** \name Error Codes */ /*@{ */
#define GRIDH_ENUL 1 /**< Unexpected null pointer in arguments */ #define GRIDH_ENUL 1 /**< Unexpected null pointer in arguments */
#define GRIDH_EOUT 2 /**< Output handle points to a non-null pointer */ #define GRIDH_EOUT 2 /**< Output handle points to a non-null pointer */
#define GRIDH_EMEM 3 /**< Memory allocation error */ #define GRIDH_EMEM 3 /**< Memory allocation error */
/*@}*/ /*@}*/
/*@}*/ /*@}*/
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
#define GRIDH_MSGENUL "Unexpected null pointer in arguments" #define GRIDH_MSGENUL "Unexpected null pointer in arguments"
#define GRIDH_MSGEOUT "Output handle points to a non-null pointer" #define GRIDH_MSGEOUT "Output handle points to a non-null pointer"
#define GRIDH_MSGEMEM "Memory allocation error" #define GRIDH_MSGEMEM "Memory allocation error"
 End of changes. 2 change blocks. 
118 lines changed or deleted 125 lines changed or added


 IIRFilter.h   IIRFilter.h 
skipping to change at line 33 skipping to change at line 33
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#include <lal/ZPGFilter.h> #include <lal/ZPGFilter.h>
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
\addtogroup IIRFilter_h * \addtogroup IIRFilter_h
\author Creighton, T. D. * \author Creighton, T. D.
*
\brief Provides routines to make and apply IIR filters. * \brief Provides routines to make and apply IIR filters.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/IIRFilter.h> * \code
\endcode * #include <lal/IIRFilter.h>
* \endcode
This header covers routines that create, destroy, and apply *
generic time-domain filters, given by objects of type * This header covers routines that create, destroy, and apply
<tt>\<datatype\>IIRFilter</tt>, where <tt>\<datatype\></tt> is either * generic time-domain filters, given by objects of type
\c REAL4 or \c REAL8. * <tt>\<datatype\>IIRFilter</tt>, where <tt>\<datatype\></tt> is either
* \c REAL4 or \c REAL8.
An IIR (Infinite Impulse Response) filter is a generalized linear *
causal time-domain filter, in which the filter output \f$y_n=y(t_n)\f$ at * An IIR (Infinite Impulse Response) filter is a generalized linear
any sampled time \f$t_n=t_0+n\Delta t\f$ is a linear combination of the * causal time-domain filter, in which the filter output \f$y_n=y(t_n)\f$ a
input \f$x\f$ \e and output \f$y\f$ at previous sampled times: t
\f[ * any sampled time \f$t_n=t_0+n\Delta t\f$ is a linear combination of the
y_n = \sum_{k=0}^M c_k x_{n-k} + \sum_{l=1}^N d_l y_{n-l} \; . * input \f$x\f$ \e and output \f$y\f$ at previous sampled times:
\f] * \f[
The coefficients \f$c_k\f$ are called the direct filter coefficients, and * y_n = \sum_{k=0}^M c_k x_{n-k} + \sum_{l=1}^N d_l y_{n-l} \; .
the coefficients \f$d_l\f$ are the recursive filter coefficients. The * \f]
filter order is the larger of \f$M\f$ or \f$N\f$, and determines how far ba * The coefficients \f$c_k\f$ are called the direct filter coefficients, an
ck d
in time the filter must look to determine its next output. However, * the coefficients \f$d_l\f$ are the recursive filter coefficients. The
the recursive nature of the filter means that the output can depend on * filter order is the larger of \f$M\f$ or \f$N\f$, and determines how far
input arbitrarily far in the past; hence the name "infinite impulse back
response". Nonetheless, for a well-designed, stable filter, the * in time the filter must look to determine its next output. However,
actual filter response to an impulse should diminish rapidly beyond * the recursive nature of the filter means that the output can depend on
some characteristic timescale. * input arbitrarily far in the past; hence the name "infinite impulse
* response". Nonetheless, for a well-designed, stable filter, the
Note that nonrecursive FIR (Finite Impulse Response) filters are * actual filter response to an impulse should diminish rapidly beyond
considered a subset of IIR filters, having \f$N=0\f$. * some characteristic timescale.
*
For practical implementation, it is convenient to express the bilinear * Note that nonrecursive FIR (Finite Impulse Response) filters are
equation above as two linear equations involving an auxiliary sequence * considered a subset of IIR filters, having \f$N=0\f$.
\f$w\f$: *
\f[ * For practical implementation, it is convenient to express the bilinear
w_n = x_n + \sum_{l=1}^N d_l w_{n-l} \; , * equation above as two linear equations involving an auxiliary sequence
\f] * \f$w\f$:
\f[ * \f[
y_n = \sum_{k=0}^M c_k w_{n-k} \; . * w_n = x_n + \sum_{l=1}^N d_l w_{n-l} \; ,
\f] * \f]
The equivalence of this to the first expression is not obvious, but * \f[
can be proven by mathematical induction. The advantage of the * y_n = \sum_{k=0}^M c_k w_{n-k} \; .
auxiliary variable representation is twofold. First, when one is * \f]
feeding data point by point to the filter, the filter needs only * The equivalence of this to the first expression is not obvious, but
"remember" the previous \f$M\f$ or \f$N\f$ (whichever is larger) values of * can be proven by mathematical induction. The advantage of the
\f$w\f$, rather than remembering the previous \f$M\f$ values of \f$x\f$ \e * auxiliary variable representation is twofold. First, when one is
and * feeding data point by point to the filter, the filter needs only
the previous \f$N\f$ values of \f$y\f$. Second, when filtering a large sto * "remember" the previous \f$M\f$ or \f$N\f$ (whichever is larger) values
red of
data vector, the filter response can be computed in place: one first * \f$w\f$, rather than remembering the previous \f$M\f$ values of \f$x\f$
runs forward through the vector replacing \f$x\f$ with \f$w\f$, and then \e and
backward replacing \f$w\f$ with \f$y\f$. * the previous \f$N\f$ values of \f$y\f$. Second, when filtering a large
stored
Although the IIR filters in these routines are explicitly real, one * data vector, the filter response can be computed in place: one first
can consider formally their complex response. A sinusoidal input can * runs forward through the vector replacing \f$x\f$ with \f$w\f$, and then
thus be written as \f$x_n=X\exp(2\pi ifn\Delta t)=Xz^n\f$, where \f$X\f$ is * backward replacing \f$w\f$ with \f$y\f$.
a *
complex amplitude and \f$z=\exp(2\pi if\Delta t)\f$ is a complex * Although the IIR filters in these routines are explicitly real, one
parametrization of the frequency. By linearity, the output must also * can consider formally their complex response. A sinusoidal input can
be sinusoidal: \f$y_m=Y\exp(2\pi ifm\Delta t)=Yz^m\f$. Putting these into * thus be written as \f$x_n=X\exp(2\pi ifn\Delta t)=Xz^n\f$, where \f$X\f$
the bilinear equation, one can easily compute the filter's complex is a
transfer function: * complex amplitude and \f$z=\exp(2\pi if\Delta t)\f$ is a complex
\f[ * parametrization of the frequency. By linearity, the output must also
T(z) = \frac{Y}{X} = \frac{\sum_{k=0}^M c_k z^{-k}} * be sinusoidal: \f$y_m=Y\exp(2\pi ifm\Delta t)=Yz^m\f$. Putting these in
{1 - \sum_{l=1}^N d_l z^{-l}} to
\f] * the bilinear equation, one can easily compute the filter's complex
This can be readily converted to and from the "zeros, poles, gain" * transfer function:
representation of a filter, which expresses \f$T(z)\f$ as a factored * \f[
rational function of \f$z\f$. * T(z) = \frac{Y}{X} = \frac{\sum_{k=0}^M c_k z^{-k}}
* {1 - \sum_{l=1}^N d_l z^{-l}}
It should also be noted that, in the routines covered by this header, * \f]
I have adopted the convention of including a redundant recursive * This can be readily converted to and from the "zeros, poles, gain"
coefficient \f$d_0\f$, in order to make the indexing more intuitive. For * representation of a filter, which expresses \f$T(z)\f$ as a factored
formal correctness \f$d_0\f$ should be set to \f$-1\f$, although the filter * rational function of \f$z\f$.
ing *
routines never actually use this coefficient. * It should also be noted that, in the routines covered by this header,
* I have adopted the convention of including a redundant recursive
*/ * coefficient \f$d_0\f$, in order to make the indexing more intuitive. Fo
r
* formal correctness \f$d_0\f$ should be set to \f$-1\f$, although the fil
tering
* routines never actually use this coefficient.
*
*/
/*@{*/ /*@{*/
/** /**
@{ * @{
\defgroup CreateIIRFilter_c Module CreateIIRFilter.c * \defgroup CreateIIRFilter_c Module CreateIIRFilter.c
\defgroup DestroyIIRFilter_c Module DestroyIIRFilter.c * \defgroup DestroyIIRFilter_c Module DestroyIIRFilter.c
\defgroup IIRFilter_c Module IIRFilter.c * \defgroup IIRFilter_c Module IIRFilter.c
\defgroup IIRFilterVector_c Module IIRFilterVector.c * \defgroup IIRFilterVector_c Module IIRFilterVector.c
\defgroup IIRFilterVectorR_c Module IIRFilterVectorR.c * \defgroup IIRFilterVectorR_c Module IIRFilterVectorR.c
@} * @}
*/ */
/** \name Error Codes */ /** \name Error Codes */
/*@{*/ /*@{*/
#define IIRFILTERH_ENUL 1 /**< Unexpected null pointer in arguments */ #define IIRFILTERH_ENUL 1 /**< Unexpected null pointer in arguments */
#define IIRFILTERH_EOUT 2 /**< Output handle points to a non-null poin ter */ #define IIRFILTERH_EOUT 2 /**< Output handle points to a non-null poin ter */
#define IIRFILTERH_EMEM 3 /**< Memory allocation error */ #define IIRFILTERH_EMEM 3 /**< Memory allocation error */
#define IIRFILTERH_EPAIR 4 /**< Input has unpaired nonreal poles or zer os */ #define IIRFILTERH_EPAIR 4 /**< Input has unpaired nonreal poles or zer os */
/*@}*/ /*@}*/
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
#define IIRFILTERH_MSGENUL "Unexpected null pointer in arguments" #define IIRFILTERH_MSGENUL "Unexpected null pointer in arguments"
#define IIRFILTERH_MSGEOUT "Output handle points to a non-null pointer" #define IIRFILTERH_MSGEOUT "Output handle points to a non-null pointer"
#define IIRFILTERH_MSGEMEM "Memory allocation error" #define IIRFILTERH_MSGEMEM "Memory allocation error"
#define IIRFILTERH_MSGEPAIR "Input has unpaired nonreal poles or zeros" #define IIRFILTERH_MSGEPAIR "Input has unpaired nonreal poles or zeros"
/** \endcond */ /** \endcond */
/** This structure stores the direct and recursive REAL4 filter coefficient /**
s, as * This structure stores the direct and recursive REAL4 filter coefficients
, as
* well as the history of the auxiliary sequence \f$w\f$. * well as the history of the auxiliary sequence \f$w\f$.
* The length of the history vector gives the order of the filter * The length of the history vector gives the order of the filter
*/ */
#ifdef SWIG /* SWIG interface directives */ #ifdef SWIG /* SWIG interface directives */
SWIGLAL(IMMUTABLE_MEMBERS(tagREAL4IIRFilter, name)); SWIGLAL(IMMUTABLE_MEMBERS(tagREAL4IIRFilter, name));
#endif /* SWIG */ #endif /* SWIG */
typedef struct tagREAL4IIRFilter{ typedef struct tagREAL4IIRFilter{
const CHAR *name; /**< User assigned name. */ const CHAR *name; /**< User assigned name. */
REAL8 deltaT; /**< Sampling time interval of the filter; If \f $\leq0\f$, it will be ignored (ie it will be taken from the data stream) */ REAL8 deltaT; /**< Sampling time interval of the filter; If \f $\leq0\f$, it will be ignored (ie it will be taken from the data stream) */
REAL4Vector *directCoef; /**< The direct filter coefficients. */ REAL4Vector *directCoef; /**< The direct filter coefficients. */
REAL4Vector *recursCoef; /**< The recursive filter coefficients. */ REAL4Vector *recursCoef; /**< The recursive filter coefficients. */
REAL4Vector *history; /**< The previous values of w. */ REAL4Vector *history; /**< The previous values of w. */
} REAL4IIRFilter; } REAL4IIRFilter;
/** This structure stores the direct and recursive REAL8 filter coefficient /**
s, as * This structure stores the direct and recursive REAL8 filter coefficients
, as
* well as the history of the auxiliary sequence \f$w\f$. * well as the history of the auxiliary sequence \f$w\f$.
* The length of the history vector gives the order of the filter * The length of the history vector gives the order of the filter
*/ */
#ifdef SWIG /* SWIG interface directives */ #ifdef SWIG /* SWIG interface directives */
SWIGLAL(IMMUTABLE_MEMBERS(tagREAL8IIRFilter, name)); SWIGLAL(IMMUTABLE_MEMBERS(tagREAL8IIRFilter, name));
#endif /* SWIG */ #endif /* SWIG */
typedef struct tagREAL8IIRFilter{ typedef struct tagREAL8IIRFilter{
const CHAR *name; /**< User assigned name. */ const CHAR *name; /**< User assigned name. */
REAL8 deltaT; /**< Sampling time interval of the filter; If \f $\leq0\f$, it will be ignored (ie it will be taken from the data stream). * / REAL8 deltaT; /**< Sampling time interval of the filter; If \f $\leq0\f$, it will be ignored (ie it will be taken from the data stream). * /
REAL8Vector *directCoef; /**< The direct filter coefficients. */ REAL8Vector *directCoef; /**< The direct filter coefficients. */
 End of changes. 4 change blocks. 
95 lines changed or deleted 103 lines changed or added


 Inject.h   Inject.h 
skipping to change at line 33 skipping to change at line 33
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#include <lal/Random.h> #include <lal/Random.h>
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
\addtogroup Inject_h * \addtogroup Inject_h
\author Creighton, T. D. * \author Creighton, T. D.
*
\brief Provides routines to inject a signal into detector output. * \brief Provides routines to inject a signal into detector output.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/Inject.h> * \code
\endcode * #include <lal/Inject.h>
* \endcode
This header provides simple routines to inject a signal, stored as a *
floating-point time series, into an integer time series that * This header provides simple routines to inject a signal, stored as a
represents the ADC output of a detector channel. * floating-point time series, into an integer time series that
* represents the ADC output of a detector channel.
The basic concept at work here is that of \e dithering. That is, *
to add a real signal \f$x(t_k)\f$ to the integer output \f$n(t_k)\f$ of an * The basic concept at work here is that of \e dithering. That is,
ADC, we cannot simply compute \f$x+n\f$ at each time \f$t_k\f$ and round to * to add a real signal \f$x(t_k)\f$ to the integer output \f$n(t_k)\f$ of
the nearest integer. To see this, consider injecting a sinusoid with an
an amplitude less than half the ADC resolution, \f$|x|<0.5\f$. Then * ADC, we cannot simply compute \f$x+n\f$ at each time \f$t_k\f$ and round
adding \f$x+n\f$ and rounding will always give back \f$n\f$, and the signal to
injection will have no effect on the output. * the nearest integer. To see this, consider injecting a sinusoid with
* an amplitude less than half the ADC resolution, \f$|x|<0.5\f$. Then
Instead, what we would like to do is to add \f$x\f$ to the ADC * adding \f$x+n\f$ and rounding will always give back \f$n\f$, and the sig
\e input before rounding occurs, and then round to an integer. nal
That is, the ADC input was actually \f$n+d\f$, where \f$d\in[-0.5,0.5)\f$; * injection will have no effect on the output.
we *
want to compute the rounded value of \f$n+d+x\f$, which may occasionally * Instead, what we would like to do is to add \f$x\f$ to the ADC
be different from \f$n\f$. In principle, a Fourier transforms can detect * \e input before rounding occurs, and then round to an integer.
a sinusoidal signal with an output much smaller than the ADC * That is, the ADC input was actually \f$n+d\f$, where \f$d\in[-0.5,0.5)\f
resolution: by integrating enough data, one can eventually detect a $; we
statistically significant phase correlation between the occasional * want to compute the rounded value of \f$n+d+x\f$, which may occasionally
increments and decrements in \f$n\f$. * be different from \f$n\f$. In principle, a Fourier transforms can detec
t
Of course given the output time series \f$n(t_k)\f$ we can only guess at * a sinusoidal signal with an output much smaller than the ADC
the input series \f$n(t_k)+d(t_k)\f$ that produced it. The simplest guess * resolution: by integrating enough data, one can eventually detect a
is to assume that each \f$d(t_k)\f$ is an independent random variable with * statistically significant phase correlation between the occasional
a flat distribution over the range \f$[-0.5,0.5)\f$. This is a reasonable * increments and decrements in \f$n\f$.
guess to make if the root mean square variation between succesive *
output values \f$n\f$ is a few or more ADC counts; i.e. if the * Of course given the output time series \f$n(t_k)\f$ we can only guess at
dimensionless power spectral density \f$\sqrt{fS(f)}\f$ has a value of a * the input series \f$n(t_k)+d(t_k)\f$ that produced it. The simplest gue
few or more around the sampling freqeuncy \f$f\f$. This is almost always ss
true of any detector designed to work at or near its noise limit: the * is to assume that each \f$d(t_k)\f$ is an independent random variable wi
input to the ADC will first be whitened so that \f$\sqrt{fS(f)}\f$ is th
nearly flat, and then amplified so that \f$\sqrt{fS(f)}\f$ is on the order * a flat distribution over the range \f$[-0.5,0.5)\f$. This is a reasonab
of several (or more) ADC counts. le
* guess to make if the root mean square variation between succesive
In the routines covered by this header we will take it for granted * output values \f$n\f$ is a few or more ADC counts; i.e. if the
that the above is a reasonable approximation, and will not check for * dimensionless power spectral density \f$\sqrt{fS(f)}\f$ has a value of a
it. We will further assume that the signal to be injected has already * few or more around the sampling freqeuncy \f$f\f$. This is almost alway
been subjected to the same whitening and amplification, so that the s
units of \f$x(t_k)\f$ are normalized ADC counts (although it is still a * true of any detector designed to work at or near its noise limit: the
real number, not an integer). * input to the ADC will first be whitened so that \f$\sqrt{fS(f)}\f$ is
* nearly flat, and then amplified so that \f$\sqrt{fS(f)}\f$ is on the ord
The dithering routines should be used whenever one is injecting a er
signal into a time series representing raw digitized data. In some * of several (or more) ADC counts.
data storage specifications, ADC output is not stored as an integer, *
but as a floating-point number representing an integer value. Such * In the routines covered by this header we will take it for granted
data must be cast to integers before being passed to the digitizing * that the above is a reasonable approximation, and will not check for
routines. * it. We will further assume that the signal to be injected has already
* been subjected to the same whitening and amplification, so that the
This header also provides even simpler routines for injecting a signal * units of \f$x(t_k)\f$ are normalized ADC counts (although it is still a
into floating-point data, without dithering. These should only be * real number, not an integer).
used when the data is genuinely continuous in character. This can *
include data derived by applying floating-point operations on ADC * The dithering routines should be used whenever one is injecting a
channels (e.g.\ digital filters, linear combinations of channels, * signal into a time series representing raw digitized data. In some
etc.), but not data that simply represents ADC output in * data storage specifications, ADC output is not stored as an integer,
floating-point format. The assumption here is that the numerical * but as a floating-point number representing an integer value. Such
post-processing of the ADC data completely masks any statistical * data must be cast to integers before being passed to the digitizing
signiatures of the digitization. * routines.
*
@{ * This header also provides even simpler routines for injecting a signal
\defgroup InjectVector_c Module InjectVector.c * into floating-point data, without dithering. These should only be
\defgroup InjectTimeSeries_c Module InjectTimeSeries.c * used when the data is genuinely continuous in character. This can
@} * include data derived by applying floating-point operations on ADC
*/ * channels (e.g.\ digital filters, linear combinations of channels,
* etc.), but not data that simply represents ADC output in
* floating-point format. The assumption here is that the numerical
* post-processing of the ADC data completely masks any statistical
* signiatures of the digitization.
*
* @{
* \defgroup InjectVector_c Module InjectVector.c
* \defgroup InjectTimeSeries_c Module InjectTimeSeries.c
* @}
*/
/*@{*/ /*@{*/
/** \name Error Codes */ /** \name Error Codes */
/*@{*/ /*@{*/
#define INJECTH_ENUL 1 /**< Unexpected null pointer in arguments. * / #define INJECTH_ENUL 1 /**< Unexpected null pointer in arguments. * /
#define INJECTH_EBAD 2 /**< A sampling interval is (effectively) zero */ #define INJECTH_EBAD 2 /**< A sampling interval is (effectively) zero */
#define INJECTH_EUNIT 3 /**< Input or output is not in units of ADC counts */ #define INJECTH_EUNIT 3 /**< Input or output is not in units of ADC counts */
/*@}*/ /*@}*/
/*@}*/ /*@}*/
 End of changes. 1 change blocks. 
75 lines changed or deleted 85 lines changed or added


 Integrate.h   Integrate.h 
skipping to change at line 30 skipping to change at line 30
#ifndef _INTEGRATE_H #ifndef _INTEGRATE_H
#define _INTEGRATE_H #define _INTEGRATE_H
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup Integrate_h * \addtogroup Integrate_h
*
\brief Integrates a function. * \brief Integrates a function.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/Integrate.h> * \code
\endcode * #include <lal/Integrate.h>
* \endcode
This header covers the routines for integrating a function. *
* This header covers the routines for integrating a function.
\heading{Description} *
* ### Description ###
The routine \c LALSRombergIntegrate() performs the integral specified by th *
e * The routine \c LALSRombergIntegrate() performs the integral specified by
structure \c input and the result is returned as \c result. Any the
additional parameters (other than the integration variable \f$x\f$) can be * structure \c input and the result is returned as \c result. Any
passed * additional parameters (other than the integration variable \f$x\f$) can
as \c params. The routine \c LALSRombergIntegrate() does not use be passed
\c params but just passes it to the integrand. The routine * as \c params. The routine \c LALSRombergIntegrate() does not use
\c LALDRombergIntegrate() is the same but for double precision. * \c params but just passes it to the integrand. The routine
* \c LALDRombergIntegrate() is the same but for double precision.
\heading{Operating Instructions} *
* ### Operating Instructions ###
The following program performs the integral \f$\int_0^2F(x)dx\f$ where *
\f$F(x)=x^4\log(x+\sqrt{x^2+1})\f$. * The following program performs the integral \f$\int_0^2F(x)dx\f$ where
* \f$F(x)=x^4\log(x+\sqrt{x^2+1})\f$.
\code *
#include <math.h> * \code
#include <lal/LALStdlib.h> * #include <math.h>
#include <lal/Integrate.h> * #include <lal/LALStdlib.h>
* #include <lal/Integrate.h>
static void F( LALStatus *s, REAL4 *y, REAL4 x, void *p ) *
{ * static void F( LALStatus *s, REAL4 *y, REAL4 x, void *p )
REAL4 x2 = x*x; * {
REAL4 x4 = x2*x2; * REAL4 x2 = x*x;
INITSTATUS(s); * REAL4 x4 = x2*x2;
ASSERT( !p, s, 1, "Non-null pointer" ); * INITSTATUS(s);
*y = x4 * log( x + sqrt( x2 + 1 ) ); * ASSERT( !p, s, 1, "Non-null pointer" );
RETURN( s ); * y = x4 * log( x + sqrt( x2 + 1 ) );
} * RETURN( s );
* }
int main () *
{ * int main ()
const REAL4 epsilon = 1e-6; * {
const long double expect = 8.153364119811650205L; * const REAL4 epsilon = 1e-6;
static LALStatus status; * const long double expect = 8.153364119811650205L;
SIntegrateIn intinp; * static LALStatus status;
REAL4 result; * SIntegrateIn intinp;
* REAL4 result;
intinp.function = F; *
intinp.xmin = 0; * intinp.function = F;
intinp.xmax = 2; * intinp.xmin = 0;
intinp.type = ClosedInterval; * intinp.xmax = 2;
* intinp.type = ClosedInterval;
LALSRombergIntegrate( &status, &result, &intinp, NULL ); *
if ( fabs( result - expect ) > epsilon * fabs( expect ) ) * LALSRombergIntegrate( &status, &result, &intinp, NULL );
{ * if ( fabs( result - expect ) > epsilon * fabs( expect ) )
// integration did not achieve desired accuracy --- exit failure * {
return 1; * // integration did not achieve desired accuracy --- exit failure
} * return 1;
* }
return 0; *
} * return 0;
\endcode * }
* \endcode
\heading{Algorithm} *
* ### Algorithm ###
This is an implementation of the Romberg integrating function \c qromb in *
Numerical Recipes [\ref ptvf1992]. * This is an implementation of the Romberg integrating function \c qromb i
n
*/ * Numerical Recipes \cite ptvf1992.
*
*/
/*@{*/ /*@{*/
/** \name Error Codes */ /** \name Error Codes */
/*@{*/ /*@{*/
#define INTEGRATEH_ENULL 1 /**< Null pointer */ #define INTEGRATEH_ENULL 1 /**< Null pointer */
#define INTEGRATEH_ETYPE 2 /**< Unknown integral type */ #define INTEGRATEH_ETYPE 2 /**< Unknown integral type */
#define INTEGRATEH_EIDOM 4 /**< Invalid domain */ #define INTEGRATEH_EIDOM 4 /**< Invalid domain */
#define INTEGRATEH_EMXIT 8 /**< Maximum iterations exceeded */ #define INTEGRATEH_EMXIT 8 /**< Maximum iterations exceeded */
/*@}*/ /*@}*/
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
#define INTEGRATEH_MSGENULL "Null pointer" #define INTEGRATEH_MSGENULL "Null pointer"
#define INTEGRATEH_MSGETYPE "Unknown integral type" #define INTEGRATEH_MSGETYPE "Unknown integral type"
#define INTEGRATEH_MSGEIDOM "Invalid domain" #define INTEGRATEH_MSGEIDOM "Invalid domain"
#define INTEGRATEH_MSGEMXIT "Maximum iterations exceeded" #define INTEGRATEH_MSGEMXIT "Maximum iterations exceeded"
/** \endcond */ /** \endcond */
/** Type of integral. /**
The types of integration are the following: * Type of integral.
* The types of integration are the following:
I. \c #ClosedInterval *
indicates that the integral should be computed on equal-spaced domain * I. \c #ClosedInterval
intervals including the boundary. * indicates that the integral should be computed on equal-spaced domain
* intervals including the boundary.
II. \c #OpenInterval indicates that *
the integral should be computed on intervals of the domain not including * II. \c #OpenInterval indicates that
the * the integral should be computed on intervals of the domain not including
boundary. the
* boundary.
III. \c #SingularLowerLimit indicates that the integral *
should be evaluated on an open interval with a transformation so that a * III. \c #SingularLowerLimit indicates that the integral
inverse-square-root singularity at the lower limit can be integrated. * should be evaluated on an open interval with a transformation so that a
* inverse-square-root singularity at the lower limit can be integrated.
IV. \c #SingularUpperLimit is the same as above but for a singularity at *
the * IV. \c #SingularUpperLimit is the same as above but for a singularity at
upper limit. the
* upper limit.
V. \c #InfiniteDomainPow indicates that the integral *
should be evaluated over an semi-infinite domain---appropriate when both * V. \c #InfiniteDomainPow indicates that the integral
limits have the same sign (though one is very large) and when the integra * should be evaluated over an semi-infinite domain---appropriate when both
nd * limits have the same sign (though one is very large) and when the integr
vanishes faster than \f$x^{-1}\f$ at infinity. and
* vanishes faster than \f$x^{-1}\f$ at infinity.
VI. \c #InfiniteDomainExp *
indicates that the integral should be evaluated over an infinite domain * VI. \c #InfiniteDomainExp
starting at \c xmin and going to infinity (\c xmax is ignored)---the * indicates that the integral should be evaluated over an infinite domain
integrand should vanish exponentially for large \f$x\f$. * starting at \c xmin and going to infinity (\c xmax is ignored)---the
*/ * integrand should vanish exponentially for large \f$x\f$.
*/
typedef enum typedef enum
{ {
ClosedInterval, /**< evaluate integral on a closed interval */ ClosedInterval, /**< evaluate integral on a closed interval */
OpenInterval, /**< evaluate integral on an open interval */ OpenInterval, /**< evaluate integral on an open interval */
SingularLowerLimit, /**< integrate an inv sqrt singularity at lower limit */ SingularLowerLimit, /**< integrate an inv sqrt singularity at lower limit */
SingularUpperLimit, /**< integrate an inv sqrt singularity at upper limit */ SingularUpperLimit, /**< integrate an inv sqrt singularity at upper limit */
InfiniteDomainPow, /**< integrate infinite domain with power-law falloff */ InfiniteDomainPow, /**< integrate infinite domain with power-law falloff */
InfiniteDomainExp /**< integrate infinite domain with exponential fallo ff */ InfiniteDomainExp /**< integrate infinite domain with exponential fallo ff */
} }
IntegralType; IntegralType;
 End of changes. 2 change blocks. 
103 lines changed or deleted 106 lines changed or added


 Interpolate.h   Interpolate.h 
skipping to change at line 23 skipping to change at line 23
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with with program; see the file COPYING. If not, write to the * along with with program; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA * MA 02111-1307 USA
*/ */
#ifndef _INTERPOLATE_H #ifndef _INTERPOLATE_H
#define _INTERPOLATE_H #define _INTERPOLATE_H
#include <lal/Date.h>
#include <lal/Sequence.h>
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#include <lal/XLALGSL.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_spline.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup Interpolate_h * \addtogroup Interpolate_h
*
\brief This header covers the routines for interpolation. * \brief This header covers the routines for interpolation.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/Interpolate.h> * \code
\endcode * #include <lal/Interpolate.h>
* \endcode
\heading{Description} *
* ### Description ###
The routine <tt>LALSPolynomialInterpolation()</tt> computes the interpolate *
d \f$y\f$ * The routine <tt>LALSPolynomialInterpolation()</tt> computes the interpol
value \c output at the \f$x\f$ value \c target by fitting a polynomial of ated \f$y\f$
order <tt>params.n-1</tt> to the data. The result \c output is of type * value \c output at the \f$x\f$ value \c target by fitting a polynomial o
\c SInterpolateOut, which contains the value <tt>output.y</tt> as well as f
an estimate of the error <tt>output.dy</tt>. The routine * order <tt>params.n-1</tt> to the data. The result \c output is of type
<tt>LALDPolynomialInterpolation()</tt> is the same but for double precision * \c SInterpolateOut, which contains the value <tt>output.y</tt> as well a
. s
* an estimate of the error <tt>output.dy</tt>. The routine
\heading{Operating Instructions} * <tt>LALDPolynomialInterpolation()</tt> is the same but for double precis
ion.
The following program fits a fourth-order polynomial to the five data point *
s * ### Operating Instructions ###
\f$\{(0,0),(1,1),(2,3),(3,4),(4,3)\}\f$, and interpolates the value at \f$x *
=2.4\f$. * The following program fits a fourth-order polynomial to the five data po
ints
\code * \f$\{(0,0),(1,1),(2,3),(3,4),(4,3)\}\f$, and interpolates the value at \
#include <lal/LALStdlib.h> f$x=2.4\f$.
#include <lal/Interpolate.h> *
* \code
int main () * #include <lal/LALStdlib.h>
{ * #include <lal/Interpolate.h>
enum { ArraySize = 5 }; *
static LALStatus status; * int main ()
REAL4 x[ArraySize] = {0,1,2,3,4}; * {
REAL4 y[ArraySize] = {0,1,3,4,3}; * enum { ArraySize = 5 };
REAL4 target = 2.4; * static LALStatus status;
SInterpolatePar intpar = {ArraySize, x, y}; * REAL4 x[ArraySize] = {0,1,2,3,4};
SInterpolateOut intout; * REAL4 y[ArraySize] = {0,1,3,4,3};
* REAL4 target = 2.4;
LALSPolynomialInterpolation( &status, &intout, target, &intpar ); * SInterpolatePar intpar = {ArraySize, x, y};
* SInterpolateOut intout;
return 0; *
} * LALSPolynomialInterpolation( &status, &intout, target, &intpar );
\endcode *
* return 0;
\heading{Algorithm} * }
* \endcode
This is an implementation of the Neville algroithm, see \c polint in *
Numerical Recipes [\ref ptvf1992]. * ### Algorithm ###
*
*/ * This is an implementation of the Neville algroithm, see \c polint in
* Numerical Recipes \cite ptvf1992.
*
*/
/*@{*/ /*@{*/
/** \name Error Codes */ /** \name Error Codes */
/*@{*/ /*@{*/
#define INTERPOLATEH_ENULL 1 /**< Null pointer */ #define INTERPOLATEH_ENULL 1 /**< Null pointer */
#define INTERPOLATEH_ESIZE 2 /**< Invalid size */ #define INTERPOLATEH_ESIZE 2 /**< Invalid size */
#define INTERPOLATEH_EZERO 4 /**< Zero divide */ #define INTERPOLATEH_EZERO 4 /**< Zero divide */
/*@}*/ /*@}*/
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
skipping to change at line 112 skipping to change at line 119
/** These structures contain the output of the interpolation */ /** These structures contain the output of the interpolation */
typedef struct typedef struct
tagDInterpolateOut tagDInterpolateOut
{ {
REAL8 y; /**< The interpolated value */ REAL8 y; /**< The interpolated value */
REAL8 dy; /**< The estimated error in the interpolated value */ REAL8 dy; /**< The estimated error in the interpolated value */
} }
DInterpolateOut; DInterpolateOut;
/** These structures contain the interpolation parameters; These are the ar /**
rays * These structures contain the interpolation parameters; These are the arr
ays
* of \c n domain values \f$x[0] \ldots x[n-1]\f$ and their * of \c n domain values \f$x[0] \ldots x[n-1]\f$ and their
* corresponding values \f$y[0] \ldots y[n-1]\f$ * corresponding values \f$y[0] \ldots y[n-1]\f$
*/ */
typedef struct typedef struct
tagSInterpolatePar tagSInterpolatePar
{ {
UINT4 n; /**< The number of points in the arrays to use in the interp olation */ UINT4 n; /**< The number of points in the arrays to use in the interp olation */
REAL4 *x; /**< The array of domain values */ REAL4 *x; /**< The array of domain values */
REAL4 *y; /**< The array of values to interpolate */ REAL4 *y; /**< The array of values to interpolate */
} }
SInterpolatePar; SInterpolatePar;
/** These structures contain the interpolation parameters; These are the ar /**
rays * These structures contain the interpolation parameters; These are the arr
ays
* of \c n domain values \f$x[0]\ldots x[n-1]\f$ and their * of \c n domain values \f$x[0]\ldots x[n-1]\f$ and their
* corresponding values \f$y[0]\ldots y[n-1]\f$ * corresponding values \f$y[0]\ldots y[n-1]\f$
*/ */
typedef struct typedef struct
tagDInterpolatePar tagDInterpolatePar
{ {
UINT4 n; /**< The number of points in the arrays to use in the interp olation */ UINT4 n; /**< The number of points in the arrays to use in the interp olation */
REAL8 *x; /**< The array of domain values */ REAL8 *x; /**< The array of domain values */
REAL8 *y; /**< The array of values to interpolate */ REAL8 *y; /**< The array of values to interpolate */
} }
skipping to change at line 167 skipping to change at line 176
/** \see See \ref Interpolate_h for documentation */ /** \see See \ref Interpolate_h for documentation */
REAL8 REAL8
XLALREAL8PolynomialInterpolation ( XLALREAL8PolynomialInterpolation (
REAL8 *yout, REAL8 *yout,
REAL8 xtarget, REAL8 xtarget,
REAL8 *y, REAL8 *y,
REAL8 *x, REAL8 *x,
UINT4 n UINT4 n
); );
int
XLALREAL8Interpolation (
REAL8Sequence *x_in, /* Assumed to be in ascending order */
REAL8Sequence *y_in,
REAL8Sequence *x_out,
REAL8Sequence *y_out, /* Modified in place */
UINT4 n_data_points,
const gsl_interp_type *itrp_type /* Can be NULL -- default it to cubic
spline */
);
int
XLALREAL8TimeSeriesInterpolation (
REAL8TimeSeries *ts_in,
REAL8Sequence *y_in,
REAL8Sequence *t_in,
REAL8Sequence *t_out, /* If NULL, interpolate from dt and epoch of ts_i
n */
UINT4 n_data_points,
const gsl_interp_type *itrp_type
);
/*@}*/ /*@}*/
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _INTERPOLATE_H */ #endif /* _INTERPOLATE_H */
 End of changes. 6 change blocks. 
57 lines changed or deleted 90 lines changed or added


 LALAdaptiveRungeKutta4.h   LALAdaptiveRungeKutta4.h 
skipping to change at line 17 skipping to change at line 17
#include <lal/LALGSL.h> #include <lal/LALGSL.h>
#include <lal/SeqFactories.h> #include <lal/SeqFactories.h>
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
\addtogroup LALAdaptiveRungeKutta4_h * \addtogroup LALAdaptiveRungeKutta4_h
\author Vallisneri, M. * \author Vallisneri, M.
\brief Adaptive Runge-Kutta4 * \brief Adaptive Runge-Kutta4
*
<ul> * <ul>
<li> \c integrator Integration structure (quasi-class). Created using <tt>X * <li> \c integrator Integration structure (quasi-class). Created using <t
LALAdaptiveRungeKutta4Init()</tt>. t>XLALAdaptiveRungeKutta4Init()</tt>.
...</li> * ...</li>
</ul> * </ul>
*
\heading{Description} * ### Description ###
The code \ref LALAdaptiveRungeKutta4.c evolves a system of \f$n\f$ coupled *
first--order differential equations. * The code \ref LALAdaptiveRungeKutta4.c evolves a system of \f$n\f$ coupl
Internally, it uses GSL routines to perform adaptive-step evolution, and th ed first--order differential equations.
en interpolates the resulting * Internally, it uses GSL routines to perform adaptive-step evolution, and
trajectories to a fixed step size. then interpolates the resulting
* trajectories to a fixed step size.
Prior to evolving a system using <tt>XLALAdaptiveRungeKutta4()</tt>, it is *
necessary to create an integrator structure using * Prior to evolving a system using <tt>XLALAdaptiveRungeKutta4()</tt>, it
<tt>XLALAdaptiveRungeKutta4Init()</tt>. Once you are done with the integrat is necessary to create an integrator structure using
or, free it with <tt>XLALAdaptiveRungeKutta4Free()</tt>. * <tt>XLALAdaptiveRungeKutta4Init()</tt>. Once you are done with the integ
\heading{Algorithm} rator, free it with <tt>XLALAdaptiveRungeKutta4Free()</tt>.
TBF. *
* ### Algorithm ###
\heading{Uses} *
For updated SpinTaylor waveforms. * TBF.
*
\heading{Notes} * ### Uses ###
None so far... *
* For updated SpinTaylor waveforms.
*/ *
* ### Notes ###
*
* None so far...
*
*/
/*@{*/ /*@{*/
#define XLAL_BEGINGSL \ #define XLAL_BEGINGSL \
{ \ { \
gsl_error_handler_t *saveGSLErrorHandler_; \ gsl_error_handler_t *saveGSLErrorHandler_; \
XLALGSL_PTHREAD_MUTEX_LOCK; \ XLALGSL_PTHREAD_MUTEX_LOCK; \
saveGSLErrorHandler_ = gsl_set_error_handler_off(); saveGSLErrorHandler_ = gsl_set_error_handler_off();
#define XLAL_ENDGSL \ #define XLAL_ENDGSL \
gsl_set_error_handler( saveGSLErrorHandler_ ); \ gsl_set_error_handler( saveGSLErrorHandler_ ); \
 End of changes. 1 change blocks. 
31 lines changed or deleted 36 lines changed or added


 LALAtomicDatatypes.h   LALAtomicDatatypes.h 
skipping to change at line 20 skipping to change at line 20
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with with program; see the file COPYING. If not, write to the * along with with program; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA * MA 02111-1307 USA
*/ */
// ---------- SEE LALDatatypes.dox for doxygen documentation ---------- /* ---------- SEE LALDatatypes.dox for doxygen documentation ---------- */
#ifndef _LALATOMICDATATYPES_H #ifndef _LALATOMICDATATYPES_H
#define _LALATOMICDATATYPES_H #define _LALATOMICDATATYPES_H
#include <stdint.h> #include <stdint.h>
#include <lal/LALConfig.h>
#ifndef LAL_USE_OLD_COMPLEX_STRUCTS /* macros for certain keywords */
#if defined(__cplusplus) #if __STDC_VERSION__ >= 199901L
#include <complex> # define _LAL_RESTRICT_ restrict
# define _LAL_INLINE_ inline
#elif defined __GNUC__
# define _LAL_RESTRICT_ __restrict__
# define _LAL_INLINE_ __inline__
#else #else
#include <complex.h> # define _LAL_RESTRICT_
# define _LAL_INLINE_
#endif #endif
#endif /* LAL_USE_OLD_COMPLEX_STRUCTS */
#include <lal/LALConfig.h>
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** \addtogroup LALDatatypes */ /*@{*/ /** \addtogroup LALDatatypes */ /*@{*/
typedef char CHAR; /**< One-byte signed integer, see \ref LALDa tatypes for more details */ typedef char CHAR; /**< One-byte signed integer, see \ref LALDa tatypes for more details */
skipping to change at line 72 skipping to change at line 75
/* Integer types */ /* Integer types */
typedef int16_t INT2; /**< Two-byte signed integer */ typedef int16_t INT2; /**< Two-byte signed integer */
typedef int32_t INT4; /**< Four-byte signed integer. */ typedef int32_t INT4; /**< Four-byte signed integer. */
typedef int64_t INT8; /**< Eight-byte signed integer; on some plat forms this is equivalent to <tt>long int</tt> instead. */ typedef int64_t INT8; /**< Eight-byte signed integer; on some plat forms this is equivalent to <tt>long int</tt> instead. */
typedef uint16_t UINT2; /**< Two-byte unsigned integer. */ typedef uint16_t UINT2; /**< Two-byte unsigned integer. */
typedef uint32_t UINT4; /**< Four-byte unsigned integer. */ typedef uint32_t UINT4; /**< Four-byte unsigned integer. */
typedef uint64_t UINT8; /**< Eight-byte unsigned integer; on some platforms this is equivalent to <tt>unsigned long int</tt> instead. * / typedef uint64_t UINT8; /**< Eight-byte unsigned integer; on some platforms this is equivalent to <tt>unsigned long int</tt> instead. * /
/* Macros for integer constants */ /* Macros for integer constants */
/** \def LAL_INT8_C(v) (v ## LL) /**
* \def LAL_INT8_C(v) (v ## LL)
* \brief Macro for use in defining \a v as an INT8 constant. * \brief Macro for use in defining \a v as an INT8 constant.
* *
* This macro affixes the appropriate qualifier to form an INT8 constant. * This macro affixes the appropriate qualifier to form an INT8 constant.
* For example: * For example:
* \code * \code
* const INT8 jan_1_2000_gps_nanosec = LAL_INT8_C(63072001300000000) * const INT8 jan_1_2000_gps_nanosec = LAL_INT8_C(63072001300000000)
* \endcode * \endcode
*/ */
#define LAL_INT8_C INT64_C #define LAL_INT8_C INT64_C
/** \def LAL_UINT8_C(v) (v ## ULL) /**
* \def LAL_UINT8_C(v) (v ## ULL)
* \brief Macro for use in defining \a v as an UINT8 constant. * \brief Macro for use in defining \a v as an UINT8 constant.
* *
* This macro affixes the appropriate qualifier to form an UINT8 constant. * This macro affixes the appropriate qualifier to form an UINT8 constant.
* For example: * For example:
* \code * \code
* const UINT8 jan_1_2000_gps_nanosec = LAL_UINT8_C(63072001300000000) * const UINT8 jan_1_2000_gps_nanosec = LAL_UINT8_C(63072001300000000)
* \endcode * \endcode
*/ */
#define LAL_UINT8_C UINT64_C #define LAL_UINT8_C UINT64_C
/* Real types */ /* Real types */
typedef float REAL4; /**< Single precision real floating-point number (4 bytes). */ typedef float REAL4; /**< Single precision real floating-point number (4 bytes). */
typedef double REAL8; /**< Double precision real floating-point number (8 bytes). */ typedef double REAL8; /**< Double precision real floating-point number (8 bytes). */
/* Complex types */
#ifndef SWIG /* exclude from SWIG interface */ #ifndef SWIG /* exclude from SWIG interface */
#ifndef LAL_USE_OLD_COMPLEX_STRUCTS /* Use C99 complex numbers where available: C99, gcc with non-ANSI extensio
ns */
/* Complex types */ #if !defined(__cplusplus)
#if defined(__cplusplus) # if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && !defined(__STRICT
typedef std::complex<float> COMPLEX8; _ANSI__))
typedef std::complex<double> COMPLEX16; # define _LAL_C99_COMPLEX_NUMBERS_
#else # endif
typedef float complex COMPLEX8; /**< Single-precision floating-point co
mplex number (8 bytes total) */
typedef double complex COMPLEX16; /**< Double-precision floating-point co
mplex number (16 bytes total) */
#endif #endif
/* Complex type constructors */ #ifdef _LAL_C99_COMPLEX_NUMBERS_
#if !defined(__cplusplus)
#include <complex.h>
typedef float complex COMPLEX8; /**< Single-precision floating-point
complex number (8 bytes total) */
typedef double complex COMPLEX16; /**< Double-precision floating-point
complex number (16 bytes total) */
#define crectf(re, im) (((REAL4)(re)) + _Complex_I*((REAL4)(im))) /**< Construct a COMPLEX8 from real and imaginary parts */ #define crectf(re, im) (((REAL4)(re)) + _Complex_I*((REAL4)(im))) /**< Construct a COMPLEX8 from real and imaginary parts */
#define crect(re, im) (((REAL8)(re)) + _Complex_I*((REAL8)(im))) /**< Construct a COMPLEX16 from real and imaginary parts */ #define crect(re, im) (((REAL8)(re)) + _Complex_I*((REAL8)(im))) /**< Construct a COMPLEX16 from real and imaginary parts */
#define cpolarf(r, th) (((REAL4)(r)) * cexpf(crectf(0, th))) /**< Construct a COMPLEX8 from polar modulus and argument */ #define cpolarf(r, th) (((REAL4)(r)) * cexpf(crectf(0, th))) /**< Construct a COMPLEX8 from polar modulus and argument */
#define cpolar(r, th) (((REAL8)(r)) * cexp(crect(0, th))) /**< Construct a COMPLEX16 from polar modulus and argument */ #define cpolar(r, th) (((REAL8)(r)) * cexp(crect(0, th))) /**< Construct a COMPLEX16 from polar modulus and argument */
#endif
#else /* LAL_USE_OLD_COMPLEX_STRUCTS */
#else /* !_LAL_C99_COMPLEX_NUMBERS_ */
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
/* Old LAL complex structs, being phased out ... */
typedef struct tagCOMPLEX8 { REAL4 realf_FIXME; REAL4 imagf_FIXME; } COMPLE
X8;
#define crealf(z) ((z).realf_FIXME)
#define cimagf(z) ((z).imagf_FIXME)
typedef struct tagCOMPLEX16 { REAL8 real_FIXME; REAL8 imag_FIXME; } COMPLEX
16;
#define creal(z) ((z).real_FIXME)
#define cimag(z) ((z).imag_FIXME)
/** \endcond */
#endif /* LAL_USE_OLD_COMPLEX_STRUCTS */ /**************************************************************************
**/
/* Fall back to GSL complex number types if C99 complex numbers are not
*/
/* available. GSL complex numbers are implemented as a struct containing
*/
/* an array of 2 elements of the corresponding real type. The C99 standard
*/
/* should guarantee that GSL complex numbers are binary-compatible with C99
*/
/* complex numbers; 6.2.5 point 13 of the standard states that C99 complex
*/
/* numbers are equivalent to an array of 2 elements of the corresponding
*/
/* real type, and 6.7.2.1 point 13 states that padding is never added to
*/
/* the beginning of a struct.
*/
/**************************************************************************
**/
#include <math.h>
#include <gsl/gsl_complex.h>
typedef gsl_complex_float COMPLEX8;
typedef gsl_complex COMPLEX16;
static _LAL_INLINE_ COMPLEX8 crectf(const REAL4 re, const REAL4 im);
static _LAL_INLINE_ COMPLEX8 crectf(const REAL4 re, const REAL4 im) {
COMPLEX8 z; GSL_SET_COMPLEX(&z, re, im); return z;
}
static _LAL_INLINE_ COMPLEX16 crect(const REAL8 re, const REAL8 im);
static _LAL_INLINE_ COMPLEX16 crect(const REAL8 re, const REAL8 im) {
COMPLEX16 z; GSL_SET_COMPLEX(&z, re, im); return z;
}
static _LAL_INLINE_ COMPLEX8 cpolarf(const REAL4 r, const REAL4 th);
static _LAL_INLINE_ COMPLEX8 cpolarf(const REAL4 r, const REAL4 th) {
COMPLEX8 z; GSL_SET_COMPLEX(&z, r*cos(th), r*sin(th)); return z;
}
static _LAL_INLINE_ COMPLEX16 cpolar(const REAL8 r, const REAL8 th);
static _LAL_INLINE_ COMPLEX16 cpolar(const REAL8 r, const REAL8 th) {
COMPLEX16 z; GSL_SET_COMPLEX(&z, r*cos(th), r*sin(th)); return z;
}
#define crealf(z) GSL_REAL(z)
#define cimagf(z) GSL_IMAG(z)
#define creal(z) GSL_REAL(z)
#define cimag(z) GSL_IMAG(z)
/*@}*/ /** \endcond */
#endif /* _LAL_C99_COMPLEX_NUMBERS_ */
#endif /* SWIG */ #endif /* SWIG */
/*@}*/
#if 0 #if 0
{ /* so that editors will match succeeding brace */ { /* so that editors will match succeeding brace */
#elif defined(__cplusplus) #elif defined(__cplusplus)
} }
#endif #endif
#endif /* _LALATOMICDATATYPES_H */ #endif /* _LALATOMICDATATYPES_H */
 End of changes. 16 change blocks. 
38 lines changed or deleted 85 lines changed or added


 LALCache.h   LALCache.h 
skipping to change at line 20 skipping to change at line 20
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with with program; see the file COPYING. If not, write to the * along with with program; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA * MA 02111-1307 USA
*/ */
/** \file /**
* \file
* \ingroup support * \ingroup support
* \author Creighton, J. D. E. * \author Creighton, J. D. E.
* \date 2007 * \date 2007
* \brief This header covers routines to create and manipulate LALCache * \brief This header covers routines to create and manipulate LALCache
* structures and to read LAL cache files. * structures and to read LAL cache files.
* *
*/ */
#ifndef _LALCACHE_H_ #ifndef _LALCACHE_H_
#define _LALCACHE_H_ #define _LALCACHE_H_
skipping to change at line 77 skipping to change at line 78
/** Returns a new LALCache structure that is the merge of two. */ /** Returns a new LALCache structure that is the merge of two. */
LALCache *XLALCacheMerge(const LALCache * cache1, const LALCache * cache2); LALCache *XLALCacheMerge(const LALCache * cache1, const LALCache * cache2);
/** Reads a LAL cache file and produces a LALCache structure. */ /** Reads a LAL cache file and produces a LALCache structure. */
LALCache *XLALCacheFileRead(LALFILE * fp); LALCache *XLALCacheFileRead(LALFILE * fp);
/** Reads a LAL cache file and produces a LALCache structure. */ /** Reads a LAL cache file and produces a LALCache structure. */
LALCache *XLALCacheImport(const char *fname); LALCache *XLALCacheImport(const char *fname);
/** Globs a directory and construct LALCache from matching entries. /**
* Globs a directory and construct LALCache from matching entries.
* \param [in] dirstr Colon-delimited list of directories. * \param [in] dirstr Colon-delimited list of directories.
* \param [in] fnptrn Glob pattern for matching files. * \param [in] fnptrn Glob pattern for matching files.
* \returns LALCache structure. * \returns LALCache structure.
*/ */
LALCache *XLALCacheGlob(const char *dirstr, const char *fnptrn); LALCache *XLALCacheGlob(const char *dirstr, const char *fnptrn);
/** Writes a LALCache structure to output LALFILE. */ /** Writes a LALCache structure to output LALFILE. */
int XLALCacheFileWrite(LALFILE * fp, const LALCache * cache); int XLALCacheFileWrite(LALFILE * fp, const LALCache * cache);
/** Exports a LALCache structure to an output LAL cache file. */ /** Exports a LALCache structure to an output LAL cache file. */
int XLALCacheExport(const LALCache * cache, const char *filename); int XLALCacheExport(const LALCache * cache, const char *filename);
/** Sorts entries in a LALCache structure. */ /** Sorts entries in a LALCache structure. */
int XLALCacheSort(LALCache * cache); int XLALCacheSort(LALCache * cache);
/** Prunes duplicate entries keeping the second one; cache is reduced in /**
* Prunes duplicate entries keeping the second one; cache is reduced in
* length if there are. Entries are duplicates if their metadata are * length if there are. Entries are duplicates if their metadata are
* the same (even if the urls are different */ * the same (even if the urls are different
*/
int XLALCacheUniq(LALCache * cache); int XLALCacheUniq(LALCache * cache);
/** Selects only matching entries in a LALCache structure -- other entries /**
* Selects only matching entries in a LALCache structure -- other entries
* are deleted from the LALCache structure. * are deleted from the LALCache structure.
* \param cache *UNDOCUMENTED* * \param cache *UNDOCUMENTED*
* \param t0 Remove entries ending before t0 (0 to disable). * \param t0 Remove entries ending before t0 (0 to disable).
* \param t1 Remove entries ending after t1 (0 to disable). * \param t1 Remove entries ending after t1 (0 to disable).
* \param srcregex Regular expression to match src field (NULL to disable). * \param srcregex Regular expression to match src field (NULL to disable).
* \param dscregex Regular expression to match dsc field (NULL to disable). * \param dscregex Regular expression to match dsc field (NULL to disable).
* \param urlregex Regular expression to match url field (NULL to disable). * \param urlregex Regular expression to match url field (NULL to disable).
*/ */
int XLALCacheSieve(LALCache * cache, INT4 t0, INT4 t1, int XLALCacheSieve(LALCache * cache, INT4 t0, INT4 t1,
const char *srcregex, const char *dscregex, const char *srcregex, const char *dscregex,
const char *urlregex); const char *urlregex);
/** Finds the first entry that contains the requested time, or the first en /**
try * Finds the first entry that contains the requested time, or the first ent
ry
* after the time if the time is in a gap or before the first entry. Retur ns * after the time if the time is in a gap or before the first entry. Retur ns
* NULL if the time is after the last entry. * NULL if the time is after the last entry.
*/ */
LALCacheEntry *XLALCacheEntrySeek(const LALCache * cache, double t); LALCacheEntry *XLALCacheEntrySeek(const LALCache * cache, double t);
/** Open a file identified by an entry in a LALCache structure. */ /** Open a file identified by an entry in a LALCache structure. */
LALFILE *XLALCacheEntryOpen(const LALCacheEntry * entry); LALFILE *XLALCacheEntryOpen(const LALCacheEntry * entry);
#if 0 #if 0
{ /* to match succeding brace */ { /* to match succeding brace */
 End of changes. 6 change blocks. 
7 lines changed or deleted 13 lines changed or added


 LALConfig.h   LALConfig.h 
/* include/lal/LALConfig.h. Generated from LALConfig.h.in by configure. * / /* include/lal/LALConfig.h. Generated from LALConfig.h.in by configure. * /
/* only include this file if LAL's config.h has not been included */ /* only include this file if LAL's config.h has not been included */
#ifndef CONFIG_H__LAL #ifndef LAL_VERSION
#ifndef _LALCONFIG_H
#define _LALCONFIG_H
/* LAL Version */ /* LAL Version */
#define LAL_VERSION "6.11.0" #define LAL_VERSION "6.12.0"
/* LAL Version Major Number */ /* LAL Version Major Number */
#define LAL_VERSION_MAJOR 6 #define LAL_VERSION_MAJOR 6
/* LAL Version Minor Number */ /* LAL Version Minor Number */
#define LAL_VERSION_MINOR 11 #define LAL_VERSION_MINOR 12
/* LAL Version Micro Number */ /* LAL Version Micro Number */
#define LAL_VERSION_MICRO 0 #define LAL_VERSION_MICRO 0
/* LAL Version Devel Number */ /* LAL Version Devel Number */
#define LAL_VERSION_DEVEL 0 #define LAL_VERSION_DEVEL 0
/* LAL Configure Arguments */ /* LAL Configure Arguments */
#define LAL_CONFIGURE_ARGS " '--enable-shared' '--prefix=/home/ut/testing/l al/6.11.0' '--exec-prefix=/home/ut/testing/lal/6.11.0' '--sysconfdir=/home/ ut/testing/lal/6.11.0' '--datadir=/home/ut/testing/lal/6.11.0/share' 'CFLAG S=-w -fpermissive' 'CXXFLAGS=-w -fpermissive'" #define LAL_CONFIGURE_ARGS " '--enable-shared' '--prefix=/home/ut/testing/l al/6.12.0' '--exec-prefix=/home/ut/testing/lal/6.12.0' '--sysconfdir=/home/ ut/testing/lal/6.12.0' '--datadir=/home/ut/testing/lal/6.12.0/share' 'CFLAG S=-w -fpermissive' 'CXXFLAGS=-w -fpermissive'"
/* LAL Configure Date */ /* LAL Configure Date */
#define LAL_CONFIGURE_DATE "2013-06-28T04:11:52+0400" #define LAL_CONFIGURE_DATE "2014-01-10T03:03:47+0400"
/* Suppress debugging code */ /* Suppress debugging code */
/* #undef LAL_NDEBUG */ /* #undef LAL_NDEBUG */
/* Use functions rather than macros */ /* Use functions rather than macros */
/* #undef NOLALMACROS */ /* #undef NOLALMACROS */
/* Use pthread mutex lock for threadsafety */ /* Use pthread mutex lock for threadsafety */
/* #undef LAL_PTHREAD_LOCK */ /* #undef LAL_PTHREAD_LOCK */
skipping to change at line 50 skipping to change at line 47
/* Define if using boinc library */ /* Define if using boinc library */
/* #undef LAL_BOINC_ENABLED */ /* #undef LAL_BOINC_ENABLED */
/* Define if using CUDA library */ /* Define if using CUDA library */
/* #undef LAL_CUDA_ENABLED */ /* #undef LAL_CUDA_ENABLED */
/* Define if using qthread library */ /* Define if using qthread library */
/* #undef LAL_QTHREAD */ /* #undef LAL_QTHREAD */
#endif /* _LALCONFIG_H */ #endif /* LAL_VERSION */
#endif /* CONFIG_H__LAL */
 End of changes. 6 change blocks. 
8 lines changed or deleted 5 lines changed or added


 LALConstants.h   LALConstants.h 
skipping to change at line 44 skipping to change at line 44
*/ */
/*@{*/ /*@{*/
#ifndef _LALCONSTANTS_H #ifndef _LALCONSTANTS_H
#define _LALCONSTANTS_H #define _LALCONSTANTS_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** \name Floating-point constants /**
* \name Floating-point constants
* The following constants define the precision and range of * The following constants define the precision and range of
* floating-point arithmetic in LAL. They are taken from the IEEE * floating-point arithmetic in LAL. They are taken from the IEEE
* standard 754 for binary arithmetic. All numbers are dimensionless. */ * standard 754 for binary arithmetic. All numbers are dimensionless.
*/
/*@{*/ /*@{*/
#define LAL_REAL4_MANT 24 /**< Bits of precision in the mantissa of a REAL4 */ #define LAL_REAL4_MANT 24 /**< Bits of precision in the mantissa of a REAL4 */
#define LAL_REAL4_MAX 3.40282347e+38 /**< Largest REAL4 */ #define LAL_REAL4_MAX 3.40282347e+38 /**< Largest REAL4 */
#define LAL_REAL4_MIN 1.17549435e-38 /**< Smallest nonzero REAL4 */ #define LAL_REAL4_MIN 1.17549435e-38 /**< Smallest nonzero REAL4 */
#define LAL_REAL4_EPS 1.19209290e-07 /**< 0.5^(LAL_REAL4_MANT-1), ie the di fference between 1 and the next resolveable REAL4 */ #define LAL_REAL4_EPS 1.19209290e-07 /**< 0.5^(LAL_REAL4_MANT-1), ie the di fference between 1 and the next resolveable REAL4 */
#define LAL_REAL8_MANT 53 /**< Bits of precision in the mantissa of a REAL8 */ #define LAL_REAL8_MANT 53 /**< Bits of precision in the mantissa of a REAL8 */
#define LAL_REAL8_MAX 1.7976931348623157e+308 /**< Largest REAL8 */ #define LAL_REAL8_MAX 1.7976931348623157e+308 /**< Largest REAL8 */
#define LAL_REAL8_MIN 2.2250738585072014e-308 /**< Smallest nonzero REAL8 * / #define LAL_REAL8_MIN 2.2250738585072014e-308 /**< Smallest nonzero REAL8 * /
#define LAL_REAL8_EPS 2.2204460492503131e-16 /**< 0.5^(LAL_REAL8_MANT-1), ie the difference between 1 and the next resolveable REAL8 */ #define LAL_REAL8_EPS 2.2204460492503131e-16 /**< 0.5^(LAL_REAL8_MANT-1), ie the difference between 1 and the next resolveable REAL8 */
/*@}*/ /*@}*/
/** \name Mathematical constants /**
* \name Mathematical constants
* The following are fundamental mathematical constants. They are mostly * The following are fundamental mathematical constants. They are mostly
* taken from the GNU C <tt>math.h</tt> header (with the exception of * taken from the GNU C <tt>math.h</tt> header (with the exception of
* <tt>LAL_TWOPI</tt>, which was computed using Maple). All numbers are * <tt>LAL_TWOPI</tt>, which was computed using Maple). All numbers are
* dimensionless. The value of exp(gamma) is taken from * dimensionless. The value of exp(gamma) is taken from
* http://www.research.att.com/~njas/sequences/A073004 */ * http://www.research.att.com/~njas/sequences/A073004
*/
/*@{*/ /*@{*/
#define LAL_E 2.7182818284590452353602874713526625 /**< e */ #define LAL_E 2.7182818284590452353602874713526625 /**< e */
#define LAL_LOG2E 1.4426950408889634073599246810018922 /**< log_2 e */ #define LAL_LOG2E 1.4426950408889634073599246810018922 /**< log_2 e */
#define LAL_LOG10E 0.4342944819032518276511289189166051 /**< log_10 e * / #define LAL_LOG10E 0.4342944819032518276511289189166051 /**< log_10 e * /
#define LAL_LN2 0.6931471805599453094172321214581766 /**< log_e 2 */ #define LAL_LN2 0.6931471805599453094172321214581766 /**< log_e 2 */
#define LAL_LN10 2.3025850929940456840179914546843642 /**< log_e 10 * / #define LAL_LN10 2.3025850929940456840179914546843642 /**< log_e 10 * /
#define LAL_SQRT2 1.4142135623730950488016887242096981 /**< sqrt(2) */ #define LAL_SQRT2 1.4142135623730950488016887242096981 /**< sqrt(2) */
#define LAL_SQRT1_2 0.7071067811865475244008443621048490 /**< 1/sqrt(2) */ #define LAL_SQRT1_2 0.7071067811865475244008443621048490 /**< 1/sqrt(2) */
#define LAL_GAMMA 0.5772156649015328606065120900824024 /**< gamma */ #define LAL_GAMMA 0.5772156649015328606065120900824024 /**< gamma */
#define LAL_EXPGAMMA 1.7810724179901979852365041031071795 /**< exp(gamma) */ #define LAL_EXPGAMMA 1.7810724179901979852365041031071795 /**< exp(gamma) */
skipping to change at line 87 skipping to change at line 91
#define LAL_TWOPI 6.2831853071795864769252867665590058 /**< 2*pi */ #define LAL_TWOPI 6.2831853071795864769252867665590058 /**< 2*pi */
#define LAL_PI_2 1.5707963267948966192313216916397514 /**< pi/2 */ #define LAL_PI_2 1.5707963267948966192313216916397514 /**< pi/2 */
#define LAL_PI_4 0.7853981633974483096156608458198757 /**< pi/4 */ #define LAL_PI_4 0.7853981633974483096156608458198757 /**< pi/4 */
#define LAL_1_PI 0.3183098861837906715377675267450287 /**< 1/pi */ #define LAL_1_PI 0.3183098861837906715377675267450287 /**< 1/pi */
#define LAL_2_PI 0.6366197723675813430755350534900574 /**< 2/pi */ #define LAL_2_PI 0.6366197723675813430755350534900574 /**< 2/pi */
#define LAL_2_SQRTPI 1.1283791670955125738961589031215452 /**< 2/sqrt(pi) */ #define LAL_2_SQRTPI 1.1283791670955125738961589031215452 /**< 2/sqrt(pi) */
#define LAL_PI_180 1.7453292519943295769236907684886127e-2 /**< pi/180 * / #define LAL_PI_180 1.7453292519943295769236907684886127e-2 /**< pi/180 * /
#define LAL_180_PI 57.295779513082320876798154814105170 /**< 180/pi */ #define LAL_180_PI 57.295779513082320876798154814105170 /**< 180/pi */
/*@}*/ /*@}*/
/** \name Exact physical constants /**
* \name Exact physical constants
* The following physical constants are defined to have exact values. * The following physical constants are defined to have exact values.
* The values of \f$c\f$ and \f$g\f$ are taken from \ref Barnet_1996, * The values of \f$c\f$ and \f$g\f$ are taken from \cite Barnet_1996,
* \f$p_\mathrm{atm}\f$ is from \ref Lang_1992, while \f$\epsilon_0\f$ and * \f$p_\mathrm{atm}\f$ is from \cite Lang_1992, while \f$\epsilon_0\f$ and
* \f$\mu_0\f$ are computed from \f$c\f$ using exact formulae. The use * \f$\mu_0\f$ are computed from \f$c\f$ using exact formulae. The use
* of a Julian year (365.25 days) as standard is specified by the IAU. * of a Julian year (365.25 days) as standard is specified by the IAU.
* They are given in the SI units shown. */ * They are given in the SI units shown.
*/
/*@{*/ /*@{*/
#define LAL_C_SI 299792458 /**< Speed of light in vacuo, m s^-1 */ #define LAL_C_SI 299792458 /**< Speed of light in vacuo, m s^-1 */
#define LAL_EPSILON0_SI 8.8541878176203898505365630317107503e-12 /**< Perm ittivity of free space, C^2 N^-1 m^-2 */ #define LAL_EPSILON0_SI 8.8541878176203898505365630317107503e-12 /**< Perm ittivity of free space, C^2 N^-1 m^-2 */
#define LAL_MU0_SI 1.2566370614359172953850573533118012e-6 /**< Permeabi lity of free space, N A^-2 */ #define LAL_MU0_SI 1.2566370614359172953850573533118012e-6 /**< Permeabi lity of free space, N A^-2 */
#define LAL_GEARTH_SI 9.80665 /**< Standard gravity, m s^-2 */ #define LAL_GEARTH_SI 9.80665 /**< Standard gravity, m s^-2 */
#define LAL_PATM_SI 101325 /**< Standard atmosphere, Pa */ #define LAL_PATM_SI 101325 /**< Standard atmosphere, Pa */
#define LAL_YRJUL_SI 31557600 /**< Julian year, s */ #define LAL_YRJUL_SI 31557600 /**< Julian year, s */
#define LAL_LYR_SI 9.4607304725808e15 /**< (Julian) Lightyear, m */ #define LAL_LYR_SI 9.4607304725808e15 /**< (Julian) Lightyear, m */
/*@}*/ /*@}*/
/** \name Physical constants /**
* \name Physical constants
* The following are measured fundamental physical constants, with values * The following are measured fundamental physical constants, with values
* given in \ref Barnet_1996. When not dimensionless, they are given * given in \cite Barnet_1996. When not dimensionless, they are given
* in the SI units shown. */ * in the SI units shown.
*/
/*@{*/ /*@{*/
#define LAL_G_SI 6.67259e-11 /**< Gravitational constant, N m^2 kg^ -2 */ #define LAL_G_SI 6.67259e-11 /**< Gravitational constant, N m^2 kg^ -2 */
#define LAL_H_SI 6.6260755e-34 /**< Planck constant, J s */ #define LAL_H_SI 6.6260755e-34 /**< Planck constant, J s */
#define LAL_HBAR_SI 1.0545726691251019773669079307477023e-34 /**< Reduced Planck constant, J s. = LAL_H_SI / LAL_TWOPI */ #define LAL_HBAR_SI 1.0545726691251019773669079307477023e-34 /**< Reduced Planck constant, J s. = LAL_H_SI / LAL_TWOPI */
#define LAL_MPL_SI 2.1767140835297016797409334934257335e-8 /**< Planck mass, kg. = sqrt{LAL_HBAR_SI * LAL_C_SI / LAL_G_SI} */ #define LAL_MPL_SI 2.1767140835297016797409334934257335e-8 /**< Planck mass, kg. = sqrt{LAL_HBAR_SI * LAL_C_SI / LAL_G_SI} */
#define LAL_LPL_SI 1.6160486159348859434398861412879278e-35 /**< Planck length, m. = sqrt{LAL_HBAR_SI * LAL_G_SI / LAL_C_SI^3} */ #define LAL_LPL_SI 1.6160486159348859434398861412879278e-35 /**< Planck length, m. = sqrt{LAL_HBAR_SI * LAL_G_SI / LAL_C_SI^3} */
#define LAL_TPL_SI 5.3905579437054615411301846068720240e-44 /**< Planck time, s. = sqrt{LAL_HBAR_SI * LAL_G_SI / LAL_C_SI^5} */ #define LAL_TPL_SI 5.3905579437054615411301846068720240e-44 /**< Planck time, s. = sqrt{LAL_HBAR_SI * LAL_G_SI / LAL_C_SI^5} */
#define LAL_K_SI 1.380658e-23 /**< Boltzmann constant, J K^-1 */ #define LAL_K_SI 1.380658e-23 /**< Boltzmann constant, J K^-1 */
#define LAL_R_SI 8.314511 /**< Ideal gas constant, J K^-1 */ #define LAL_R_SI 8.314511 /**< Ideal gas constant, J K^-1 */
#define LAL_MOL 6.0221367e23 /**< Avogadro constant, dimensionless */ #define LAL_MOL 6.0221367e23 /**< Avogadro constant, dimensionless */
skipping to change at line 132 skipping to change at line 140
#define LAL_ME_SI 9.1093897e-31 /**< Electron mass, kg */ #define LAL_ME_SI 9.1093897e-31 /**< Electron mass, kg */
#define LAL_QE_SI 1.60217733e-19 /**< Electron charge, C */ #define LAL_QE_SI 1.60217733e-19 /**< Electron charge, C */
#define LAL_ALPHA 7.297354677e-3 /**< Fine structure constant, dimensionle ss */ #define LAL_ALPHA 7.297354677e-3 /**< Fine structure constant, dimensionle ss */
#define LAL_RE_SI 2.81794092e-15 /**< Classical electron radius, m */ #define LAL_RE_SI 2.81794092e-15 /**< Classical electron radius, m */
#define LAL_LAMBDAE_SI 3.86159323e-13 /**< Electron Compton wavelength, m * / #define LAL_LAMBDAE_SI 3.86159323e-13 /**< Electron Compton wavelength, m * /
#define LAL_AB_SI 5.29177249e-11 /**< Bohr radius, m */ #define LAL_AB_SI 5.29177249e-11 /**< Bohr radius, m */
#define LAL_MUB_SI 9.27401543e-24 /**< Bohr magneton, J T^-1 */ #define LAL_MUB_SI 9.27401543e-24 /**< Bohr magneton, J T^-1 */
#define LAL_MUN_SI 5.05078658e-27 /**< Nuclear magneton, J T^-1 */ #define LAL_MUN_SI 5.05078658e-27 /**< Nuclear magneton, J T^-1 */
/*@}*/ /*@}*/
/** \name Astrophysical parameters /**
* \name Astrophysical parameters
* The following parameters are derived from measured properties of the * The following parameters are derived from measured properties of the
* Earth and Sun. The values are taken from \ref Barnet_1996, except * Earth and Sun. The values are taken from \cite Barnet_1996, except
* for the obliquity of the ecliptic plane and the eccentricity of * for the obliquity of the ecliptic plane and the eccentricity of
* Earth's orbit, which are taken from \ref Lang_1992. All values are * Earth's orbit, which are taken from \cite Lang_1992. All values are
* given in the SI units shown. Note that the ``year'' and * given in the SI units shown. Note that the ``year'' and
* ``light-year'' have exactly defined values, and appear under * ``light-year'' have exactly defined values, and appear under
* ``Exact physical constants''. * ``Exact physical constants''.
*/ */
/*@{*/ /*@{*/
#define LAL_REARTH_SI 6.378140e6 /**< Earth equatorial radius, m */ #define LAL_REARTH_SI 6.378140e6 /**< Earth equatorial radius, m */
#define LAL_AWGS84_SI 6.378137e6 /**< Semimajor axis of WGS-84 Referen ce Ellipsoid, m */ #define LAL_AWGS84_SI 6.378137e6 /**< Semimajor axis of WGS-84 Referen ce Ellipsoid, m */
#define LAL_BWGS84_SI 6.356752314e6 /**< Semiminor axis of WGS-84 Referen ce Ellipsoid, m */ #define LAL_BWGS84_SI 6.356752314e6 /**< Semiminor axis of WGS-84 Referen ce Ellipsoid, m */
#define LAL_MEARTH_SI 5.97370e24 /**< Earth mass, kg */ #define LAL_MEARTH_SI 5.97370e24 /**< Earth mass, kg */
#define LAL_IEARTH 0.409092804 /**< Earth inclination (2000), radian s */ #define LAL_IEARTH 0.409092804 /**< Earth inclination (2000), radian s */
skipping to change at line 162 skipping to change at line 171
#define LAL_MRSUN_SI 1.4766254500421874513093320107664308e3 /**< Geometri zed solar mass, m. = LAL_MSUN_SI / LAL_MPL_SI * LAL_LPL_SI */ #define LAL_MRSUN_SI 1.4766254500421874513093320107664308e3 /**< Geometri zed solar mass, m. = LAL_MSUN_SI / LAL_MPL_SI * LAL_LPL_SI */
#define LAL_MTSUN_SI 4.9254923218988636432342917247829673e-6 /**< Geometri zed solar mass, s. = LAL_MSUN_SI / LAL_MPL_SI * LAL_TPL_SI */ #define LAL_MTSUN_SI 4.9254923218988636432342917247829673e-6 /**< Geometri zed solar mass, s. = LAL_MSUN_SI / LAL_MPL_SI * LAL_TPL_SI */
#define LAL_LSUN_SI 3.846e26 /**< Solar luminosity, W */ #define LAL_LSUN_SI 3.846e26 /**< Solar luminosity, W */
#define LAL_AU_SI 1.4959787066e11 /**< Astronomical unit, m */ #define LAL_AU_SI 1.4959787066e11 /**< Astronomical unit, m */
#define LAL_PC_SI 3.0856775807e16 /**< Parsec, m */ #define LAL_PC_SI 3.0856775807e16 /**< Parsec, m */
#define LAL_YRTROP_SI 31556925.2 /**< Tropical year (1994), s */ #define LAL_YRTROP_SI 31556925.2 /**< Tropical year (1994), s */
#define LAL_YRSID_SI 31558149.8 /**< Sidereal year (1994), s */ #define LAL_YRSID_SI 31558149.8 /**< Sidereal year (1994), s */
#define LAL_DAYSID_SI 86164.09053 /**< Mean sidereal day, s */ #define LAL_DAYSID_SI 86164.09053 /**< Mean sidereal day, s */
/*@}*/ /*@}*/
/** \name Cosmological parameters /**
* \name Cosmological parameters
* The following cosmological parameters are derived from measurements of * The following cosmological parameters are derived from measurements of
* the Hubble expansion rate and of the cosmic background radiation * the Hubble expansion rate and of the cosmic background radiation
* (CBR). Data are taken from \ref Barnet_1996. In what follows, the * (CBR). Data are taken from \cite Barnet_1996. In what follows, the
* normalized Hubble constant \f$h_0\f$ is equal to the actual Hubble * normalized Hubble constant \f$h_0\f$ is equal to the actual Hubble
* constant \f$H_0\f$ divided by \f$\langle H * constant \f$H_0\f$ divided by \f$\langle H
* \rangle=100\,\mathrm{km}\,\mathrm{s}^{-1}\mathrm{Mpc}^{-1}\f$. Thus the * \rangle=100\,\mathrm{km}\,\mathrm{s}^{-1}\mathrm{Mpc}^{-1}\f$. Thus the
* Hubble constant can be written as: * Hubble constant can be written as:
* \f$H_0 = \langle H \rangle h_0\f$. * \f$H_0 = \langle H \rangle h_0\f$.
* Similarly, the critical energy density \f$\rho_c\f$ required for spatial * Similarly, the critical energy density \f$\rho_c\f$ required for spatial
* flatness is given by: \f$\rho_c = \langle\rho\rangle h_0^2\f$. * flatness is given by: \f$\rho_c = \langle\rho\rangle h_0^2\f$.
* Current estimates give \f$h_0\f$ a value of around 0.65, which is what i s * Current estimates give \f$h_0\f$ a value of around 0.65, which is what i s
* assumed below. All values are in the SI units shown. */ * assumed below. All values are in the SI units shown.
*/
/*@{*/ /*@{*/
#define LAL_H0FAC_SI 3.2407792903e-18 /**< Hubble constant prefactor, s^-1 */ #define LAL_H0FAC_SI 3.2407792903e-18 /**< Hubble constant prefactor, s^-1 */
#define LAL_H0_SI 2e-18 /**< Approximate Hubble constant, s^ -1 */ #define LAL_H0_SI 2e-18 /**< Approximate Hubble constant, s^ -1 */
/* Hubble constant H0 = h0*HOFAC, where h0 is around 0.65 */ /* Hubble constant H0 = h0*HOFAC, where h0 is around 0.65 */
#define LAL_RHOCFAC_SI 1.68860e-9 /**< Critical density prefactor, J m^-3 */ #define LAL_RHOCFAC_SI 1.68860e-9 /**< Critical density prefactor, J m^-3 */
#define LAL_RHOC_SI 7e-10 /**< Approximate critical density, J m^ -3 */ #define LAL_RHOC_SI 7e-10 /**< Approximate critical density, J m^ -3 */
/* Critical density RHOC = h0*h0*RHOCFAC, where h0 is around 0.65 */ /* Critical density RHOC = h0*h0*RHOCFAC, where h0 is around 0.65 */
#define LAL_TCBR_SI 2.726 /**< Cosmic background radiation temperature, K */ #define LAL_TCBR_SI 2.726 /**< Cosmic background radiation temperature, K */
#define LAL_VCBR_SI 3.695e5 /**< Solar velocity with respect to CBR, m s^ -1 */ #define LAL_VCBR_SI 3.695e5 /**< Solar velocity with respect to CBR, m s^ -1 */
#define LAL_RHOCBR_SI 4.177e-14 /**< Energy density of CBR, J m^-3 */ #define LAL_RHOCBR_SI 4.177e-14 /**< Energy density of CBR, J m^-3 */
 End of changes. 15 change blocks. 
17 lines changed or deleted 28 lines changed or added


 LALCorrelation.h   LALCorrelation.h 
skipping to change at line 31 skipping to change at line 31
#define _LALCORRELATION_H #define _LALCORRELATION_H
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
/* ****** INCLUDE ANY OTHER LAL HEADERS needed for header (NOT module) **** / /* ****** INCLUDE ANY OTHER LAL HEADERS needed for header (NOT module) **** /
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup LALCorrelation_h * \addtogroup LALCorrelation_h
\author Yakushin, Igor * \author Yakushin, Igor
*
\brief [One sentence briefly defining scope of the header] * \brief [One sentence briefly defining scope of the header]
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/LALCorrelation.h> * \code
\endcode * #include <lal/LALCorrelation.h>
* \endcode
[Generic documentation on the header; this is the main place to *
document any stuff not specific to the module] * [Generic documentation on the header; this is the main place to
* document any stuff not specific to the module]
*/ *
*/
/*@{*/ /*@{*/
/**\name Error Codes */ /**\name Error Codes */
/*@{*/ /*@{*/
#define LALCORRELATIONH_ENULLP 1 /**< Null pointer */ #define LALCORRELATIONH_ENULLP 1 /**< Null pointer */
#define LALCORRELATIONH_ESTART 2 /**< Time series do not start simultaneously */ #define LALCORRELATIONH_ESTART 2 /**< Time series do not start simultaneously */
#define LALCORRELATIONH_ESAMPLING 3 /**< Time series are not sampled with the same rate */ #define LALCORRELATIONH_ESAMPLING 3 /**< Time series are not sampled with the same rate */
/*@}*/ /*@}*/
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
 End of changes. 1 change blocks. 
14 lines changed or deleted 15 lines changed or added


 LALDatatypes.h   LALDatatypes.h 
skipping to change at line 20 skipping to change at line 20
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with with program; see the file COPYING. If not, write to the * along with with program; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA * MA 02111-1307 USA
*/ */
// ---------- SEE LALDatatypes.dox for doxygen documentation ---------- /* ---------- SEE LALDatatypes.dox for doxygen documentation ---------- */
#ifndef _LALDATATYPES_H #ifndef _LALDATATYPES_H
#define _LALDATATYPES_H #define _LALDATATYPES_H
#include <lal/LALAtomicDatatypes.h> #include <lal/LALAtomicDatatypes.h>
/** \addtogroup LALDatatypes *//*@{ */ /** \addtogroup LALDatatypes */ /*@{ */
/* ---------- constants ---------- */ /* ---------- constants ---------- */
/** Type size constants, see \ref LALDatatypes for more details. */ /** Type size constants, see \ref LALDatatypes for more details. */
enum { enum {
LAL_1_BYTE_TYPE_SIZE = 000, /**< One byte size 00 = 0 */ LAL_1_BYTE_TYPE_SIZE = 000, /**< One byte size 00 = 0 */
LAL_2_BYTE_TYPE_SIZE = 001, /**< Two byte size 01 = 1 */ LAL_2_BYTE_TYPE_SIZE = 001, /**< Two byte size 01 = 1 */
LAL_4_BYTE_TYPE_SIZE = 002, /**< Four byte size 010 = 2 */ LAL_4_BYTE_TYPE_SIZE = 002, /**< Four byte size 010 = 2 */
LAL_8_BYTE_TYPE_SIZE = 003, /**< Eight byte size 011 = 3 */ LAL_8_BYTE_TYPE_SIZE = 003, /**< Eight byte size 011 = 3 */
LAL_16_BYTE_TYPE_SIZE = 004, /**< Sixteen byte size 0100 = 4 */ LAL_16_BYTE_TYPE_SIZE = 004, /**< Sixteen byte size 0100 = 4 */
skipping to change at line 467 skipping to change at line 467
/** Zero-initializer for LIGOTimeGPS structs */ /** Zero-initializer for LIGOTimeGPS structs */
#define LIGOTIMEGPSZERO { 0, 0 } #define LIGOTIMEGPSZERO { 0, 0 }
#ifdef SWIG /* SWIG interface directives */ #ifdef SWIG /* SWIG interface directives */
/* *INDENT-OFF* */ /* *INDENT-OFF* */
%include <lal/lalswig_ligotimegps.i> %include <lal/lalswig_ligotimegps.i>
/* *INDENT-ON* */ /* *INDENT-ON* */
#endif /* SWIG */ #endif /* SWIG */
/** Indices of arrays corresponding to particular units. /**
* * Indices of arrays corresponding to particular units.
* The ::LALUnit structure has arrays giving the numerators * The ::LALUnit structure has arrays giving the numerators
* and denominators-minus-one of the powers of various units. * and denominators-minus-one of the powers of various units.
* These are the indices for the particular units. * These are the indices for the particular units.
*/ */
enum { enum {
LALUnitIndexMeter, /**< The meter index. */ LALUnitIndexMeter, /**< The meter index. */
LALUnitIndexKiloGram, /**< The kilogram index. */ LALUnitIndexKiloGram, /**< The kilogram index. */
LALUnitIndexSecond, /**< The second index. */ LALUnitIndexSecond, /**< The second index. */
LALUnitIndexAmpere, /**< The ampere index. */ LALUnitIndexAmpere, /**< The ampere index. */
LALUnitIndexKelvin, /**< The kelvin index. */ LALUnitIndexKelvin, /**< The kelvin index. */
LALUnitIndexStrain, /**< The strain index. */ LALUnitIndexStrain, /**< The strain index. */
LALUnitIndexADCCount, /**< The ADC counts index. */ LALUnitIndexADCCount, /**< The ADC counts index. */
LALNumUnits /**< The number of units. */ LALNumUnits /**< The number of units. */
}; };
/** This structure stores units in the mksA system (plus Kelvin, Strain, /**
* This structure stores units in the mksA system (plus Kelvin, Strain,
* and ADC Count). It also stores an overall power-of-ten scaling factor. * and ADC Count). It also stores an overall power-of-ten scaling factor.
* Thus, the units are given by * Thus, the units are given by
* \f{equation}{ * \f{equation}{
* 10^p\times\textrm{m}^{N_0/(1+D_0)}\times\textrm{kg}^{N_1/(1+D_1)} * 10^p\times\textrm{m}^{N_0/(1+D_0)}\times\textrm{kg}^{N_1/(1+D_1)}
* \times\textrm{s}^{N_2/(1+D_2)}\times\textrm{A}^{N_3/(1+D_3)} * \times\textrm{s}^{N_2/(1+D_2)}\times\textrm{A}^{N_3/(1+D_3)}
* \times\textrm{K}^{N_4/(1+D_4)}\times\textrm{strain}^{N_5/(1+D_5)} * \times\textrm{K}^{N_4/(1+D_4)}\times\textrm{strain}^{N_5/(1+D_5)}
* \times\textrm{count}^{N_6/(1+D_6)} * \times\textrm{count}^{N_6/(1+D_6)}
* \f} * \f}
* *
*/ */
skipping to change at line 931 skipping to change at line 932
/** See \ref ss_ZPGFilter for details */ /** See \ref ss_ZPGFilter for details */
typedef struct tagCOMPLEX16ZPGFilter { typedef struct tagCOMPLEX16ZPGFilter {
CHAR name[LALNameLength]; CHAR name[LALNameLength];
REAL8 deltaT; REAL8 deltaT;
COMPLEX16Vector *zeros; COMPLEX16Vector *zeros;
COMPLEX16Vector *poles; COMPLEX16Vector *poles;
COMPLEX16 gain; COMPLEX16 gain;
} COMPLEX16ZPGFilter; } COMPLEX16ZPGFilter;
/*@} */// end of LALDatatypes documentation group /*@} */ /* end of LALDatatypes documentation group */
#ifndef SWIG /* exclude from SWIG interface */ #ifndef SWIG /* exclude from SWIG interface */
/** \ingroup LALStatusMacros_h /**
* \ingroup LALStatusMacros_h
* \brief LAL status structure, see \ref ss_LALStatus for more details. * \brief LAL status structure, see \ref ss_LALStatus for more details.
*/ */
typedef struct tagLALStatus { typedef struct tagLALStatus {
INT4 statusCode; /**< A numerical code ident ifying the type of error, or 0 for nominal status; Negative values are rese rved for certain standard error types */ INT4 statusCode; /**< A numerical code ident ifying the type of error, or 0 for nominal status; Negative values are rese rved for certain standard error types */
const CHAR *statusDescription; /**< An explanatory string corresponding to the numerical status code */ const CHAR *statusDescription; /**< An explanatory string corresponding to the numerical status code */
volatile const CHAR *Id; /**< A character string ide ntifying the source file and version number of the function being reported on */ volatile const CHAR *Id; /**< A character string ide ntifying the source file and version number of the function being reported on */
const CHAR *function; /**< The name of the functi on */ const CHAR *function; /**< The name of the functi on */
const CHAR *file; /**< The name of the source file containing the function code */ const CHAR *file; /**< The name of the source file containing the function code */
INT4 line; /**< The line number in the source file where the current \c statusCode was set */ INT4 line; /**< The line number in the source file where the current \c statusCode was set */
struct tagLALStatus *statusPtr; /**< Pointer to the next no de in the list; \c NULL if this function is not reporting a subroutine erro r */ struct tagLALStatus *statusPtr; /**< Pointer to the next no de in the list; \c NULL if this function is not reporting a subroutine erro r */
 End of changes. 6 change blocks. 
7 lines changed or deleted 9 lines changed or added


 LALDetectors.h   LALDetectors.h 
skipping to change at line 29 skipping to change at line 29
#ifndef _LALDETECTORS_H #ifndef _LALDETECTORS_H
#define _LALDETECTORS_H #define _LALDETECTORS_H
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** \addtogroup LALDetectors_h /**
\author J. T. Whelan and J. D. E. Creighton * \addtogroup LALDetectors_h
* \author J. T. Whelan and J. D. E. Creighton
\brief This header defines structures to hold the basic data describing *
a gravitational wave detector. * \brief This header defines structures to hold the basic data describing
a gravitational wave detector.
\heading{Synopsis} *
\code * ### Synopsis ###
#include <lal/LALDetectors.h> *
\endcode * \code
* #include <lal/LALDetectors.h>
According to the common frame format specification * \endcode
[\ref LIGOVIRGO_2000] the geometry of an interferometric *
detector will be stored in a \c FrDetector structure, specifying * According to the common frame format specification
the location of the detector vertex and the orientation of its arms in * \cite LIGOVIRGO_2000 the geometry of an interferometric
geodetic coördinates suited to geographical surveying. Resonant * detector will be stored in a \c FrDetector structure, specifying
bars and other sorts of detectors, if they write their data to frames, * the location of the detector vertex and the orientation of its arms in
are expected to fill this structure with their location and * geodetic coördinates suited to geographical surveying. Resonant
orientation in some way suited to the detector type. * bars and other sorts of detectors, if they write their data to frames,
* are expected to fill this structure with their location and
For most data analysis tasks, however, any gravitational wave detector * orientation in some way suited to the detector type.
can be described by its location in an Earth-fixed rotating reference *
frame, as well as a <em>response tensor</em> \f$d^{ab}\f$, constant in the * For most data analysis tasks, however, any gravitational wave detector
same frame, which defines the "strain" \f$h\f$ measured by the detector in * can be described by its location in an Earth-fixed rotating reference
terms of the metric perturbation \f$h_{ab}\f$ as * frame, as well as a <em>response tensor</em> \f$d^{ab}\f$, constant in t
\f{equation}{ he
h = h_{ab} \, d^{ab} * same frame, which defines the "strain" \f$h\f$ measured by the detector
\ . in
\f} * terms of the metric perturbation \f$h_{ab}\f$ as
* \f{equation}{
This header defines a \c ::LALFrDetector structure which contains * h = h_{ab} \, d^{ab}
essentially the same information as the \c FrDetector structure, * \ .
as well as a \c LALDetector structure which contains the * \f}
Cartesian coördinates of the detector along with the components of *
the response tensor \f$d^{ab}\f$ in the same coördinate system. * This header defines a \c ::LALFrDetector structure which contains
* essentially the same information as the \c FrDetector structure,
\heading{The Geodetic Coördinate System} * as well as a \c LALDetector structure which contains the
* Cartesian coördinates of the detector along with the components of
Geodetic coördinates are spheroidal coördinates * the response tensor \f$d^{ab}\f$ in the same coördinate system.
based on the WGS-84 Earth Model, which is an *
oblate spheroid with equatorial radius \f$a=6.378137\times * ### The Geodetic Coördinate System ###
10^6\,\textrm{m}\f$ and polar radius \f$b=6.356752314\times *
10^6\,\textrm{m}\f$. Any point in space can be located according to its * Geodetic coördinates are spheroidal coördinates
longitude, latitude, and elevation. The \e longitude \f$\lambda\f$ * based on the WGS-84 Earth Model, which is an
is the angle between the half-plane bounded by the symmetry axis of * oblate spheroid with equatorial radius \f$a=6.378137\times
the reference ellipsoid containing the point in question and the * 10^6\,\textrm{m}\f$ and polar radius \f$b=6.356752314\times
half-plane plane containing the Prime Meridian; it is measured in * 10^6\,\textrm{m}\f$. Any point in space can be located according to its
radians, increases to the East, and ranges from * longitude, latitude, and elevation. The \e longitude \f$\lambda\f$
\f$-\pi\f$ to \f$\pi\f$. The \e latitude \f$\beta\f$ is the * is the angle between the half-plane bounded by the symmetry axis of
angle between the ray which is normal to the ellipsoid and passes * the reference ellipsoid containing the point in question and the
through the point in question and the equatorial plane; it is measured * half-plane plane containing the Prime Meridian; it is measured in
in radians, increases to the North, and ranges * radians, increases to the East, and ranges from
from \f$-\pi/2\f$ to \f$\pi/2\f$. The \e elevation \f$h\f$ is the * \f$-\pi\f$ to \f$\pi\f$. The \e latitude \f$\beta\f$ is the
signed distance along this ray from the reference ellipsoid to the * angle between the ray which is normal to the ellipsoid and passes
point in question. This coördinate system is described in more * through the point in question and the equatorial plane; it is measured
detail in [\ref Althouse_1999]. * in radians, increases to the North, and ranges
* from \f$-\pi/2\f$ to \f$\pi/2\f$. The \e elevation \f$h\f$ is the
\heading{Altitude and Azimuth Angles} * signed distance along this ray from the reference ellipsoid to the
* point in question. This coördinate system is described in more
The \c LALFrDetector structure stores the directions along the * detail in \cite Althouse_1999.
two arms of an interferometer in an altitude/azimuth representation *
with respect to the local tangent plane to the reference ellipsoid, * ### Altitude and Azimuth Angles ###
known as the local horizontal. The altitude \f${\mathcal{A}}\f$ is the ang *
le the * The \c LALFrDetector structure stores the directions along the
direction vector makes with the horizontal, \f${\mathcal{A}} > 0\f$ meaning * two arms of an interferometer in an altitude/azimuth representation
above * with respect to the local tangent plane to the reference ellipsoid,
horizontal, \f${\mathcal{A}} < 0\f$ below. The azimuth angle \f$\zeta\f$ i * known as the local horizontal. The altitude \f${\mathcal{A}}\f$ is the
s found by angle the
projecting the direction onto the local horizontal plane, then * direction vector makes with the horizontal, \f${\mathcal{A}} > 0\f$ mean
measuring the angle clockwise from North to this projected direction. ing above
* horizontal, \f${\mathcal{A}} < 0\f$ below. The azimuth angle \f$\zeta\f
\heading{The Cartesian Coördinate System} $ is found by
* projecting the direction onto the local horizontal plane, then
The position vector and response tensor contained in the * measuring the angle clockwise from North to this projected direction.
\c LALDetector structure are defined in *
a simple orthonormal coördinate system with its origin at * ### The Cartesian Coördinate System ###
the center of the earth, an \f$x^1\f$ axis which pierces the Earth's *
surface at the intersection of the equator and the prime meridian, an * The position vector and response tensor contained in the
\f$x^2\f$ axis which pierces the earth's surface at \f$\pi/2\f$ radians Eas * \c LALDetector structure are defined in
t * a simple orthonormal coördinate system with its origin at
longitude on the equator, and an \f$x^3\f$ axis which pierces the Earth's * the center of the earth, an \f$x^1\f$ axis which pierces the Earth's
surface at the North Pole. The coördinates \f$x^1\f$, \f$x^2\f$, \f$x^3\f * surface at the intersection of the equator and the prime meridian, an
$ * \f$x^2\f$ axis which pierces the earth's surface at \f$\pi/2\f$ radians
correspond to the Earth-fixed coördinates \f$X_E\f$, \f$Y_E\f$, \f$Z_E\f$ East
defined in [\ref Althouse_1999], respectively. * longitude on the equator, and an \f$x^3\f$ axis which pierces the Earth'
s
The relationship between geodetic and Cartesian coördinates is * surface at the North Pole. The coördinates \f$x^1\f$, \f$x^2\f$, \f$x^
given by 3\f$
\anchor tools_e_cart1 * correspond to the Earth-fixed coördinates \f$X_E\f$, \f$Y_E\f$, \f$Z_E\
\anchor tools_e_cart2 f$
\anchor tools_e_cart3 * defined in \cite Althouse_1999, respectively.
\f{align}{ *
x^1 &=\left( * The relationship between geodetic and Cartesian coördinates is
\frac{a^2}{\sqrt{a^2\cos^2\beta+b^2\sin^2\beta}} * given by
+ h * \f{align}{
\right) \cos\beta\cos\lambda \label{tools_e_cart1}\\ * \label{tools_e_cart1}
x^2 &=\left( * x^1 &=\left(
\frac{a^2}{\sqrt{a^2\cos^2\beta+b^2\sin^2\beta}} * \frac{a^2}{\sqrt{a^2\cos^2\beta+b^2\sin^2\beta}}
+ h * + h
\right) \cos\beta\sin\lambda \label{tools_e_cart2}\\ * \right) \cos\beta\cos\lambda \\
x^3 &=\left( * \label{tools_e_cart2}
\frac{b^2}{\sqrt{a^2\cos^2\beta+b^2\sin^2\beta}} * x^2 &=\left(
+ h * \frac{a^2}{\sqrt{a^2\cos^2\beta+b^2\sin^2\beta}}
\right) \sin\beta \label{tools_e_cart3} \\ * + h
\f} * \right) \cos\beta\sin\lambda \\
* \label{tools_e_cart3}
* \heading{Cached Detectors} * x^3 &=\left(
* \frac{b^2}{\sqrt{a^2\cos^2\beta+b^2\sin^2\beta}}
* + h
* \right) \sin\beta \\
* \f}
*
* ### Cached Detectors ###
* *
* In practice, we will often be * In practice, we will often be
* working with fixed unchanging site geometry, e.g., for the LIGO * working with fixed unchanging site geometry, e.g., for the LIGO
* interferometers; to avoid constantly reconstructing the corresponding * interferometers; to avoid constantly reconstructing the corresponding
* \c LALDetectors, we should define some constant * \c LALDetectors, we should define some constant
* \c LALDetectors describing them. Those are stored in a constant * \c LALDetectors describing them. Those are stored in a constant
* array of \c LALDetector structures known as * array of \c LALDetector structures known as
* \c lalCachedDetectors, which is declared \c extern in this * \c lalCachedDetectors, which is declared \c extern in this
* header and defined in \ref CreateDetector_c. * header and defined in \ref CreateDetector_c.
* *
* The <tt>LALCreateDetector()</tt> routine will first look through the * The <tt>LALCreateDetector()</tt> routine will first look through the
* \c lalCachedDetectors array for a \c LALDetector structure * \c lalCachedDetectors array for a \c LALDetector structure
* with matching \c type and <tt>frDetector.name</tt> fields; if it * with matching \c type and <tt>frDetector.name</tt> fields; if it
* finds one, it returns a copy of that; if not, it creates one. * finds one, it returns a copy of that; if not, it creates one.
* *
* For example, the \c LALDetector representing LIGO Hanford 4km (H1) in * For example, the \c LALDetector representing LIGO Hanford 4km (H1) in
* differential mode is <tt>lalCachedDetectors[LAL_LHO_4K_DETECTOR]</tt>. * differential mode is <tt>lalCachedDetectors[LAL_LHO_4K_DETECTOR]</tt>.
* *
*
*/ */
/*@{*/ /*@{*/
/** \name Error Codes */ /** \name Error Codes */
/*@{*/ /*@{*/
#define LALDETECTORSH_ENULLP 1 /**< Null pointer */ #define LALDETECTORSH_ENULLP 1 /**< Null pointer */
#define LALDETECTORSH_ETYPE 2 /**< Unsupported detector type */ #define LALDETECTORSH_ETYPE 2 /**< Unsupported detector type */
/*@}*/ /*@}*/
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
skipping to change at line 197 skipping to change at line 198
LAL_LHO_2K_DETECTOR_BIT = 1 << 2 * LAL_LHO_2K_DETECTOR , LAL_LHO_2K_DETECTOR_BIT = 1 << 2 * LAL_LHO_2K_DETECTOR ,
LAL_LHO_4K_DETECTOR_BIT = 1 << 2 * LAL_LHO_4K_DETECTOR , LAL_LHO_4K_DETECTOR_BIT = 1 << 2 * LAL_LHO_4K_DETECTOR ,
LAL_LLO_4K_DETECTOR_BIT = 1 << 2 * LAL_LLO_4K_DETECTOR , LAL_LLO_4K_DETECTOR_BIT = 1 << 2 * LAL_LLO_4K_DETECTOR ,
LAL_CIT_40_DETECTOR_BIT = 1 << 2 * LAL_CIT_40_DETECTOR , LAL_CIT_40_DETECTOR_BIT = 1 << 2 * LAL_CIT_40_DETECTOR ,
LAL_ALLEGRO_DETECTOR_BIT = 1 << 2 * LAL_ALLEGRO_DETECTO R, LAL_ALLEGRO_DETECTOR_BIT = 1 << 2 * LAL_ALLEGRO_DETECTO R,
LAL_AURIGA_DETECTOR_BIT = 1 << 2 * LAL_AURIGA_DETECTOR , LAL_AURIGA_DETECTOR_BIT = 1 << 2 * LAL_AURIGA_DETECTOR ,
LAL_NIOBE_DETECTOR_BIT = 1 << 2 * LAL_NIOBE_DETECTOR, LAL_NIOBE_DETECTOR_BIT = 1 << 2 * LAL_NIOBE_DETECTOR,
LAL_NAUTILUS_DETECTOR_BIT = 1 << 2 * LAL_NAUTILUS_DETECT OR LAL_NAUTILUS_DETECTOR_BIT = 1 << 2 * LAL_NAUTILUS_DETECT OR
}; };
/** Detector type, which determines how the detector response is determined /**
. * Detector type, which determines how the detector response is determined.
*
* Since data from bars as well as interferometers can be written to * Since data from bars as well as interferometers can be written to
* frames, we need an additional piece of information to interpret the * frames, we need an additional piece of information to interpret the
* site geometry data specified in the \c LALFrDetector * site geometry data specified in the \c LALFrDetector
* structure; for instance, is the x arm really the x arm or is it the * structure; for instance, is the x arm really the x arm or is it the
* long axis of a bar? The \c LALDetectorType enumeration * long axis of a bar? The \c LALDetectorType enumeration
* provides a way to keep track of that. * provides a way to keep track of that.
* *
*/ */
typedef enum { typedef enum {
LALDETECTORTYPE_ABSENT, /**< No FrDetector associated with t his detector */ LALDETECTORTYPE_ABSENT, /**< No FrDetector associated with t his detector */
LALDETECTORTYPE_IFODIFF, /**< IFO in differential mode */ LALDETECTORTYPE_IFODIFF, /**< IFO in differential mode */
LALDETECTORTYPE_IFOXARM, /**< IFO in one-armed mode (X arm) * / LALDETECTORTYPE_IFOXARM, /**< IFO in one-armed mode (X arm) * /
LALDETECTORTYPE_IFOYARM, /**< IFO in one-armed mode (Y arm) * / LALDETECTORTYPE_IFOYARM, /**< IFO in one-armed mode (Y arm) * /
LALDETECTORTYPE_IFOCOMM, /**< IFO in common mode */ LALDETECTORTYPE_IFOCOMM, /**< IFO in common mode */
LALDETECTORTYPE_CYLBAR /**< Cylindrical bar */ LALDETECTORTYPE_CYLBAR /**< Cylindrical bar */
} }
LALDetectorType; LALDetectorType;
/** Detector frame data structure /**
* * Detector frame data structure
* Structure to contain the data that appears in a FrDetector structure * Structure to contain the data that appears in a FrDetector structure
* in frame data. * in frame data.
*/ */
typedef struct tagLALFrDetector typedef struct tagLALFrDetector
{ {
CHAR name[LALNameLength]; /**< A unique identifying string */ CHAR name[LALNameLength]; /**< A unique identifying string */
CHAR prefix[3]; /**< Two-letter prefix for detector' s channel names */ CHAR prefix[3]; /**< Two-letter prefix for detector' s channel names */
REAL8 vertexLongitudeRadians; /**< The geodetic longitude \f$\lamb da\f$ of the vertex in radians */ REAL8 vertexLongitudeRadians; /**< The geodetic longitude \f$\lamb da\f$ of the vertex in radians */
REAL8 vertexLatitudeRadians; /**< The geodetic latitude \f$\beta\ f$ of the vertex in radians */ REAL8 vertexLatitudeRadians; /**< The geodetic latitude \f$\beta\ f$ of the vertex in radians */
REAL4 vertexElevation; /**< The height of the vertex above the reference ellipsoid in meters */ REAL4 vertexElevation; /**< The height of the vertex above the reference ellipsoid in meters */
REAL4 xArmAltitudeRadians; /**< The angle \f${\mathcal{A}}_X\f$ up from the local tangent plane of the reference ellipsoid to the X arm (o r bar's cylidrical axis) in radians */ REAL4 xArmAltitudeRadians; /**< The angle \f${\mathcal{A}}_X\f$ up from the local tangent plane of the reference ellipsoid to the X arm (o r bar's cylidrical axis) in radians */
REAL4 xArmAzimuthRadians; /**< The angle \f$\zeta_X\f$ clockwi se from North to the projection of the X arm (or bar's cylidrical axis) int o the local tangent plane of the reference ellipsoid in radians */ REAL4 xArmAzimuthRadians; /**< The angle \f$\zeta_X\f$ clockwi se from North to the projection of the X arm (or bar's cylidrical axis) int o the local tangent plane of the reference ellipsoid in radians */
REAL4 yArmAltitudeRadians; /**< The angle \f${\mathcal{A}}_Y\f$ up from the local tangent plane of the reference ellipsoid to the Y arm in radians (unused for bars: set it to zero) */ REAL4 yArmAltitudeRadians; /**< The angle \f${\mathcal{A}}_Y\f$ up from the local tangent plane of the reference ellipsoid to the Y arm in radians (unused for bars: set it to zero) */
REAL4 yArmAzimuthRadians; /**< The angle \f$\zeta_Y\f$ clockwi se from North to the projection of the Y arm into the local tangent plane o f the reference ellipsoid in radians (unused for bars: set it to zero) */ REAL4 yArmAzimuthRadians; /**< The angle \f$\zeta_Y\f$ clockwi se from North to the projection of the Y arm into the local tangent plane o f the reference ellipsoid in radians (unused for bars: set it to zero) */
REAL4 xArmMidpoint; /**< The distance to the midpoint of the X arm in meters (unused for bars: set it to zero) */ REAL4 xArmMidpoint; /**< The distance to the midpoint of the X arm in meters (unused for bars: set it to zero) */
REAL4 yArmMidpoint; /**< The distance to the midpoint of the Y arm in meters (unused for bars: set it to zero) */ REAL4 yArmMidpoint; /**< The distance to the midpoint of the Y arm in meters (unused for bars: set it to zero) */
} }
LALFrDetector; LALFrDetector;
/** Detector structure /**
* Detector structure
* *
* Structure to contain detector data in the format most easily used * Structure to contain detector data in the format most easily used
* by the LAL routines. * by the LAL routines.
*/ */
typedef struct tagLALDetector typedef struct tagLALDetector
{ {
REAL8 location[3]; /**< The three components, in an Ear th-fixed Cartesian coordinate system, of the position vector from the cente r of the Earth to the detector in meters */ REAL8 location[3]; /**< The three components, in an Ear th-fixed Cartesian coordinate system, of the position vector from the cente r of the Earth to the detector in meters */
REAL4 response[3][3]; /**< The Earth-fixed Cartesian compo nents of the detector's response tensor \f$d^{ab}\f$ */ REAL4 response[3][3]; /**< The Earth-fixed Cartesian compo nents of the detector's response tensor \f$d^{ab}\f$ */
LALDetectorType type; /**< The type of the detector (e.g., IFO in differential mode, cylindrical bar, etc.) */ LALDetectorType type; /**< The type of the detector (e.g., IFO in differential mode, cylindrical bar, etc.) */
LALFrDetector frDetector; /**< The original LALFrDetector stru cture from which this was created */ LALFrDetector frDetector; /**< The original LALFrDetector stru cture from which this was created */
skipping to change at line 263 skipping to change at line 265
extern const LALDetector lalCachedDetectors[LAL_NUM_DETECTORS]; extern const LALDetector lalCachedDetectors[LAL_NUM_DETECTORS];
/*@}*/ /*@}*/
/* Routine to create a LALDetector. */ /* Routine to create a LALDetector. */
LALDetector * XLALCreateDetector( LALDetector *detector, const LALFrDetecto r *frDetector, LALDetectorType type ); LALDetector * XLALCreateDetector( LALDetector *detector, const LALFrDetecto r *frDetector, LALDetectorType type );
void LALCreateDetector( LALStatus *status, LALDetector *output, const LALFr Detector *input, const LALDetectorType type ); void LALCreateDetector( LALStatus *status, LALDetector *output, const LALFr Detector *input, const LALDetectorType type );
/* Interferometric Detectors */ /* Interferometric Detectors */
/** \defgroup DetectorConstants Detector Constants /**
* \defgroup DetectorConstants Detector Constants
* \ingroup LALDetectors_h * \ingroup LALDetectors_h
* \brief Constants describing various gravitational wave detectors * \brief Constants describing various gravitational wave detectors
* *
* The \ref LALDetectors_h also defines numerical constants that describe t he location and * The \ref LALDetectors_h also defines numerical constants that describe t he location and
* geometry of several operating gravitational wave detectors. * geometry of several operating gravitational wave detectors.
* These detectors are both resonant mass (bar) detectors and interferometr ic * These detectors are both resonant mass (bar) detectors and interferometr ic
* detectors. * detectors.
* <ul> * <ul>
* <li> Data for the resonant mass detectors is taken from: * <li> Data for the resonant mass detectors is taken from:
* http://igec.lnl.infn.it/cgi-bin/browser.pl?Level=0,3,1 * http://igec.lnl.infn.it/cgi-bin/browser.pl?Level=0,3,1
* and [\ref FinnLazzarini_2001] * and \cite FinnLazzarini_2001
* *
* <li> Data for LIGO detectors is taken from [\ref Althouse_1999] * <li> Data for LIGO detectors is taken from \cite Althouse_1999
* *
* <li> Data for the VIRGO detector is provided by Benoit Mours. * <li> Data for the VIRGO detector is provided by Benoit Mours.
* *
* <li> Data for the GEO detector is taken from: * <li> Data for the GEO detector is taken from:
* *
* http://www.geo600.uni-hannover.de/geo600/project/location.html * http://www.geo600.uni-hannover.de/geo600/project/location.html
* *
* <li> Data for the TAMA detector is provided by Masa-Katsu Fujimoto * <li> Data for the TAMA detector is provided by Masa-Katsu Fujimoto
* *
* <li> Data for the Caltech detector is taken from [\ref Allen_1996] * <li> Data for the Caltech detector is taken from \cite Allen_1996
* </ul> * </ul>
* *
* See the technical document [\ref ABCCRW_2001] for details. * See the technical document \cite ABCCRW_2001 for details.
* *
* Data in this file (e.g., angle conventions etc.) is intended * Data in this file (e.g., angle conventions etc.) is intended
* to conform to the conventions of the Frame format specification [\ref LI GOVIRGO_2000] * to conform to the conventions of the Frame format specification \cite LI GOVIRGO_2000
* *
*/ */
/*@{*/ /*@{*/
/** \name TAMA 300m Interferometric Detector constants /**
* \name TAMA 300m Interferometric Detector constants
* The following constants describe the location and geometry of the * The following constants describe the location and geometry of the
* TAMA 300m Interferometric Detector. */ * TAMA 300m Interferometric Detector.
*/
/*@{*/ /*@{*/
#define LAL_TAMA_300_DETECTOR_NAME "TAMA_300" /**< TAMA_300 detector name string */ #define LAL_TAMA_300_DETECTOR_NAME "TAMA_300" /**< TAMA_300 detector name string */
#define LAL_TAMA_300_DETECTOR_PREFIX "T1" /**< TAMA_30 0 detector prefix string */ #define LAL_TAMA_300_DETECTOR_PREFIX "T1" /**< TAMA_30 0 detector prefix string */
#define LAL_TAMA_300_DETECTOR_LONGITUDE_RAD 2.43536359469 /**< TAMA_300 vertex longitude (rad) */ #define LAL_TAMA_300_DETECTOR_LONGITUDE_RAD 2.43536359469 /**< TAMA_300 vertex longitude (rad) */
#define LAL_TAMA_300_DETECTOR_LATITUDE_RAD 0.62267336022 /**< TAMA_300 vertex latitude (rad) */ #define LAL_TAMA_300_DETECTOR_LATITUDE_RAD 0.62267336022 /**< TAMA_300 vertex latitude (rad) */
#define LAL_TAMA_300_DETECTOR_ELEVATION_SI 90 /**< TAMA_30 0 vertex elevation (m) */ #define LAL_TAMA_300_DETECTOR_ELEVATION_SI 90 /**< TAMA_30 0 vertex elevation (m) */
#define LAL_TAMA_300_DETECTOR_ARM_X_AZIMUTH_RAD 4.71238898038 /**< TAMA_300 x arm azimuth (rad) */ #define LAL_TAMA_300_DETECTOR_ARM_X_AZIMUTH_RAD 4.71238898038 /**< TAMA_300 x arm azimuth (rad) */
#define LAL_TAMA_300_DETECTOR_ARM_Y_AZIMUTH_RAD 3.14159265359 /**< TAMA_300 y arm azimuth (rad) */ #define LAL_TAMA_300_DETECTOR_ARM_Y_AZIMUTH_RAD 3.14159265359 /**< TAMA_300 y arm azimuth (rad) */
#define LAL_TAMA_300_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< TAMA_300 x arm altitude (rad) */ #define LAL_TAMA_300_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< TAMA_300 x arm altitude (rad) */
#define LAL_TAMA_300_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< TAMA_300 y arm altitude (rad) */ #define LAL_TAMA_300_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< TAMA_300 y arm altitude (rad) */
skipping to change at line 323 skipping to change at line 328
#define LAL_TAMA_300_VERTEX_LOCATION_Y_SI 3.36625902802e+06 /**< TAMA_300 y-component of vertex location in Earth-centered frame (m ) */ #define LAL_TAMA_300_VERTEX_LOCATION_Y_SI 3.36625902802e+06 /**< TAMA_300 y-component of vertex location in Earth-centered frame (m ) */
#define LAL_TAMA_300_VERTEX_LOCATION_Z_SI 3.69915069233e+06 /**< TAMA_300 z-component of vertex location in Earth-centered frame (m ) */ #define LAL_TAMA_300_VERTEX_LOCATION_Z_SI 3.69915069233e+06 /**< TAMA_300 z-component of vertex location in Earth-centered frame (m ) */
#define LAL_TAMA_300_ARM_X_DIRECTION_X 0.64896940530 /**< TAMA_300 x-component of unit vector pointing along x arm in Earth-centered frame */ #define LAL_TAMA_300_ARM_X_DIRECTION_X 0.64896940530 /**< TAMA_300 x-component of unit vector pointing along x arm in Earth-centered frame */
#define LAL_TAMA_300_ARM_X_DIRECTION_Y 0.76081450498 /**< TAMA_300 y-component of unit vector pointing along x arm in Earth-centered frame */ #define LAL_TAMA_300_ARM_X_DIRECTION_Y 0.76081450498 /**< TAMA_300 y-component of unit vector pointing along x arm in Earth-centered frame */
#define LAL_TAMA_300_ARM_X_DIRECTION_Z -0.00000000000 /**< TAMA_300 z-component of unit vector pointing along x arm in Earth-centered frame */ #define LAL_TAMA_300_ARM_X_DIRECTION_Z -0.00000000000 /**< TAMA_300 z-component of unit vector pointing along x arm in Earth-centered frame */
#define LAL_TAMA_300_ARM_Y_DIRECTION_X -0.44371376921 /**< TAMA_300 x-component of unit vector pointing along y arm in Earth-centered frame */ #define LAL_TAMA_300_ARM_Y_DIRECTION_X -0.44371376921 /**< TAMA_300 x-component of unit vector pointing along y arm in Earth-centered frame */
#define LAL_TAMA_300_ARM_Y_DIRECTION_Y 0.37848471479 /**< TAMA_300 y-component of unit vector pointing along y arm in Earth-centered frame */ #define LAL_TAMA_300_ARM_Y_DIRECTION_Y 0.37848471479 /**< TAMA_300 y-component of unit vector pointing along y arm in Earth-centered frame */
#define LAL_TAMA_300_ARM_Y_DIRECTION_Z -0.81232223390 /**< TAMA_300 z-component of unit vector pointing along y arm in Earth-centered frame */ #define LAL_TAMA_300_ARM_Y_DIRECTION_Z -0.81232223390 /**< TAMA_300 z-component of unit vector pointing along y arm in Earth-centered frame */
/*@}*/ /*@}*/
/** \name VIRGO 3km Interferometric Detector constants /**
* \name VIRGO 3km Interferometric Detector constants
* The following constants describe the location and geometry of the * The following constants describe the location and geometry of the
* VIRGO 3km Interferometric Detector. */ * VIRGO 3km Interferometric Detector.
*/
/*@{*/ /*@{*/
#define LAL_VIRGO_DETECTOR_NAME "VIRGO" /**< VIRGO detector name string */ #define LAL_VIRGO_DETECTOR_NAME "VIRGO" /**< VIRGO detector name string */
#define LAL_VIRGO_DETECTOR_PREFIX "V1" /**< VIRGO detector prefix string */ #define LAL_VIRGO_DETECTOR_PREFIX "V1" /**< VIRGO detector prefix string */
#define LAL_VIRGO_DETECTOR_LONGITUDE_RAD 0.18333805213 /**< VIRGO v ertex longitude (rad) */ #define LAL_VIRGO_DETECTOR_LONGITUDE_RAD 0.18333805213 /**< VIRGO v ertex longitude (rad) */
#define LAL_VIRGO_DETECTOR_LATITUDE_RAD 0.76151183984 /**< VIRGO v ertex latitude (rad) */ #define LAL_VIRGO_DETECTOR_LATITUDE_RAD 0.76151183984 /**< VIRGO v ertex latitude (rad) */
#define LAL_VIRGO_DETECTOR_ELEVATION_SI 51.884 /**< VIRGO vertex el evation (m) */ #define LAL_VIRGO_DETECTOR_ELEVATION_SI 51.884 /**< VIRGO vertex el evation (m) */
#define LAL_VIRGO_DETECTOR_ARM_X_AZIMUTH_RAD 0.33916285222 /**< VIRGO x arm azimuth (rad) */ #define LAL_VIRGO_DETECTOR_ARM_X_AZIMUTH_RAD 0.33916285222 /**< VIRGO x arm azimuth (rad) */
#define LAL_VIRGO_DETECTOR_ARM_Y_AZIMUTH_RAD 5.05155183261 /**< VIRGO y arm azimuth (rad) */ #define LAL_VIRGO_DETECTOR_ARM_Y_AZIMUTH_RAD 5.05155183261 /**< VIRGO y arm azimuth (rad) */
#define LAL_VIRGO_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< VIRGO x arm altitude (rad) */ #define LAL_VIRGO_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< VIRGO x arm altitude (rad) */
#define LAL_VIRGO_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< VIRGO y arm altitude (rad) */ #define LAL_VIRGO_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< VIRGO y arm altitude (rad) */
skipping to change at line 349 skipping to change at line 356
#define LAL_VIRGO_VERTEX_LOCATION_Y_SI 8.42989697626e+05 /**< VIRGO y-component of vertex location in Earth-centered frame (m) */ #define LAL_VIRGO_VERTEX_LOCATION_Y_SI 8.42989697626e+05 /**< VIRGO y-component of vertex location in Earth-centered frame (m) */
#define LAL_VIRGO_VERTEX_LOCATION_Z_SI 4.37857696241e+06 /**< VIRGO z-component of vertex location in Earth-centered frame (m) */ #define LAL_VIRGO_VERTEX_LOCATION_Z_SI 4.37857696241e+06 /**< VIRGO z-component of vertex location in Earth-centered frame (m) */
#define LAL_VIRGO_ARM_X_DIRECTION_X -0.70045821479 /**< VIRGO x -component of unit vector pointing along x arm in Earth-centered frame */ #define LAL_VIRGO_ARM_X_DIRECTION_X -0.70045821479 /**< VIRGO x -component of unit vector pointing along x arm in Earth-centered frame */
#define LAL_VIRGO_ARM_X_DIRECTION_Y 0.20848948619 /**< VIRGO y -component of unit vector pointing along x arm in Earth-centered frame */ #define LAL_VIRGO_ARM_X_DIRECTION_Y 0.20848948619 /**< VIRGO y -component of unit vector pointing along x arm in Earth-centered frame */
#define LAL_VIRGO_ARM_X_DIRECTION_Z 0.68256166277 /**< VIRGO z -component of unit vector pointing along x arm in Earth-centered frame */ #define LAL_VIRGO_ARM_X_DIRECTION_Z 0.68256166277 /**< VIRGO z -component of unit vector pointing along x arm in Earth-centered frame */
#define LAL_VIRGO_ARM_Y_DIRECTION_X -0.05379255368 /**< VIRGO x -component of unit vector pointing along y arm in Earth-centered frame */ #define LAL_VIRGO_ARM_Y_DIRECTION_X -0.05379255368 /**< VIRGO x -component of unit vector pointing along y arm in Earth-centered frame */
#define LAL_VIRGO_ARM_Y_DIRECTION_Y -0.96908180549 /**< VIRGO y -component of unit vector pointing along y arm in Earth-centered frame */ #define LAL_VIRGO_ARM_Y_DIRECTION_Y -0.96908180549 /**< VIRGO y -component of unit vector pointing along y arm in Earth-centered frame */
#define LAL_VIRGO_ARM_Y_DIRECTION_Z 0.24080451708 /**< VIRGO z -component of unit vector pointing along y arm in Earth-centered frame */ #define LAL_VIRGO_ARM_Y_DIRECTION_Z 0.24080451708 /**< VIRGO z -component of unit vector pointing along y arm in Earth-centered frame */
/*@}*/ /*@}*/
/** \name GEO 600m Interferometric Detector constants /**
* \name GEO 600m Interferometric Detector constants
* The following constants describe the location and geometry of the * The following constants describe the location and geometry of the
* GEO 600m Interferometric Detector. */ * GEO 600m Interferometric Detector.
*/
/*@{*/ /*@{*/
#define LAL_GEO_600_DETECTOR_NAME "GEO_600" /**< GEO_600 detector name string */ #define LAL_GEO_600_DETECTOR_NAME "GEO_600" /**< GEO_600 detector name string */
#define LAL_GEO_600_DETECTOR_PREFIX "G1" /**< GEO_600 detector prefix string */ #define LAL_GEO_600_DETECTOR_PREFIX "G1" /**< GEO_600 detector prefix string */
#define LAL_GEO_600_DETECTOR_LONGITUDE_RAD 0.17116780435 /**< GEO_600 vertex longitude (rad) */ #define LAL_GEO_600_DETECTOR_LONGITUDE_RAD 0.17116780435 /**< GEO_600 vertex longitude (rad) */
#define LAL_GEO_600_DETECTOR_LATITUDE_RAD 0.91184982752 /**< GEO_600 vertex latitude (rad) */ #define LAL_GEO_600_DETECTOR_LATITUDE_RAD 0.91184982752 /**< GEO_600 vertex latitude (rad) */
#define LAL_GEO_600_DETECTOR_ELEVATION_SI 114.425 /**< GEO_600 vertex elevation (m) */ #define LAL_GEO_600_DETECTOR_ELEVATION_SI 114.425 /**< GEO_600 vertex elevation (m) */
#define LAL_GEO_600_DETECTOR_ARM_X_AZIMUTH_RAD 1.19360100484 /**< GEO_600 x arm azimuth (rad) */ #define LAL_GEO_600_DETECTOR_ARM_X_AZIMUTH_RAD 1.19360100484 /**< GEO_600 x arm azimuth (rad) */
#define LAL_GEO_600_DETECTOR_ARM_Y_AZIMUTH_RAD 5.83039279401 /**< GEO_600 y arm azimuth (rad) */ #define LAL_GEO_600_DETECTOR_ARM_Y_AZIMUTH_RAD 5.83039279401 /**< GEO_600 y arm azimuth (rad) */
#define LAL_GEO_600_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< GEO_600 x arm altitude (rad) */ #define LAL_GEO_600_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< GEO_600 x arm altitude (rad) */
#define LAL_GEO_600_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< GEO_600 y arm altitude (rad) */ #define LAL_GEO_600_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< GEO_600 y arm altitude (rad) */
skipping to change at line 375 skipping to change at line 384
#define LAL_GEO_600_VERTEX_LOCATION_Y_SI 6.66598956317e+05 /**< GEO_600 y-component of vertex location in Earth-centered frame (m) */ #define LAL_GEO_600_VERTEX_LOCATION_Y_SI 6.66598956317e+05 /**< GEO_600 y-component of vertex location in Earth-centered frame (m) */
#define LAL_GEO_600_VERTEX_LOCATION_Z_SI 5.01964141725e+06 /**< GEO_600 z-component of vertex location in Earth-centered frame (m) */ #define LAL_GEO_600_VERTEX_LOCATION_Z_SI 5.01964141725e+06 /**< GEO_600 z-component of vertex location in Earth-centered frame (m) */
#define LAL_GEO_600_ARM_X_DIRECTION_X -0.44530676905 /**< GEO_600 x-component of unit vector pointing along x arm in Earth-centered frame */ #define LAL_GEO_600_ARM_X_DIRECTION_X -0.44530676905 /**< GEO_600 x-component of unit vector pointing along x arm in Earth-centered frame */
#define LAL_GEO_600_ARM_X_DIRECTION_Y 0.86651354130 /**< GEO_600 y-component of unit vector pointing along x arm in Earth-centered frame */ #define LAL_GEO_600_ARM_X_DIRECTION_Y 0.86651354130 /**< GEO_600 y-component of unit vector pointing along x arm in Earth-centered frame */
#define LAL_GEO_600_ARM_X_DIRECTION_Z 0.22551311312 /**< GEO_600 z-component of unit vector pointing along x arm in Earth-centered frame */ #define LAL_GEO_600_ARM_X_DIRECTION_Z 0.22551311312 /**< GEO_600 z-component of unit vector pointing along x arm in Earth-centered frame */
#define LAL_GEO_600_ARM_Y_DIRECTION_X -0.62605756776 /**< GEO_600 x-component of unit vector pointing along y arm in Earth-centered frame */ #define LAL_GEO_600_ARM_Y_DIRECTION_X -0.62605756776 /**< GEO_600 x-component of unit vector pointing along y arm in Earth-centered frame */
#define LAL_GEO_600_ARM_Y_DIRECTION_Y -0.55218609524 /**< GEO_600 y-component of unit vector pointing along y arm in Earth-centered frame */ #define LAL_GEO_600_ARM_Y_DIRECTION_Y -0.55218609524 /**< GEO_600 y-component of unit vector pointing along y arm in Earth-centered frame */
#define LAL_GEO_600_ARM_Y_DIRECTION_Z 0.55058372486 /**< GEO_600 z-component of unit vector pointing along y arm in Earth-centered frame */ #define LAL_GEO_600_ARM_Y_DIRECTION_Z 0.55058372486 /**< GEO_600 z-component of unit vector pointing along y arm in Earth-centered frame */
/*@}*/ /*@}*/
/** \name LIGO Hanford Observatory 2km Interferometric Detector constants /**
* \name LIGO Hanford Observatory 2km Interferometric Detector constants
* The following constants describe the location and geometry of the * The following constants describe the location and geometry of the
* LIGO Hanford Observatory 2km Interferometric Detector. */ * LIGO Hanford Observatory 2km Interferometric Detector.
*/
/*@{*/ /*@{*/
#define LAL_LHO_2K_DETECTOR_NAME "LHO_2k" /**< LHO_2k detector name string */ #define LAL_LHO_2K_DETECTOR_NAME "LHO_2k" /**< LHO_2k detector name string */
#define LAL_LHO_2K_DETECTOR_PREFIX "H2" /**< LHO_2k detector prefix string */ #define LAL_LHO_2K_DETECTOR_PREFIX "H2" /**< LHO_2k detector prefix string */
#define LAL_LHO_2K_DETECTOR_LONGITUDE_RAD -2.08405676917 /**< LHO_2k vertex longitude (rad) */ #define LAL_LHO_2K_DETECTOR_LONGITUDE_RAD -2.08405676917 /**< LHO_2k vertex longitude (rad) */
#define LAL_LHO_2K_DETECTOR_LATITUDE_RAD 0.81079526383 /**< LHO_2k vertex latitude (rad) */ #define LAL_LHO_2K_DETECTOR_LATITUDE_RAD 0.81079526383 /**< LHO_2k vertex latitude (rad) */
#define LAL_LHO_2K_DETECTOR_ELEVATION_SI 142.554 /**< LHO_2k vertex elevation (m) */ #define LAL_LHO_2K_DETECTOR_ELEVATION_SI 142.554 /**< LHO_2k vertex elevation (m) */
#define LAL_LHO_2K_DETECTOR_ARM_X_AZIMUTH_RAD 5.65487724844 /**< LHO_2k x arm azimuth (rad) */ #define LAL_LHO_2K_DETECTOR_ARM_X_AZIMUTH_RAD 5.65487724844 /**< LHO_2k x arm azimuth (rad) */
#define LAL_LHO_2K_DETECTOR_ARM_Y_AZIMUTH_RAD 4.08408092164 /**< LHO_2k y arm azimuth (rad) */ #define LAL_LHO_2K_DETECTOR_ARM_Y_AZIMUTH_RAD 4.08408092164 /**< LHO_2k y arm azimuth (rad) */
#define LAL_LHO_2K_DETECTOR_ARM_X_ALTITUDE_RAD -0.00061950000 /**< LHO_2k x arm altitude (rad) */ #define LAL_LHO_2K_DETECTOR_ARM_X_ALTITUDE_RAD -0.00061950000 /**< LHO_2k x arm altitude (rad) */
#define LAL_LHO_2K_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00001250000 /**< LHO_2k y arm altitude (rad) */ #define LAL_LHO_2K_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00001250000 /**< LHO_2k y arm altitude (rad) */
skipping to change at line 401 skipping to change at line 412
#define LAL_LHO_2K_VERTEX_LOCATION_Y_SI -3.83469517889e+06 /**< LHO_2k y-component of vertex location in Earth-centered frame (m) */ #define LAL_LHO_2K_VERTEX_LOCATION_Y_SI -3.83469517889e+06 /**< LHO_2k y-component of vertex location in Earth-centered frame (m) */
#define LAL_LHO_2K_VERTEX_LOCATION_Z_SI 4.60035022664e+06 /**< LHO_2k z-component of vertex location in Earth-centered frame (m) */ #define LAL_LHO_2K_VERTEX_LOCATION_Z_SI 4.60035022664e+06 /**< LHO_2k z-component of vertex location in Earth-centered frame (m) */
#define LAL_LHO_2K_ARM_X_DIRECTION_X -0.22389266154 /**< LHO_2k x-component of unit vector pointing along x arm in Earth-centered f rame */ #define LAL_LHO_2K_ARM_X_DIRECTION_X -0.22389266154 /**< LHO_2k x-component of unit vector pointing along x arm in Earth-centered f rame */
#define LAL_LHO_2K_ARM_X_DIRECTION_Y 0.79983062746 /**< LHO_2k y-component of unit vector pointing along x arm in Earth-centered f rame */ #define LAL_LHO_2K_ARM_X_DIRECTION_Y 0.79983062746 /**< LHO_2k y-component of unit vector pointing along x arm in Earth-centered f rame */
#define LAL_LHO_2K_ARM_X_DIRECTION_Z 0.55690487831 /**< LHO_2k z-component of unit vector pointing along x arm in Earth-centered f rame */ #define LAL_LHO_2K_ARM_X_DIRECTION_Z 0.55690487831 /**< LHO_2k z-component of unit vector pointing along x arm in Earth-centered f rame */
#define LAL_LHO_2K_ARM_Y_DIRECTION_X -0.91397818574 /**< LHO_2k x-component of unit vector pointing along y arm in Earth-centered f rame */ #define LAL_LHO_2K_ARM_Y_DIRECTION_X -0.91397818574 /**< LHO_2k x-component of unit vector pointing along y arm in Earth-centered f rame */
#define LAL_LHO_2K_ARM_Y_DIRECTION_Y 0.02609403989 /**< LHO_2k y-component of unit vector pointing along y arm in Earth-centered f rame */ #define LAL_LHO_2K_ARM_Y_DIRECTION_Y 0.02609403989 /**< LHO_2k y-component of unit vector pointing along y arm in Earth-centered f rame */
#define LAL_LHO_2K_ARM_Y_DIRECTION_Z -0.40492342125 /**< LHO_2k z-component of unit vector pointing along y arm in Earth-centered f rame */ #define LAL_LHO_2K_ARM_Y_DIRECTION_Z -0.40492342125 /**< LHO_2k z-component of unit vector pointing along y arm in Earth-centered f rame */
/*@}*/ /*@}*/
/** \name LIGO Hanford Observatory 4km Interferometric Detector constants /**
* \name LIGO Hanford Observatory 4km Interferometric Detector constants
* The following constants describe the location and geometry of the * The following constants describe the location and geometry of the
* LIGO Hanford Observatory 4km Interferometric Detector. */ * LIGO Hanford Observatory 4km Interferometric Detector.
*/
/*@{*/ /*@{*/
#define LAL_LHO_4K_DETECTOR_NAME "LHO_4k" /**< LHO_4k detector name string */ #define LAL_LHO_4K_DETECTOR_NAME "LHO_4k" /**< LHO_4k detector name string */
#define LAL_LHO_4K_DETECTOR_PREFIX "H1" /**< LHO_4k detector prefix string */ #define LAL_LHO_4K_DETECTOR_PREFIX "H1" /**< LHO_4k detector prefix string */
#define LAL_LHO_4K_DETECTOR_LONGITUDE_RAD -2.08405676917 /**< LHO_4k vertex longitude (rad) */ #define LAL_LHO_4K_DETECTOR_LONGITUDE_RAD -2.08405676917 /**< LHO_4k vertex longitude (rad) */
#define LAL_LHO_4K_DETECTOR_LATITUDE_RAD 0.81079526383 /**< LHO_4k vertex latitude (rad) */ #define LAL_LHO_4K_DETECTOR_LATITUDE_RAD 0.81079526383 /**< LHO_4k vertex latitude (rad) */
#define LAL_LHO_4K_DETECTOR_ELEVATION_SI 142.554 /**< LHO_4k vertex elevation (m) */ #define LAL_LHO_4K_DETECTOR_ELEVATION_SI 142.554 /**< LHO_4k vertex elevation (m) */
#define LAL_LHO_4K_DETECTOR_ARM_X_AZIMUTH_RAD 5.65487724844 /**< LHO_4k x arm azimuth (rad) */ #define LAL_LHO_4K_DETECTOR_ARM_X_AZIMUTH_RAD 5.65487724844 /**< LHO_4k x arm azimuth (rad) */
#define LAL_LHO_4K_DETECTOR_ARM_Y_AZIMUTH_RAD 4.08408092164 /**< LHO_4k y arm azimuth (rad) */ #define LAL_LHO_4K_DETECTOR_ARM_Y_AZIMUTH_RAD 4.08408092164 /**< LHO_4k y arm azimuth (rad) */
#define LAL_LHO_4K_DETECTOR_ARM_X_ALTITUDE_RAD -0.00061950000 /**< LHO_4k x arm altitude (rad) */ #define LAL_LHO_4K_DETECTOR_ARM_X_ALTITUDE_RAD -0.00061950000 /**< LHO_4k x arm altitude (rad) */
#define LAL_LHO_4K_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00001250000 /**< LHO_4k y arm altitude (rad) */ #define LAL_LHO_4K_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00001250000 /**< LHO_4k y arm altitude (rad) */
skipping to change at line 427 skipping to change at line 440
#define LAL_LHO_4K_VERTEX_LOCATION_Y_SI -3.83469517889e+06 /**< LHO_4k y-component of vertex location in Earth-centered frame (m) */ #define LAL_LHO_4K_VERTEX_LOCATION_Y_SI -3.83469517889e+06 /**< LHO_4k y-component of vertex location in Earth-centered frame (m) */
#define LAL_LHO_4K_VERTEX_LOCATION_Z_SI 4.60035022664e+06 /**< LHO_4k z-component of vertex location in Earth-centered frame (m) */ #define LAL_LHO_4K_VERTEX_LOCATION_Z_SI 4.60035022664e+06 /**< LHO_4k z-component of vertex location in Earth-centered frame (m) */
#define LAL_LHO_4K_ARM_X_DIRECTION_X -0.22389266154 /**< LHO_4k x-component of unit vector pointing along x arm in Earth-centered f rame */ #define LAL_LHO_4K_ARM_X_DIRECTION_X -0.22389266154 /**< LHO_4k x-component of unit vector pointing along x arm in Earth-centered f rame */
#define LAL_LHO_4K_ARM_X_DIRECTION_Y 0.79983062746 /**< LHO_4k y-component of unit vector pointing along x arm in Earth-centered f rame */ #define LAL_LHO_4K_ARM_X_DIRECTION_Y 0.79983062746 /**< LHO_4k y-component of unit vector pointing along x arm in Earth-centered f rame */
#define LAL_LHO_4K_ARM_X_DIRECTION_Z 0.55690487831 /**< LHO_4k z-component of unit vector pointing along x arm in Earth-centered f rame */ #define LAL_LHO_4K_ARM_X_DIRECTION_Z 0.55690487831 /**< LHO_4k z-component of unit vector pointing along x arm in Earth-centered f rame */
#define LAL_LHO_4K_ARM_Y_DIRECTION_X -0.91397818574 /**< LHO_4k x-component of unit vector pointing along y arm in Earth-centered f rame */ #define LAL_LHO_4K_ARM_Y_DIRECTION_X -0.91397818574 /**< LHO_4k x-component of unit vector pointing along y arm in Earth-centered f rame */
#define LAL_LHO_4K_ARM_Y_DIRECTION_Y 0.02609403989 /**< LHO_4k y-component of unit vector pointing along y arm in Earth-centered f rame */ #define LAL_LHO_4K_ARM_Y_DIRECTION_Y 0.02609403989 /**< LHO_4k y-component of unit vector pointing along y arm in Earth-centered f rame */
#define LAL_LHO_4K_ARM_Y_DIRECTION_Z -0.40492342125 /**< LHO_4k z-component of unit vector pointing along y arm in Earth-centered f rame */ #define LAL_LHO_4K_ARM_Y_DIRECTION_Z -0.40492342125 /**< LHO_4k z-component of unit vector pointing along y arm in Earth-centered f rame */
/*@}*/ /*@}*/
/** \name LIGO Livingston Observatory 4km Interferometric Detector constant /**
s * \name LIGO Livingston Observatory 4km Interferometric Detector constants
* The following constants describe the location and geometry of the * The following constants describe the location and geometry of the
* LIGO Livingston Observatory 4km Interferometric Detector. */ * LIGO Livingston Observatory 4km Interferometric Detector.
*/
/*@{*/ /*@{*/
#define LAL_LLO_4K_DETECTOR_NAME "LLO_4k" /**< LLO_4k detector name string */ #define LAL_LLO_4K_DETECTOR_NAME "LLO_4k" /**< LLO_4k detector name string */
#define LAL_LLO_4K_DETECTOR_PREFIX "L1" /**< LLO_4k detector prefix string */ #define LAL_LLO_4K_DETECTOR_PREFIX "L1" /**< LLO_4k detector prefix string */
#define LAL_LLO_4K_DETECTOR_LONGITUDE_RAD -1.58430937078 /**< LLO_4k vertex longitude (rad) */ #define LAL_LLO_4K_DETECTOR_LONGITUDE_RAD -1.58430937078 /**< LLO_4k vertex longitude (rad) */
#define LAL_LLO_4K_DETECTOR_LATITUDE_RAD 0.53342313506 /**< LLO_4k vertex latitude (rad) */ #define LAL_LLO_4K_DETECTOR_LATITUDE_RAD 0.53342313506 /**< LLO_4k vertex latitude (rad) */
#define LAL_LLO_4K_DETECTOR_ELEVATION_SI -6.574 /**< LLO_4k vertex elevation (m) */ #define LAL_LLO_4K_DETECTOR_ELEVATION_SI -6.574 /**< LLO_4k vertex elevation (m) */
#define LAL_LLO_4K_DETECTOR_ARM_X_AZIMUTH_RAD 4.40317772346 /**< LLO_4k x arm azimuth (rad) */ #define LAL_LLO_4K_DETECTOR_ARM_X_AZIMUTH_RAD 4.40317772346 /**< LLO_4k x arm azimuth (rad) */
#define LAL_LLO_4K_DETECTOR_ARM_Y_AZIMUTH_RAD 2.83238139666 /**< LLO_4k y arm azimuth (rad) */ #define LAL_LLO_4K_DETECTOR_ARM_Y_AZIMUTH_RAD 2.83238139666 /**< LLO_4k y arm azimuth (rad) */
#define LAL_LLO_4K_DETECTOR_ARM_X_ALTITUDE_RAD -0.00031210000 /**< LLO_4k x arm altitude (rad) */ #define LAL_LLO_4K_DETECTOR_ARM_X_ALTITUDE_RAD -0.00031210000 /**< LLO_4k x arm altitude (rad) */
#define LAL_LLO_4K_DETECTOR_ARM_Y_ALTITUDE_RAD -0.00061070000 /**< LLO_4k y arm altitude (rad) */ #define LAL_LLO_4K_DETECTOR_ARM_Y_ALTITUDE_RAD -0.00061070000 /**< LLO_4k y arm altitude (rad) */
skipping to change at line 453 skipping to change at line 468
#define LAL_LLO_4K_VERTEX_LOCATION_Y_SI -5.49628371971e+06 /**< LLO_4k y-component of vertex location in Earth-centered frame (m) */ #define LAL_LLO_4K_VERTEX_LOCATION_Y_SI -5.49628371971e+06 /**< LLO_4k y-component of vertex location in Earth-centered frame (m) */
#define LAL_LLO_4K_VERTEX_LOCATION_Z_SI 3.22425701744e+06 /**< LLO_4k z-component of vertex location in Earth-centered frame (m) */ #define LAL_LLO_4K_VERTEX_LOCATION_Z_SI 3.22425701744e+06 /**< LLO_4k z-component of vertex location in Earth-centered frame (m) */
#define LAL_LLO_4K_ARM_X_DIRECTION_X -0.95457412153 /**< LLO_4k x-component of unit vector pointing along x arm in Earth-centered f rame */ #define LAL_LLO_4K_ARM_X_DIRECTION_X -0.95457412153 /**< LLO_4k x-component of unit vector pointing along x arm in Earth-centered f rame */
#define LAL_LLO_4K_ARM_X_DIRECTION_Y -0.14158077340 /**< LLO_4k y-component of unit vector pointing along x arm in Earth-centered f rame */ #define LAL_LLO_4K_ARM_X_DIRECTION_Y -0.14158077340 /**< LLO_4k y-component of unit vector pointing along x arm in Earth-centered f rame */
#define LAL_LLO_4K_ARM_X_DIRECTION_Z -0.26218911324 /**< LLO_4k z-component of unit vector pointing along x arm in Earth-centered f rame */ #define LAL_LLO_4K_ARM_X_DIRECTION_Z -0.26218911324 /**< LLO_4k z-component of unit vector pointing along x arm in Earth-centered f rame */
#define LAL_LLO_4K_ARM_Y_DIRECTION_X 0.29774156894 /**< LLO_4k x-component of unit vector pointing along y arm in Earth-centered f rame */ #define LAL_LLO_4K_ARM_Y_DIRECTION_X 0.29774156894 /**< LLO_4k x-component of unit vector pointing along y arm in Earth-centered f rame */
#define LAL_LLO_4K_ARM_Y_DIRECTION_Y -0.48791033647 /**< LLO_4k y-component of unit vector pointing along y arm in Earth-centered f rame */ #define LAL_LLO_4K_ARM_Y_DIRECTION_Y -0.48791033647 /**< LLO_4k y-component of unit vector pointing along y arm in Earth-centered f rame */
#define LAL_LLO_4K_ARM_Y_DIRECTION_Z -0.82054461286 /**< LLO_4k z-component of unit vector pointing along y arm in Earth-centered f rame */ #define LAL_LLO_4K_ARM_Y_DIRECTION_Z -0.82054461286 /**< LLO_4k z-component of unit vector pointing along y arm in Earth-centered f rame */
/*@}*/ /*@}*/
/** \name Caltech 40m Prototype Detector constants /**
* \name Caltech 40m Prototype Detector constants
* The following constants describe the location and geometry of the * The following constants describe the location and geometry of the
* Caltech 40m Prototype Detector. */ * Caltech 40m Prototype Detector.
*/
/*@{*/ /*@{*/
#define LAL_CIT_40_DETECTOR_NAME "CIT_40" /**< CIT_40 detector name string */ #define LAL_CIT_40_DETECTOR_NAME "CIT_40" /**< CIT_40 detector name string */
#define LAL_CIT_40_DETECTOR_PREFIX "P1" /**< CIT_40 detector prefix string */ #define LAL_CIT_40_DETECTOR_PREFIX "P1" /**< CIT_40 detector prefix string */
#define LAL_CIT_40_DETECTOR_LONGITUDE_RAD -2.06175744538 /**< CIT_40 vertex longitude (rad) */ #define LAL_CIT_40_DETECTOR_LONGITUDE_RAD -2.06175744538 /**< CIT_40 vertex longitude (rad) */
#define LAL_CIT_40_DETECTOR_LATITUDE_RAD 0.59637900541 /**< CIT_40 vertex latitude (rad) */ #define LAL_CIT_40_DETECTOR_LATITUDE_RAD 0.59637900541 /**< CIT_40 vertex latitude (rad) */
#define LAL_CIT_40_DETECTOR_ELEVATION_SI 0 /**< CIT_40 vertex elevation (m) */ #define LAL_CIT_40_DETECTOR_ELEVATION_SI 0 /**< CIT_40 vertex elevation (m) */
#define LAL_CIT_40_DETECTOR_ARM_X_AZIMUTH_RAD 3.14159265359 /**< CIT_40 x arm azimuth (rad) */ #define LAL_CIT_40_DETECTOR_ARM_X_AZIMUTH_RAD 3.14159265359 /**< CIT_40 x arm azimuth (rad) */
#define LAL_CIT_40_DETECTOR_ARM_Y_AZIMUTH_RAD 1.57079632679 /**< CIT_40 y arm azimuth (rad) */ #define LAL_CIT_40_DETECTOR_ARM_Y_AZIMUTH_RAD 1.57079632679 /**< CIT_40 y arm azimuth (rad) */
#define LAL_CIT_40_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< CIT_40 x arm altitude (rad) */ #define LAL_CIT_40_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< CIT_40 x arm altitude (rad) */
#define LAL_CIT_40_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< CIT_40 y arm altitude (rad) */ #define LAL_CIT_40_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< CIT_40 y arm altitude (rad) */
skipping to change at line 481 skipping to change at line 498
#define LAL_CIT_40_ARM_X_DIRECTION_X -0.26480331633 /**< CIT_40 x-component of unit vector pointing along x arm in Earth-centered f rame */ #define LAL_CIT_40_ARM_X_DIRECTION_X -0.26480331633 /**< CIT_40 x-component of unit vector pointing along x arm in Earth-centered f rame */
#define LAL_CIT_40_ARM_X_DIRECTION_Y -0.49530818538 /**< CIT_40 y-component of unit vector pointing along x arm in Earth-centered f rame */ #define LAL_CIT_40_ARM_X_DIRECTION_Y -0.49530818538 /**< CIT_40 y-component of unit vector pointing along x arm in Earth-centered f rame */
#define LAL_CIT_40_ARM_X_DIRECTION_Z -0.82737476706 /**< CIT_40 z-component of unit vector pointing along x arm in Earth-centered f rame */ #define LAL_CIT_40_ARM_X_DIRECTION_Z -0.82737476706 /**< CIT_40 z-component of unit vector pointing along x arm in Earth-centered f rame */
#define LAL_CIT_40_ARM_Y_DIRECTION_X 0.88188012386 /**< CIT_40 x-component of unit vector pointing along y arm in Earth-centered f rame */ #define LAL_CIT_40_ARM_Y_DIRECTION_X 0.88188012386 /**< CIT_40 x-component of unit vector pointing along y arm in Earth-centered f rame */
#define LAL_CIT_40_ARM_Y_DIRECTION_Y -0.47147369718 /**< CIT_40 y-component of unit vector pointing along y arm in Earth-centered f rame */ #define LAL_CIT_40_ARM_Y_DIRECTION_Y -0.47147369718 /**< CIT_40 y-component of unit vector pointing along y arm in Earth-centered f rame */
#define LAL_CIT_40_ARM_Y_DIRECTION_Z 0.00000000000 /**< CIT_40 z-component of unit vector pointing along y arm in Earth-centered f rame */ #define LAL_CIT_40_ARM_Y_DIRECTION_Z 0.00000000000 /**< CIT_40 z-component of unit vector pointing along y arm in Earth-centered f rame */
/*@}*/ /*@}*/
/* Resonant Mass (Bar) Detectors */ /* Resonant Mass (Bar) Detectors */
/** \name ALLEGRO Resonant Mass Detector with 320 degree azimuth "IGEC axis /**
" constants * \name ALLEGRO Resonant Mass Detector with 320 degree azimuth "IGEC axis"
constants
* The following constants describe the location and geometry of the * The following constants describe the location and geometry of the
* ALLEGRO Resonant Mass Detector with 320 degree azimuth "IGEC axis". */ * ALLEGRO Resonant Mass Detector with 320 degree azimuth "IGEC axis".
*/
/*@{*/ /*@{*/
#define LAL_ALLEGRO_320_DETECTOR_NAME "ALLEGRO_320" /**< ALLEGRO_320 detector name string */ #define LAL_ALLEGRO_320_DETECTOR_NAME "ALLEGRO_320" /**< ALLEGRO_320 detector name string */
#define LAL_ALLEGRO_320_DETECTOR_PREFIX "A1" /**< ALLEGRO _320 detector prefix string */ #define LAL_ALLEGRO_320_DETECTOR_PREFIX "A1" /**< ALLEGRO _320 detector prefix string */
#define LAL_ALLEGRO_320_DETECTOR_LONGITUDE_RAD -1.59137068496 /**< ALLEGRO_320 vertex longitude (rad) */ #define LAL_ALLEGRO_320_DETECTOR_LONGITUDE_RAD -1.59137068496 /**< ALLEGRO_320 vertex longitude (rad) */
#define LAL_ALLEGRO_320_DETECTOR_LATITUDE_RAD 0.53079879206 /**< ALLEGRO_320 vertex latitude (rad) */ #define LAL_ALLEGRO_320_DETECTOR_LATITUDE_RAD 0.53079879206 /**< ALLEGRO_320 vertex latitude (rad) */
#define LAL_ALLEGRO_320_DETECTOR_ELEVATION_SI 0 /**< ALLEGRO _320 vertex elevation (m) */ #define LAL_ALLEGRO_320_DETECTOR_ELEVATION_SI 0 /**< ALLEGRO _320 vertex elevation (m) */
#define LAL_ALLEGRO_320_DETECTOR_ARM_X_AZIMUTH_RAD -0.69813170080 /**< ALLEGRO_320 x arm azimuth (rad) */ #define LAL_ALLEGRO_320_DETECTOR_ARM_X_AZIMUTH_RAD -0.69813170080 /**< ALLEGRO_320 x arm azimuth (rad) */
#define LAL_ALLEGRO_320_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**< ALLEGRO_320 y arm azimuth (rad) UNUSED FOR BARS */ #define LAL_ALLEGRO_320_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**< ALLEGRO_320 y arm azimuth (rad) UNUSED FOR BARS */
#define LAL_ALLEGRO_320_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< ALLEGRO_320 x arm altitude (rad) */ #define LAL_ALLEGRO_320_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< ALLEGRO_320 x arm altitude (rad) */
#define LAL_ALLEGRO_320_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< ALLEGRO_320 y arm altitude (rad) UNUSED FOR BARS */ #define LAL_ALLEGRO_320_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< ALLEGRO_320 y arm altitude (rad) UNUSED FOR BARS */
#define LAL_ALLEGRO_320_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**< ALLEGRO_320 x arm midpoint (m) UNUSED FOR BARS */ #define LAL_ALLEGRO_320_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**< ALLEGRO_320 x arm midpoint (m) UNUSED FOR BARS */
#define LAL_ALLEGRO_320_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**< ALLEGRO_320 y arm midpoint (m) UNUSED FOR BARS */ #define LAL_ALLEGRO_320_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**< ALLEGRO_320 y arm midpoint (m) UNUSED FOR BARS */
#define LAL_ALLEGRO_320_VERTEX_LOCATION_X_SI -1.13258964140e+05 /**< ALLEGRO_320 x-component of vertex location in Earth-centered frame (m) */ #define LAL_ALLEGRO_320_VERTEX_LOCATION_X_SI -1.13258964140e+05 /**< ALLEGRO_320 x-component of vertex location in Earth-centered frame (m) */
#define LAL_ALLEGRO_320_VERTEX_LOCATION_Y_SI -5.50408337391e+06 /**< ALLEGRO_320 y-component of vertex location in Earth-centered frame (m) */ #define LAL_ALLEGRO_320_VERTEX_LOCATION_Y_SI -5.50408337391e+06 /**< ALLEGRO_320 y-component of vertex location in Earth-centered frame (m) */
#define LAL_ALLEGRO_320_VERTEX_LOCATION_Z_SI 3.20989567981e+06 /**< ALLEGRO_320 z-component of vertex location in Earth-centered frame (m) */ #define LAL_ALLEGRO_320_VERTEX_LOCATION_Z_SI 3.20989567981e+06 /**< ALLEGRO_320 z-component of vertex location in Earth-centered frame (m) */
#define LAL_ALLEGRO_320_AXIS_DIRECTION_X -0.63467362345 /**< ALLEGRO_320 x-component of unit vector pointing along axis in Earth-center ed frame */ #define LAL_ALLEGRO_320_AXIS_DIRECTION_X -0.63467362345 /**< ALLEGRO_320 x-component of unit vector pointing along axis in Earth-center ed frame */
#define LAL_ALLEGRO_320_AXIS_DIRECTION_Y 0.40093077976 /**< ALLEGRO_320 y-component of unit vector pointing along axis in Earth-center ed frame */ #define LAL_ALLEGRO_320_AXIS_DIRECTION_Y 0.40093077976 /**< ALLEGRO_320 y-component of unit vector pointing along axis in Earth-center ed frame */
#define LAL_ALLEGRO_320_AXIS_DIRECTION_Z 0.66063901000 /**< ALLEGRO_320 z-component of unit vector pointing along axis in Earth-center ed frame */ #define LAL_ALLEGRO_320_AXIS_DIRECTION_Z 0.66063901000 /**< ALLEGRO_320 z-component of unit vector pointing along axis in Earth-center ed frame */
/*@}*/ /*@}*/
/** \name AURIGA Resonant Mass Detector constants /**
* \name AURIGA Resonant Mass Detector constants
* The following constants describe the location and geometry of the * The following constants describe the location and geometry of the
* AURIGA Resonant Mass Detector. */ * AURIGA Resonant Mass Detector.
*/
/*@{*/ /*@{*/
#define LAL_AURIGA_DETECTOR_NAME "AURIGA" /**< AURIGA detector name string */ #define LAL_AURIGA_DETECTOR_NAME "AURIGA" /**< AURIGA detector name string */
#define LAL_AURIGA_DETECTOR_PREFIX "O1" /**< AURIGA detector prefix string */ #define LAL_AURIGA_DETECTOR_PREFIX "O1" /**< AURIGA detector prefix string */
#define LAL_AURIGA_DETECTOR_LONGITUDE_RAD 0.20853775679 /**< AURIGA vertex longitude (rad) */ #define LAL_AURIGA_DETECTOR_LONGITUDE_RAD 0.20853775679 /**< AURIGA vertex longitude (rad) */
#define LAL_AURIGA_DETECTOR_LATITUDE_RAD 0.79156499342 /**< AURIGA vertex latitude (rad) */ #define LAL_AURIGA_DETECTOR_LATITUDE_RAD 0.79156499342 /**< AURIGA vertex latitude (rad) */
#define LAL_AURIGA_DETECTOR_ELEVATION_SI 0 /**< AURIGA vertex elevation (m) */ #define LAL_AURIGA_DETECTOR_ELEVATION_SI 0 /**< AURIGA vertex elevation (m) */
#define LAL_AURIGA_DETECTOR_ARM_X_AZIMUTH_RAD 0.76794487088 /**< AURIGA x arm azimuth (rad) */ #define LAL_AURIGA_DETECTOR_ARM_X_AZIMUTH_RAD 0.76794487088 /**< AURIGA x arm azimuth (rad) */
#define LAL_AURIGA_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**< AURIGA y arm azimuth (rad) UNUSED FOR BARS */ #define LAL_AURIGA_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**< AURIGA y arm azimuth (rad) UNUSED FOR BARS */
#define LAL_AURIGA_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< AURIGA x arm altitude (rad) */ #define LAL_AURIGA_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< AURIGA x arm altitude (rad) */
#define LAL_AURIGA_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< AURIGA y arm altitude (rad) UNUSED FOR BARS */ #define LAL_AURIGA_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< AURIGA y arm altitude (rad) UNUSED FOR BARS */
#define LAL_AURIGA_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**< AURIGA x arm midpoint (m) UNUSED FOR BARS */ #define LAL_AURIGA_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**< AURIGA x arm midpoint (m) UNUSED FOR BARS */
#define LAL_AURIGA_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**< AURIGA y arm midpoint (m) UNUSED FOR BARS */ #define LAL_AURIGA_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**< AURIGA y arm midpoint (m) UNUSED FOR BARS */
#define LAL_AURIGA_VERTEX_LOCATION_X_SI 4.39246733007e+06 /**< AURIGA x-component of vertex location in Earth-centered frame (m) */ #define LAL_AURIGA_VERTEX_LOCATION_X_SI 4.39246733007e+06 /**< AURIGA x-component of vertex location in Earth-centered frame (m) */
#define LAL_AURIGA_VERTEX_LOCATION_Y_SI 9.29508666967e+05 /**< AURIGA y-component of vertex location in Earth-centered frame (m) */ #define LAL_AURIGA_VERTEX_LOCATION_Y_SI 9.29508666967e+05 /**< AURIGA y-component of vertex location in Earth-centered frame (m) */
#define LAL_AURIGA_VERTEX_LOCATION_Z_SI 4.51502913071e+06 /**< AURIGA z-component of vertex location in Earth-centered frame (m) */ #define LAL_AURIGA_VERTEX_LOCATION_Z_SI 4.51502913071e+06 /**< AURIGA z-component of vertex location in Earth-centered frame (m) */
#define LAL_AURIGA_AXIS_DIRECTION_X -0.64450412225 /**< AURIGA x-component of unit vector pointing along axis in Earth-centered fr ame */ #define LAL_AURIGA_AXIS_DIRECTION_X -0.64450412225 /**< AURIGA x-component of unit vector pointing along axis in Earth-centered fr ame */
#define LAL_AURIGA_AXIS_DIRECTION_Y 0.57365538956 /**< AURIGA y-component of unit vector pointing along axis in Earth-centered fr ame */ #define LAL_AURIGA_AXIS_DIRECTION_Y 0.57365538956 /**< AURIGA y-component of unit vector pointing along axis in Earth-centered fr ame */
#define LAL_AURIGA_AXIS_DIRECTION_Z 0.50550364038 /**< AURIGA z-component of unit vector pointing along axis in Earth-centered fr ame */ #define LAL_AURIGA_AXIS_DIRECTION_Z 0.50550364038 /**< AURIGA z-component of unit vector pointing along axis in Earth-centered fr ame */
/*@}*/ /*@}*/
/** \name EXPLORER Resonant Mass Detector constants /**
* \name EXPLORER Resonant Mass Detector constants
* The following constants describe the location and geometry of the * The following constants describe the location and geometry of the
* EXPLORER Resonant Mass Detector. */ * EXPLORER Resonant Mass Detector.
*/
/*@{*/ /*@{*/
#define LAL_EXPLORER_DETECTOR_NAME "EXPLORER" /**< EXPLORER detector name string */ #define LAL_EXPLORER_DETECTOR_NAME "EXPLORER" /**< EXPLORER detector name string */
#define LAL_EXPLORER_DETECTOR_PREFIX "E1" /**< EXPLORE R detector prefix string */ #define LAL_EXPLORER_DETECTOR_PREFIX "E1" /**< EXPLORE R detector prefix string */
#define LAL_EXPLORER_DETECTOR_LONGITUDE_RAD 0.10821041362 /**< EXPLORER vertex longitude (rad) */ #define LAL_EXPLORER_DETECTOR_LONGITUDE_RAD 0.10821041362 /**< EXPLORER vertex longitude (rad) */
#define LAL_EXPLORER_DETECTOR_LATITUDE_RAD 0.81070543755 /**< EXPLORER vertex latitude (rad) */ #define LAL_EXPLORER_DETECTOR_LATITUDE_RAD 0.81070543755 /**< EXPLORER vertex latitude (rad) */
#define LAL_EXPLORER_DETECTOR_ELEVATION_SI 0 /**< EXPLORE R vertex elevation (m) */ #define LAL_EXPLORER_DETECTOR_ELEVATION_SI 0 /**< EXPLORE R vertex elevation (m) */
#define LAL_EXPLORER_DETECTOR_ARM_X_AZIMUTH_RAD 0.68067840828 /**< EXPLORER x arm azimuth (rad) */ #define LAL_EXPLORER_DETECTOR_ARM_X_AZIMUTH_RAD 0.68067840828 /**< EXPLORER x arm azimuth (rad) */
#define LAL_EXPLORER_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**< EXPLORER y arm azimuth (rad) UNUSED FOR BARS */ #define LAL_EXPLORER_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**< EXPLORER y arm azimuth (rad) UNUSED FOR BARS */
#define LAL_EXPLORER_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< EXPLORER x arm altitude (rad) */ #define LAL_EXPLORER_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< EXPLORER x arm altitude (rad) */
#define LAL_EXPLORER_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< EXPLORER y arm altitude (rad) UNUSED FOR BARS */ #define LAL_EXPLORER_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< EXPLORER y arm altitude (rad) UNUSED FOR BARS */
#define LAL_EXPLORER_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**< EXPLORER x arm midpoint (m) UNUSED FOR BARS */ #define LAL_EXPLORER_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**< EXPLORER x arm midpoint (m) UNUSED FOR BARS */
#define LAL_EXPLORER_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**< EXPLORER y arm midpoint (m) UNUSED FOR BARS */ #define LAL_EXPLORER_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**< EXPLORER y arm midpoint (m) UNUSED FOR BARS */
#define LAL_EXPLORER_VERTEX_LOCATION_X_SI 4.37645395452e+06 /**< EXPLORER x-component of vertex location in Earth-centered frame (m ) */ #define LAL_EXPLORER_VERTEX_LOCATION_X_SI 4.37645395452e+06 /**< EXPLORER x-component of vertex location in Earth-centered frame (m ) */
#define LAL_EXPLORER_VERTEX_LOCATION_Y_SI 4.75435044067e+05 /**< EXPLORER y-component of vertex location in Earth-centered frame (m ) */ #define LAL_EXPLORER_VERTEX_LOCATION_Y_SI 4.75435044067e+05 /**< EXPLORER y-component of vertex location in Earth-centered frame (m ) */
#define LAL_EXPLORER_VERTEX_LOCATION_Z_SI 4.59985274450e+06 /**< EXPLORER z-component of vertex location in Earth-centered frame (m ) */ #define LAL_EXPLORER_VERTEX_LOCATION_Z_SI 4.59985274450e+06 /**< EXPLORER z-component of vertex location in Earth-centered frame (m ) */
#define LAL_EXPLORER_AXIS_DIRECTION_X -0.62792641437 /**< EXPLORER x-component of unit vector pointing along axis in Earth-centered frame */ #define LAL_EXPLORER_AXIS_DIRECTION_X -0.62792641437 /**< EXPLORER x-component of unit vector pointing along axis in Earth-centered frame */
#define LAL_EXPLORER_AXIS_DIRECTION_Y 0.56480832712 /**< EXPLORER y-component of unit vector pointing along axis in Earth-centered frame */ #define LAL_EXPLORER_AXIS_DIRECTION_Y 0.56480832712 /**< EXPLORER y-component of unit vector pointing along axis in Earth-centered frame */
#define LAL_EXPLORER_AXIS_DIRECTION_Z 0.53544371484 /**< EXPLORER z-component of unit vector pointing along axis in Earth-centered frame */ #define LAL_EXPLORER_AXIS_DIRECTION_Z 0.53544371484 /**< EXPLORER z-component of unit vector pointing along axis in Earth-centered frame */
/*@}*/ /*@}*/
/** \name Nautilus Resonant Mass Detector constants /**
* \name Nautilus Resonant Mass Detector constants
* The following constants describe the location and geometry of the * The following constants describe the location and geometry of the
* Nautilus Resonant Mass Detector. */ * Nautilus Resonant Mass Detector.
*/
/*@{*/ /*@{*/
#define LAL_NAUTILUS_DETECTOR_NAME "Nautilus" /**< Nautilus detector name string */ #define LAL_NAUTILUS_DETECTOR_NAME "Nautilus" /**< Nautilus detector name string */
#define LAL_NAUTILUS_DETECTOR_PREFIX "N1" /**< Nautilu s detector prefix string */ #define LAL_NAUTILUS_DETECTOR_PREFIX "N1" /**< Nautilu s detector prefix string */
#define LAL_NAUTILUS_DETECTOR_LONGITUDE_RAD 0.22117684946 /**< Nautilus vertex longitude (rad) */ #define LAL_NAUTILUS_DETECTOR_LONGITUDE_RAD 0.22117684946 /**< Nautilus vertex longitude (rad) */
#define LAL_NAUTILUS_DETECTOR_LATITUDE_RAD 0.72996456710 /**< Nautilus vertex latitude (rad) */ #define LAL_NAUTILUS_DETECTOR_LATITUDE_RAD 0.72996456710 /**< Nautilus vertex latitude (rad) */
#define LAL_NAUTILUS_DETECTOR_ELEVATION_SI 0 /**< Nautilu s vertex elevation (m) */ #define LAL_NAUTILUS_DETECTOR_ELEVATION_SI 0 /**< Nautilu s vertex elevation (m) */
#define LAL_NAUTILUS_DETECTOR_ARM_X_AZIMUTH_RAD 0.76794487088 /**< Nautilus x arm azimuth (rad) */ #define LAL_NAUTILUS_DETECTOR_ARM_X_AZIMUTH_RAD 0.76794487088 /**< Nautilus x arm azimuth (rad) */
#define LAL_NAUTILUS_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**< Nautilus y arm azimuth (rad) UNUSED FOR BARS */ #define LAL_NAUTILUS_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**< Nautilus y arm azimuth (rad) UNUSED FOR BARS */
#define LAL_NAUTILUS_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< Nautilus x arm altitude (rad) */ #define LAL_NAUTILUS_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< Nautilus x arm altitude (rad) */
#define LAL_NAUTILUS_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< Nautilus y arm altitude (rad) UNUSED FOR BARS */ #define LAL_NAUTILUS_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< Nautilus y arm altitude (rad) UNUSED FOR BARS */
#define LAL_NAUTILUS_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**< Nautilus x arm midpoint (m) UNUSED FOR BARS */ #define LAL_NAUTILUS_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**< Nautilus x arm midpoint (m) UNUSED FOR BARS */
#define LAL_NAUTILUS_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**< Nautilus y arm midpoint (m) UNUSED FOR BARS */ #define LAL_NAUTILUS_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**< Nautilus y arm midpoint (m) UNUSED FOR BARS */
#define LAL_NAUTILUS_VERTEX_LOCATION_X_SI 4.64410999868e+06 /**< Nautilus x-component of vertex location in Earth-centered frame (m ) */ #define LAL_NAUTILUS_VERTEX_LOCATION_X_SI 4.64410999868e+06 /**< Nautilus x-component of vertex location in Earth-centered frame (m ) */
#define LAL_NAUTILUS_VERTEX_LOCATION_Y_SI 1.04425342477e+06 /**< Nautilus y-component of vertex location in Earth-centered frame (m ) */ #define LAL_NAUTILUS_VERTEX_LOCATION_Y_SI 1.04425342477e+06 /**< Nautilus y-component of vertex location in Earth-centered frame (m ) */
#define LAL_NAUTILUS_VERTEX_LOCATION_Z_SI 4.23104713307e+06 /**< Nautilus z-component of vertex location in Earth-centered frame (m ) */ #define LAL_NAUTILUS_VERTEX_LOCATION_Z_SI 4.23104713307e+06 /**< Nautilus z-component of vertex location in Earth-centered frame (m ) */
#define LAL_NAUTILUS_AXIS_DIRECTION_X -0.62039441384 /**< Nautilus x-component of unit vector pointing along axis in Earth-centered frame */ #define LAL_NAUTILUS_AXIS_DIRECTION_X -0.62039441384 /**< Nautilus x-component of unit vector pointing along axis in Earth-centered frame */
#define LAL_NAUTILUS_AXIS_DIRECTION_Y 0.57250373141 /**< Nautilus y-component of unit vector pointing along axis in Earth-centered frame */ #define LAL_NAUTILUS_AXIS_DIRECTION_Y 0.57250373141 /**< Nautilus y-component of unit vector pointing along axis in Earth-centered frame */
#define LAL_NAUTILUS_AXIS_DIRECTION_Z 0.53605060283 /**< Nautilus z-component of unit vector pointing along axis in Earth-centered frame */ #define LAL_NAUTILUS_AXIS_DIRECTION_Z 0.53605060283 /**< Nautilus z-component of unit vector pointing along axis in Earth-centered frame */
/*@}*/ /*@}*/
/** \name NIOBE Resonant Mass Detector constants /**
* \name NIOBE Resonant Mass Detector constants
* The following constants describe the location and geometry of the * The following constants describe the location and geometry of the
* NIOBE Resonant Mass Detector. */ * NIOBE Resonant Mass Detector.
*/
/*@{*/ /*@{*/
#define LAL_NIOBE_DETECTOR_NAME "NIOBE" /**< NIOBE detector name string */ #define LAL_NIOBE_DETECTOR_NAME "NIOBE" /**< NIOBE detector name string */
#define LAL_NIOBE_DETECTOR_PREFIX "B1" /**< NIOBE detector prefix string */ #define LAL_NIOBE_DETECTOR_PREFIX "B1" /**< NIOBE detector prefix string */
#define LAL_NIOBE_DETECTOR_LONGITUDE_RAD 2.02138216202 /**< NIOBE v ertex longitude (rad) */ #define LAL_NIOBE_DETECTOR_LONGITUDE_RAD 2.02138216202 /**< NIOBE v ertex longitude (rad) */
#define LAL_NIOBE_DETECTOR_LATITUDE_RAD -0.55734180780 /**< NIOBE v ertex latitude (rad) */ #define LAL_NIOBE_DETECTOR_LATITUDE_RAD -0.55734180780 /**< NIOBE v ertex latitude (rad) */
#define LAL_NIOBE_DETECTOR_ELEVATION_SI 0 /**< NIOBE vertex el evation (m) */ #define LAL_NIOBE_DETECTOR_ELEVATION_SI 0 /**< NIOBE vertex el evation (m) */
#define LAL_NIOBE_DETECTOR_ARM_X_AZIMUTH_RAD 0.00000000000 /**< NIOBE x arm azimuth (rad) */ #define LAL_NIOBE_DETECTOR_ARM_X_AZIMUTH_RAD 0.00000000000 /**< NIOBE x arm azimuth (rad) */
#define LAL_NIOBE_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**< NIOBE y arm azimuth (rad) UNUSED FOR BARS */ #define LAL_NIOBE_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**< NIOBE y arm azimuth (rad) UNUSED FOR BARS */
#define LAL_NIOBE_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< NIOBE x arm altitude (rad) */ #define LAL_NIOBE_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< NIOBE x arm altitude (rad) */
#define LAL_NIOBE_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< NIOBE y arm altitude (rad) UNUSED FOR BARS */ #define LAL_NIOBE_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< NIOBE y arm altitude (rad) UNUSED FOR BARS */
#define LAL_NIOBE_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**< NIOBE x arm midpoint (m) UNUSED FOR BARS */ #define LAL_NIOBE_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**< NIOBE x arm midpoint (m) UNUSED FOR BARS */
#define LAL_NIOBE_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**< NIOBE y arm midpoint (m) UNUSED FOR BARS */ #define LAL_NIOBE_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**< NIOBE y arm midpoint (m) UNUSED FOR BARS */
#define LAL_NIOBE_VERTEX_LOCATION_X_SI -2.35948871453e+06 /**< NIOBE x-component of vertex location in Earth-centered frame (m) */ #define LAL_NIOBE_VERTEX_LOCATION_X_SI -2.35948871453e+06 /**< NIOBE x-component of vertex location in Earth-centered frame (m) */
#define LAL_NIOBE_VERTEX_LOCATION_Y_SI 4.87721571259e+06 /**< NIOBE y-component of vertex location in Earth-centered frame (m) */ #define LAL_NIOBE_VERTEX_LOCATION_Y_SI 4.87721571259e+06 /**< NIOBE y-component of vertex location in Earth-centered frame (m) */
#define LAL_NIOBE_VERTEX_LOCATION_Z_SI -3.35416003274e+06 /**< NIOBE z-component of vertex location in Earth-centered frame (m) */ #define LAL_NIOBE_VERTEX_LOCATION_Z_SI -3.35416003274e+06 /**< NIOBE z-component of vertex location in Earth-centered frame (m) */
#define LAL_NIOBE_AXIS_DIRECTION_X -0.23034623759 /**< NIOBE x -component of unit vector pointing along axis in Earth-centered frame */ #define LAL_NIOBE_AXIS_DIRECTION_X -0.23034623759 /**< NIOBE x -component of unit vector pointing along axis in Earth-centered frame */
#define LAL_NIOBE_AXIS_DIRECTION_Y 0.47614056486 /**< NIOBE y -component of unit vector pointing along axis in Earth-centered frame */ #define LAL_NIOBE_AXIS_DIRECTION_Y 0.47614056486 /**< NIOBE y -component of unit vector pointing along axis in Earth-centered frame */
#define LAL_NIOBE_AXIS_DIRECTION_Z 0.84866411101 /**< NIOBE z -component of unit vector pointing along axis in Earth-centered frame */ #define LAL_NIOBE_AXIS_DIRECTION_Z 0.84866411101 /**< NIOBE z -component of unit vector pointing along axis in Earth-centered frame */
/*@}*/ /*@}*/
/*@}*//* end: DetectorConstants */ /*@}*/ /* end: DetectorConstants */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _LALDETECTORS_H */ #endif /* _LALDETECTORS_H */
 End of changes. 37 change blocks. 
149 lines changed or deleted 178 lines changed or added


 LALErrno.h   LALErrno.h 
skipping to change at line 20 skipping to change at line 20
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with with program; see the file COPYING. If not, write to the * along with with program; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA * MA 02111-1307 USA
*/ */
/** \author: Cannon, K. C. /**
* \author: Cannon, K. C.
*/ */
#ifndef _LALERRNO_H #ifndef _LALERRNO_H
#define _LALERRNO_H #define _LALERRNO_H
/* /*
* Error codes and corresponding error messages. * Error codes and corresponding error messages.
*/ */
#define LAL_FAIL_ERR 1 #define LAL_FAIL_ERR 1
 End of changes. 1 change blocks. 
1 lines changed or deleted 2 lines changed or added


 LALError.h   LALError.h 
skipping to change at line 42 skipping to change at line 42
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
#ifndef SWIG /* exclude from SWIG interface */ #ifndef SWIG /* exclude from SWIG interface */
extern int (*lalRaiseHook) (int, const char *, ...); extern int (*lalRaiseHook) (int, const char *, ...);
extern void (*lalAbortHook) (const char *, ...); extern void (*lalAbortHook) (const char *, ...);
/** \addtogroup LALError_h *//*@{ */ /** \addtogroup LALError_h */ /*@{ */
int LALPrintError(const char *fmt, ...); int LALPrintError(const char *fmt, ...);
int LALRaise(int sig, const char *fmt, ...); int LALRaise(int sig, const char *fmt, ...);
void LALAbort(const char *fmt, ...); void LALAbort(const char *fmt, ...);
int LALError(LALStatus * status, const char *statement); int LALError(LALStatus * status, const char *statement);
int LALWarning(LALStatus * status, const char *warning); int LALWarning(LALStatus * status, const char *warning);
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 LALGSL.h   LALGSL.h 
skipping to change at line 21 skipping to change at line 21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with with program; see the file COPYING. If not, write to the * along with with program; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA * MA 02111-1307 USA
*/ */
/** /**
\addtogroup LALGSL_h * \addtogroup LALGSL_h
\author Creighton, J. D. E. * \author Creighton, J. D. E.
*
\brief Provides macros for integrating the GSL error handler with the LA * \brief Provides macros for integrating the GSL error handler with the LA
L status structure. L status structure.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/LALGSL.h> * \code
\endcode * #include <lal/LALGSL.h>
* \endcode
This header provides macros and functions for tracking and *
reporting the runtime status of a GSL calls. The intent is * This header provides macros and functions for tracking and
simultaneously to standardize the error reporting, and to make the * reporting the runtime status of a GSL calls. The intent is
reporting as transparent as possible to people coding individual * simultaneously to standardize the error reporting, and to make the
routines. * reporting as transparent as possible to people coding individual
* routines.
<em>Please always use these macros when making a GSL call *
within LAL. This will ensure that the LAL functions always have the * <em>Please always use these macros when making a GSL call
same behaviour and will also ensure that the LAL functions are reenterant * within LAL. This will ensure that the LAL functions always have the
and threadsafe (when LAL is configured appropriately).</em> * same behaviour and will also ensure that the LAL functions are reenteran
t
\heading{GSL function calls} * and threadsafe (when LAL is configured appropriately).</em>
*
The behaviour of GSL functions depends on the error handler that has been * ### GSL function calls ###
assigned. In order that LAL functions always have the same behaviour, it *
is necessary to use a LAL-specific GSL error handler. This error handler * The behaviour of GSL functions depends on the error handler that has bee
populates a LAL status structure with the GSL error message and code so tha n
t * assigned. In order that LAL functions always have the same behaviour, i
GSL functions behave much the same way as LAL functions. After the GSL t
functions are called, the error handler needs to be restored to the origina * is necessary to use a LAL-specific GSL error handler. This error handle
l r
handler so that the program calling the LAL routine has the same error hand * populates a LAL status structure with the GSL error message and code so
ler that
after the LAL function was called as it did before the LAL function was cal * GSL functions behave much the same way as LAL functions. After the GSL
led. * functions are called, the error handler needs to be restored to the orig
inal
This module provides a simple set of macros and the default LAL GSL error * handler so that the program calling the LAL routine has the same error h
handler. The macros provide a standard way to assign the LAL GSL error andler
handler before a GSL function call and to restore the original handler afte * after the LAL function was called as it did before the LAL function was
r called.
the call. *
* This module provides a simple set of macros and the default LAL GSL erro
Note that changing the GSL error handler is \e not a thread-safe r
action. Therefore it is necessary to block other threads from performing * handler. The macros provide a standard way to assign the LAL GSL error
GSL function calls while one thread has changed the handler. These macros * handler before a GSL function call and to restore the original handler a
ensure that such blocking is done for GSL function calls fter
<em>within other LAL routines</em> if LAL is configured with the * the call.
<tt>--enable-pthread-lock</tt> flag. See below for instructions on how *
to make other GSL function calls outside LAL thread-safe when used with LAL * Note that changing the GSL error handler is \e not a thread-safe
. * action. Therefore it is necessary to block other threads from performin
g
\code * GSL function calls while one thread has changed the handler. These macr
ATTATCHSTATUSPTR( status ); os
CALLGSL( gsl_function( x ), status ); * ensure that such blocking is done for GSL function calls
CHECKSTATUSPTR( status ); * <em>within other LAL routines</em> if LAL is configured with the
DETATCHSTATUSPTR( status ); * <tt>--enable-pthread-lock</tt> flag. See below for instructions on how
\endcode * to make other GSL function calls outside LAL thread-safe when used with
Note that the LAL function must attach (and detach) a status pointer as if LAL.
a LAL routine were called. *
Note also that you need to use the \c CHECKSTATUSPTR macro to check * \code
the status of the call. The equivalent to the \c TRY macro for GSL * ATTATCHSTATUSPTR( status );
functions is the \c TRYGSL macro, which is used as follows: * CALLGSL( gsl_function( x ), status );
\code * CHECKSTATUSPTR( status );
ATTATCHSTATUSPTR( status ); * DETATCHSTATUSPTR( status );
TRYGSL( gsl_function( x ), status ); * \endcode
DETATCHSTATUSPTR( status ); * Note that the LAL function must attach (and detach) a status pointer as
\endcode if
* a LAL routine were called.
If you are using GSL functions both in LAL and in the calling program, and * Note also that you need to use the \c CHECKSTATUSPTR macro to check
you are worried about thread-safety, the GSL function calls outside of LAL * the status of the call. The equivalent to the \c TRY macro for GSL
need to be blocked so that they do not access the GSL error handler while * functions is the \c TRYGSL macro, which is used as follows:
it has been changed to the LAL GSL error handler in a LAL function. To do * \code
this, you need to do the following: * ATTATCHSTATUSPTR( status );
\code * TRYGSL( gsl_function( x ), status );
#include<lal/LALGSL.h> * DETATCHSTATUSPTR( status );
... * \endcode
LALGSL_PTHREAD_MUTEX_LOCK; *
gsl_function( x ); * If you are using GSL functions both in LAL and in the calling program, a
LALGSL_PTHREAD_MUTEX_UNLOCK; nd
\endcode * you are worried about thread-safety, the GSL function calls outside of L
This ensures that \c gsl_function is not called while a LAL routine AL
is calling a GSL function in a different thread. You can do this even if * need to be blocked so that they do not access the GSL error handler whil
you don't always run your code with multiple threads. If you configure LAL e
without the <tt>--enable-pthread-lock</tt> flag, the macros * it has been changed to the LAL GSL error handler in a LAL function. To
\c LALGSL_PTHREAD_MUTEX_LOCK and \c LALGSL_PTHREAD_MUTEX_UNLOCK do
do nothing. * this, you need to do the following:
* \code
*/ * #include<lal/LALGSL.h>
* ...
* LALGSL_PTHREAD_MUTEX_LOCK;
* gsl_function( x );
* LALGSL_PTHREAD_MUTEX_UNLOCK;
* \endcode
* This ensures that \c gsl_function is not called while a LAL routine
* is calling a GSL function in a different thread. You can do this even i
f
* you don't always run your code with multiple threads. If you configure
LAL
* without the <tt>--enable-pthread-lock</tt> flag, the macros
* \c LALGSL_PTHREAD_MUTEX_LOCK and \c LALGSL_PTHREAD_MUTEX_UNLOCK
* do nothing.
*
*/
#ifndef _LALGSL_H #ifndef _LALGSL_H
#define _LALGSL_H #define _LALGSL_H
#include <lal/LALConfig.h> #include <lal/LALConfig.h>
#ifdef NDEBUG #ifdef NDEBUG
#ifndef LAL_NDEBUG #ifndef LAL_NDEBUG
#define LAL_NDEBUG #define LAL_NDEBUG
#endif #endif
#endif #endif
 End of changes. 1 change blocks. 
89 lines changed or deleted 104 lines changed or added


 LALMalloc.h   LALMalloc.h 
skipping to change at line 32 skipping to change at line 32
#include <stddef.h> #include <stddef.h>
#include <lal/LALConfig.h> #include <lal/LALConfig.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** \addtogroup LALMalloc_h *//*@{ */ /** \addtogroup LALMalloc_h */ /*@{ */
void *XLALMalloc(size_t n); void *XLALMalloc(size_t n);
void *XLALMallocLong(size_t n, const char *file, int line); void *XLALMallocLong(size_t n, const char *file, int line);
void *XLALCalloc(size_t m, size_t n); void *XLALCalloc(size_t m, size_t n);
void *XLALCallocLong(size_t m, size_t n, const char *file, int line); void *XLALCallocLong(size_t m, size_t n, const char *file, int line);
void *XLALRealloc(void *p, size_t n); void *XLALRealloc(void *p, size_t n);
void *XLALReallocLong(void *p, size_t n, const char *file, int line); void *XLALReallocLong(void *p, size_t n, const char *file, int line);
void XLALFree(void *p); void XLALFree(void *p);
#ifndef SWIG /* exclude from SWIG interface */ #ifndef SWIG /* exclude from SWIG interface */
#define XLALMalloc( n ) XLALMallocLong( n, __FILE__, __LINE__ ) #define XLALMalloc( n ) XLALMallocLong( n, __FILE__, __LINE__ )
#define XLALCalloc( m, n ) XLALCallocLong( m, n, __FILE__, __LINE__ ) #define XLALCalloc( m, n ) XLALCallocLong( m, n, __FILE__, __LINE__ )
skipping to change at line 84 skipping to change at line 84
extern char *lalMemDbgArgPtr; /* set to ptr arg in free or realloc */ extern char *lalMemDbgArgPtr; /* set to ptr arg in free or realloc */
extern char *lalMemDbgRetPtr; /* set to ptr returned in alloc functions * / extern char *lalMemDbgRetPtr; /* set to ptr returned in alloc functions * /
extern char *lalMemDbgPtr; /* set in both cases */ extern char *lalMemDbgPtr; /* set in both cases */
extern char *lalMemDbgUsrPtr; /* avaliable global memory pointer for user */ extern char *lalMemDbgUsrPtr; /* avaliable global memory pointer for user */
extern void **lalMemDbgUsrHndl; /* avaliable global memory handle for user */ extern void **lalMemDbgUsrHndl; /* avaliable global memory handle for user */
extern int lalIsMemDbgArgPtr; /* ( lalMemDbgUsrPtr == lalMemDbgArgPtr ) * / extern int lalIsMemDbgArgPtr; /* ( lalMemDbgUsrPtr == lalMemDbgArgPtr ) * /
extern int lalIsMemDbgRetPtr; /* ( lalMemDbgUsrPtr == lalMemDbgRetPtr ) * / extern int lalIsMemDbgRetPtr; /* ( lalMemDbgUsrPtr == lalMemDbgRetPtr ) * /
extern int lalIsMemDbgPtr; /* ( lalMemDbgUsrPtr == lalMemDbgPtr ) */ extern int lalIsMemDbgPtr; /* ( lalMemDbgUsrPtr == lalMemDbgPtr ) */
#endif /* SWIG */ #endif /* SWIG */
/** \addtogroup LALMalloc_h *//*@{ */ /** \addtogroup LALMalloc_h */ /*@{ */
void *LALMallocShort(size_t n); void *LALMallocShort(size_t n);
void *LALMallocLong(size_t n, const char *file, int line); void *LALMallocLong(size_t n, const char *file, int line);
void *LALCallocShort(size_t m, size_t n); void *LALCallocShort(size_t m, size_t n);
void LALFree(void *p); void LALFree(void *p);
void *LALCallocLong(size_t m, size_t n, const char *file, int line); void *LALCallocLong(size_t m, size_t n, const char *file, int line);
void *LALReallocShort(void *p, size_t n); void *LALReallocShort(void *p, size_t n);
void *LALReallocLong(void *p, size_t n, const char *file, int line); void *LALReallocLong(void *p, size_t n, const char *file, int line);
/*@}*/ /*@}*/
#endif /* NDEBUG || LAL_NDEBUG */ #endif /* NDEBUG || LAL_NDEBUG */
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 LALMathematica.h   LALMathematica.h 
skipping to change at line 47 skipping to change at line 47
* *
* \brief Provides structures, functions and macro definitions for modules that * \brief Provides structures, functions and macro definitions for modules that
* generate MATHEMATICA notebooks. * generate MATHEMATICA notebooks.
* *
* Currently, the only modules using this * Currently, the only modules using this
* header file are <tt>LALMath3DPlot()</tt>, which generates 3D animated * header file are <tt>LALMath3DPlot()</tt>, which generates 3D animated
* plots of template banks having three parameters and * plots of template banks having three parameters and
* <tt>LALMathNDPlot()</tt> which plots the 3-dimensional projections of a * <tt>LALMathNDPlot()</tt> which plots the 3-dimensional projections of a
* bank that is N-dimensional. * bank that is N-dimensional.
* *
* \heading{Synopsis} * ### Synopsis ###
*
* \code * \code
* #include <lal/LALMathematica.h> * #include <lal/LALMathematica.h>
* \endcode * \endcode
* *
* This header file defines macros containing MATHEMATICA syntax that is * This header file defines macros containing MATHEMATICA syntax that is
* otherwise messy to implement into C source files. Here is how to use * otherwise messy to implement into C source files. Here is how to use
* these macros to make your own program generate a MATHEMATICA notebook. * these macros to make your own program generate a MATHEMATICA notebook.
* *
* <ol> * <ol>
* <li> Open a file with a pointer named &quot;nb&quot; and a file extensti on &quot;.nb&quot;. * <li> Open a file with a pointer named &quot;nb&quot; and a file extensti on &quot;.nb&quot;.
skipping to change at line 70 skipping to change at line 71
* Text&quot) in between to write your text to the cells of the notebook. If * Text&quot) in between to write your text to the cells of the notebook. If
* you are writing MATHEMATICA commands use the INPUT macros; for plain * you are writing MATHEMATICA commands use the INPUT macros; for plain
* text, use TEXT Macros. * text, use TEXT Macros.
* </li><li> Denote titles and sections with the appropriate macros. * </li><li> Denote titles and sections with the appropriate macros.
* </li><li> Use END_NOTEBOOK to end the notebook and use fclose(nb) to clo se * </li><li> Use END_NOTEBOOK to end the notebook and use fclose(nb) to clo se
* the file &quot;nb&quot;. * the file &quot;nb&quot;.
* </li></ol> * </li></ol>
* *
* The result is very readable/changeable source similar in style to most * The result is very readable/changeable source similar in style to most
* markup languages. An example program might look like: * markup languages. An example program might look like:
* \code * \code
* FILE *nb; * FILE *nb;
* nb = fopen("YourFileName.nb", "rw"); * nb = fopen("YourFileName.nb", "rw");
* BEG_NOTEBOOK; * BEG_NOTEBOOK;
* BEG_TITLECELL; * BEG_TITLECELL;
* fprintf(nb, "Sample Program Title"); * fprintf(nb, "Sample Program Title");
* END_TITLECELL_; * END_TITLECELL_;
* BEG_SECTIONCELL; * BEG_SECTIONCELL;
* fprintf(nb, "Sample Program Section Name"); * fprintf(nb, "Sample Program Section Name");
* END_SECTIONCELL; * END_SECTIONCELL;
* END_NOTEBOOK; * END_NOTEBOOK;
* fclose(nb); * fclose(nb);
* \endcode * \endcode
* *
* ### Notes ###
* *
* \heading{Notes}
* <ul> * <ul>
* <li> Obviously the definitions and functions associated with this header * <li> Obviously the definitions and functions associated with this header
* are NOT LAL compliant and thus do not belong in any lal routines except * are NOT LAL compliant and thus do not belong in any lal routines except
* test programs.</li> * test programs.</li>
* <li> There are many more commands to manipulate the structure of * <li> There are many more commands to manipulate the structure of
* MATHEMATICA notebooks that are not included in this header. The macros * MATHEMATICA notebooks that are not included in this header. The macros
* are only what is necessary for a <em>bare minimum</em> interface.</li> * are only what is necessary for a <em>bare minimum</em> interface.</li>
* </ul> * </ul>
* *
*/ */
/*@{*/ /*@{*/
/**\name Error Codes */ /*@{*/ /**\name Error Codes */ /*@{*/
#define LALMATHEMATICAH_ENULL 1 /**< NULL pointer to a LALMathemati ca.h input structure */ #define LALMATHEMATICAH_ENULL 1 /**< NULL pointer to a LALMathemati ca.h input structure */
#define LALMATHEMATICAH_EFILE 2 /**< Could not open file to write a Mathematica Notebook */ #define LALMATHEMATICAH_EFILE 2 /**< Could not open file to write a Mathematica Notebook */
#define LALMATHEMATICAH_EVAL 3 /**< Invalid parameter value */ #define LALMATHEMATICAH_EVAL 3 /**< Invalid parameter value */
/*@}*/ /*@}*/
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
#define LALMATHEMATICAH_MSGENULL "NULL pointer to a LALMathematica.h input structure" #define LALMATHEMATICAH_MSGENULL "NULL pointer to a LALMathematica.h input structure"
#define LALMATHEMATICAH_MSGEFILE "Could not open file to write a Mat hematica Notebook" #define LALMATHEMATICAH_MSGEFILE "Could not open file to write a Mat hematica Notebook"
#define LALMATHEMATICAH_MSGEVAL "Invalid parameter value" #define LALMATHEMATICAH_MSGEVAL "Invalid parameter value"
/** \endcond */ /** \endcond */
/** \name Macros /**
* * \name Macros
* See the source file \ref LALMath3DPlot.c for an example of how to use * See the source file \ref LALMath3DPlot.c for an example of how to use
* these macros to generate a MATHEMATICA notebook in your own program. * these macros to generate a MATHEMATICA notebook in your own program.
* *
* <dl> * <dl>
* <dt>NOTEBOOK</dt><dd>Denotes the beginning and ending of the notebook fi le. A * <dt>NOTEBOOK</dt><dd>Denotes the beginning and ending of the notebook fi le. A
* BEG_NOTEBOOK tag must start the file and an END_NOTEBOOK tag must end * BEG_NOTEBOOK tag must start the file and an END_NOTEBOOK tag must end
* it.</dd> * it.</dd>
* <dt>TITLE</dt><dd>Placing an fprint(nb, &quot;Your Title&quot;) between BEG and END * <dt>TITLE</dt><dd>Placing an fprint(nb, &quot;Your Title&quot;) between BEG and END
* tags will place a <em>title font</em> cell in the notebook.</dd> * tags will place a <em>title font</em> cell in the notebook.</dd>
* <dt>GROUP</dt><dd>Cells placed in between these tags will be grouped tog ether</dd> * <dt>GROUP</dt><dd>Cells placed in between these tags will be grouped tog ether</dd>
skipping to change at line 140 skipping to change at line 141
* Notice that the file pointer must be named &quot;nb&quot; in order to us e the * Notice that the file pointer must be named &quot;nb&quot; in order to us e the
* macros defined in this header. When grouping several cell objects * macros defined in this header. When grouping several cell objects
* together the last object in the list should have an underscored END tag * together the last object in the list should have an underscored END tag
* instead of an END tag without an underscore. Although the notebook will * instead of an END tag without an underscore. Although the notebook will
* compile (usually) if you use the tags without an ending underscore, the * compile (usually) if you use the tags without an ending underscore, the
* dangling comma is taken as a null member of the list of grouped cells. * dangling comma is taken as a null member of the list of grouped cells.
* Therefore, when you view the notebook in MATHEMATICA you may see the * Therefore, when you view the notebook in MATHEMATICA you may see the
* word &quot;NULL&quot; printed on a line. That is an indication that you should * word &quot;NULL&quot; printed on a line. That is an indication that you should
* use the underscore version of the tag which preceeded the &quot;NULL&quo t; * use the underscore version of the tag which preceeded the &quot;NULL&quo t;
* statement. * statement.
*/ */
/*@{*/ /*@{*/
#define BEG_NOTEBOOK fprintf(nb, "Notebook[{\n") #define BEG_NOTEBOOK fprintf(nb, "Notebook[{\n")
#define END_NOTEBOOK fprintf(nb, "}]\n") #define END_NOTEBOOK fprintf(nb, "}]\n")
#define BEG_TITLECELL fprintf(nb, "Cell[\"") #define BEG_TITLECELL fprintf(nb, "Cell[\"")
#define END_TITLECELL fprintf(nb, "\", \"Title\"],\n") #define END_TITLECELL fprintf(nb, "\", \"Title\"],\n")
#define END_TITLECELL_ fprintf(nb, "\", \"Title\"]\n") #define END_TITLECELL_ fprintf(nb, "\", \"Title\"]\n")
#define BEG_GROUPCELL fprintf(nb, "Cell[CellGroupData[{\n" ) #define BEG_GROUPCELL fprintf(nb, "Cell[CellGroupData[{\n" )
#define END_GROUPCELLC fprintf(nb, "}, Closed ]],\n") #define END_GROUPCELLC fprintf(nb, "}, Closed ]],\n")
#define END_GROUPCELLC_ fprintf(nb, "}, Closed ]]\n") #define END_GROUPCELLC_ fprintf(nb, "}, Closed ]]\n")
#define BEG_SECTIONCELL fprintf(nb, "Cell[\"") #define BEG_SECTIONCELL fprintf(nb, "Cell[\"")
#define END_SECTIONCELL fprintf(nb, "\", \"Section\"],\n") #define END_SECTIONCELL fprintf(nb, "\", \"Section\"],\n")
#define END_SECTIONCELL_ fprintf(nb, "\", \"Section\"]\n") #define END_SECTIONCELL_ fprintf(nb, "\", \"Section\"]\n")
#define BEG_INPUTCELL fprintf(nb, "Cell[BoxData[\\(") #define BEG_INPUTCELL fprintf(nb, "Cell[BoxData[\\(")
#define END_INPUTCELL fprintf(nb, "\\)], \"Input\"],\n") #define END_INPUTCELL fprintf(nb, "\\)], \"Input\"],\n")
#define END_INPUTCELL_ fprintf(nb, "\\)], \"Input\"]\n") #define END_INPUTCELL_ fprintf(nb, "\\)], \"Input\"]\n")
#define BEG_TEXTCELL fprintf(nb, "Cell[\"\\<") #define BEG_TEXTCELL fprintf(nb, "Cell[\"\\<")
#define END_TEXTCELL fprintf(nb, "\\>\", \"Text\"],\n") #define END_TEXTCELL fprintf(nb, "\\>\", \"Text\"],\n")
#define END_TEXTCELL_ fprintf(nb, "\\>\", \"Text\"]\n") #define END_TEXTCELL_ fprintf(nb, "\\>\", \"Text\"]\n")
/*@}*/ /*@}*/
/** This type is used by \ref LALMath3DPlot.c as an input structure to plot /**
3-dimensional template banks. * This type is used by \ref LALMath3DPlot.c as an input structure to plot
3-dimensional template banks.
* It is a linked list with * It is a linked list with
* parameters for each coordinate x,y,z and a next pointer. It also has a * parameters for each coordinate x,y,z and a next pointer. It also has a
* parameter called grayLevel which must be \f$\epsilon [0,1]\f$. It speci fies * parameter called grayLevel which must be \f$\epsilon [0,1]\f$. It speci fies
* the shading of the point in the final plot with 0 representing black and * the shading of the point in the final plot with 0 representing black and
* 1 representing white. By creatively assigning its value the grayscale * 1 representing white. By creatively assigning its value the grayscale
* shade of the points may convey additional information. * shade of the points may convey additional information.
*/ */
typedef struct tagMath3DPointList{ typedef struct tagMath3DPointList{
struct tagMath3DPointList *next; struct tagMath3DPointList *next;
REAL4 x; REAL4 x;
REAL4 y; REAL4 y;
REAL4 z; REAL4 z;
REAL4 grayLevel; REAL4 grayLevel;
}Math3DPointList; }Math3DPointList;
/** This type is similar to Math3DPointList except the coordinates are /**
* This type is similar to Math3DPointList except the coordinates are
* stored as data in the REAL4Vector \c coordinates. * stored as data in the REAL4Vector \c coordinates.
*/ */
typedef struct tagMathNDPointList{ typedef struct tagMathNDPointList{
struct tagMathNDPointList *next; struct tagMathNDPointList *next;
REAL4Vector *coordinates; REAL4Vector *coordinates;
INT4 dimension; INT4 dimension;
REAL4 grayLevel; REAL4 grayLevel;
} MathNDPointList; } MathNDPointList;
/*@}*/ /*@}*/
 End of changes. 11 change blocks. 
12 lines changed or deleted 15 lines changed or added


 LALMoment.h   LALMoment.h 
skipping to change at line 33 skipping to change at line 33
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
/* C++ protection. */ /* C++ protection. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup LALMoment_h * \addtogroup LALMoment_h
\author Tibbits, M. M. * \author Tibbits, M. M.
*
\brief This header provides the prototype for the LALDMoment() and LALSMome * \brief This header provides the prototype for the LALDMoment() and LALSM
nt() function. oment() function.
*
\code * \code
(S - single precision ) * (S - single precision )
(D - double precision ) * (D - double precision )
\endcode * \endcode
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/LALMoment.h> * \code
\endcode * #include <lal/LALMoment.h>
* \endcode
\heading{Description} *
* ### Description ###
The data structure passed in is either a REAL8 or a REAL4 Sequence. The on *
ly parameter is which * The data structure passed in is either a REAL8 or a REAL4 Sequence. The
moment to calculate. The function the sums the data, calculates the average only parameter is which
and then it returns the * moment to calculate. The function the sums the data, calculates the aver
average for the first moment, it returns the variance for the second moment age and then it returns the
, and it returns the n-th * average for the first moment, it returns the variance for the second mom
moment about the mean for higher order moments. ent, and it returns the n-th
* moment about the mean for higher order moments.
\heading{Algorithm} *
<ul> * ### Algorithm ###
<li> Find the mean (here referred to as \f$ \overline{x} \f$).</li> *
<li> Sum, over all the elements, the quantity: \f$(x[k] - \overline{x})^{n} * <ul>
\f$</li> * <li> Find the mean (here referred to as \f$ \overline{x} \f$).</li>
<li> Divide the sum just made by N-1. Call it moment-n</li> * <li> Sum, over all the elements, the quantity: \f$(x[k] - \overline{x})^
<li> If n is greater than 2:</li> {n}\f$</li>
<ul> * <li> Divide the sum just made by N-1. Call it moment-n</li>
<li> Sum, over all the elements, the quantity: \f$(x[k] - \overline{x})^ * <li> If n is greater than 2:</li>
{n}\f$</li> * <ul>
<li> <em>Divide the sum just made by N. Call it moment-n</em></li> * <li> Sum, over all the elements, the quantity: \f$(x[k] - \overline{x})^
</ul> {n}\f$</li>
<li>Return moment-n</li> * <li> <em>Divide the sum just made by N. Call it moment-n</em></li>
</ul> * </ul>
* <li>Return moment-n</li>
\heading{Uses} * </ul>
*
Determination of a specific moment of a set of data. * ### Uses ###
*
\heading{Notes} * Determination of a specific moment of a set of data.
*
<ul> * ### Notes ###
<li> <em>Moments less than two are not allowed.</em></li> *
<li> <em>The result structure must be Non-NULL when passed in.</em></li> * <ul>
<li> <em>The function assumes that the length member of the data passed in * <li> <em>Moments less than two are not allowed.</em></li>
is correct.</em></li> * <li> <em>The result structure must be Non-NULL when passed in.</em></li>
</ul> * <li> <em>The function assumes that the length member of the data passed
in is correct.</em></li>
*/ * </ul>
*
*/
/*@{*/ /*@{*/
/**\name Error Codes */ /**\name Error Codes */
/*@{*/ /*@{*/
#define LALMOMENTH_ENULL 1 /**< NULL pointer */ #define LALMOMENTH_ENULL 1 /**< NULL pointer */
#define LALMOMENTH_ENNUL 2 /**< Non-NULL pointer */ #define LALMOMENTH_ENNUL 2 /**< Non-NULL pointer */
#define LALMOMENTH_ELNTH 3 /**< Must have more than one data point */ #define LALMOMENTH_ELNTH 3 /**< Must have more than one data point */
#define LALMOMENTH_ESEGZ 4 /**< Invalid number of segments */ #define LALMOMENTH_ESEGZ 4 /**< Invalid number of segments */
#define LALMOMENTH_ENUMZ 5 /**< Invalid number of points in segment */ #define LALMOMENTH_ENUMZ 5 /**< Invalid number of points in segment */
#define LALMOMENTH_EALOC 6 /**< Memory Allocation Error */ #define LALMOMENTH_EALOC 6 /**< Memory Allocation Error */
skipping to change at line 104 skipping to change at line 106
#define LALMOMENTH_MSGENULL "NULL pointer." #define LALMOMENTH_MSGENULL "NULL pointer."
#define LALMOMENTH_MSGENNUL "Non-NULL pointer." #define LALMOMENTH_MSGENNUL "Non-NULL pointer."
#define LALMOMENTH_MSGELNTH "Must have more than one data point." #define LALMOMENTH_MSGELNTH "Must have more than one data point."
#define LALMOMENTH_MSGESEGZ "Invalid number of segments" #define LALMOMENTH_MSGESEGZ "Invalid number of segments"
#define LALMOMENTH_MSGENUMZ "Invalid number of points in segment" #define LALMOMENTH_MSGENUMZ "Invalid number of points in segment"
#define LALMOMENTH_MSGEALOC "Memory Allocation Error" #define LALMOMENTH_MSGEALOC "Memory Allocation Error"
/** \endcond */ /** \endcond */
/* Function prototypes */ /* Function prototypes */
/** Determine specific moment of a set of REAL4 data. /**
* Determine specific moment of a set of REAL4 data.
*/ */
void LALSMoment void LALSMoment
( (
LALStatus *status, LALStatus *status,
REAL4 *result, REAL4 *result,
REAL4Sequence *data, REAL4Sequence *data,
INT4 whichMoment INT4 whichMoment
); );
/** Determine specific moment of a set of REAL8 data. /**
* Determine specific moment of a set of REAL8 data.
*/ */
void LALDMoment void LALDMoment
( (
LALStatus *status, LALStatus *status,
REAL8 *result, REAL8 *result,
REAL8Sequence *data, REAL8Sequence *data,
INT4 whichMoment INT4 whichMoment
); );
/*@}*/ /*@}*/
 End of changes. 3 change blocks. 
57 lines changed or deleted 61 lines changed or added


 LALNoiseModels.h   LALNoiseModels.h 
skipping to change at line 35 skipping to change at line 35
#include <stdlib.h> #include <stdlib.h>
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#include <lal/LALConstants.h> #include <lal/LALConstants.h>
#include <lal/RealFFT.h> #include <lal/RealFFT.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* \addtogroup LALNoiseModels_h
\addtogroup LALNoiseModels_h * \author Sathyaprakash, B.S.
\author Sathyaprakash, B.S. *
* \brief Header file for model noise generation codes.
\brief Header file for model noise generation codes. *
* ### Synopsis ###
\heading{Synopsis} *
\code * \code
#include <lal/LALNoiseModels.h> * #include <lal/LALNoiseModels.h>
\endcode * \endcode
*
This header file covers routines that are used in * This header file covers routines that are used in
synthetic background noise expected in various * synthetic background noise expected in various
detectors and signals with random parameters in background noise. * detectors and signals with random parameters in background noise.
*
*/ */
/* @{ */ /* @{ */
/**\name Error Codes */ /*@{*/ /**\name Error Codes */ /*@{*/
#define LALNOISEMODELSH_ENULL 1 /**< Arguments contained an unexpect ed null pointer */ #define LALNOISEMODELSH_ENULL 1 /**< Arguments contained an unexpect ed null pointer */
#define LALNOISEMODELSH_EMEM 2 /**< Memory allocation error */ #define LALNOISEMODELSH_EMEM 2 /**< Memory allocation error */
#define LALNOISEMODELSH_ECHOICE 4 /**< Invalid choice for an input par ameter */ #define LALNOISEMODELSH_ECHOICE 4 /**< Invalid choice for an input par ameter */
#define LALNOISEMODELSH_EDIV0 8 /**< Division by zero */ #define LALNOISEMODELSH_EDIV0 8 /**< Division by zero */
#define LALNOISEMODELSH_ESIZE 16 /**< Invalid input size */ #define LALNOISEMODELSH_ESIZE 16 /**< Invalid input size */
/*@} */ /*@} */
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
 End of changes. 1 change blocks. 
16 lines changed or deleted 16 lines changed or added


 LALRunningMedian.h   LALRunningMedian.h 
skipping to change at line 30 skipping to change at line 30
#ifndef _LALRUNNINGMEDIAN_H #ifndef _LALRUNNINGMEDIAN_H
#define _LALRUNNINGMEDIAN_H #define _LALRUNNINGMEDIAN_H
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup LALRunningMedian_h * \addtogroup LALRunningMedian_h
\author Somya D. Mohanty, B. Machenschalk * \author Somya D. Mohanty, B. Machenschalk
*
\brief Provides routines to efficiently calculate the running median * \brief Provides routines to efficiently calculate the running median
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/LALRunningMedian.h> * \code
\endcode * #include <lal/LALRunningMedian.h>
* \endcode
This header covers routines to efficiently calculate the *
running median of REAL4 and REAL8 sequences * This header covers routines to efficiently calculate the
* running median of REAL4 and REAL8 sequences
The routine <tt>LALDRunningMedian()</tt> calculates the running medians of *
a * The routine <tt>LALDRunningMedian()</tt> calculates the running medians
REAL8Sequence. The routine <tt>LALSRunningMedian()</tt> does the same for a of a
REAL4Sequence. * REAL8Sequence. The routine <tt>LALSRunningMedian()</tt> does the same fo
\c input ist a REAL4/REAL8Sequence containing the input array, \c blocksize r a REAL4Sequence.
is the length of the block the medians are calculated of. * \c input ist a REAL4/REAL8Sequence containing the input array, \c blocks
With n being the lenght of the input array and b being the blocksize, ize
the medians array must be a REAL4/REAL8 sequence of length (n-b+1). * is the length of the block the medians are calculated of.
<tt>LALDRunningMedian2()</tt> and <tt>LALSRunningMedian2()</tt> are a * With n being the lenght of the input array and b being the blocksize,
different implentation of the same algorithm. It should behave exactly like * the medians array must be a REAL4/REAL8 sequence of length (n-b+1).
<tt>LALDRunningMedian()</tt>, but has proven to be a * <tt>LALDRunningMedian2()</tt> and <tt>LALSRunningMedian2()</tt> are a
little faster and more stable. Check if it works for you. * different implentation of the same algorithm. It should behave exactly l
\heading{Algorithm} ike
* <tt>LALDRunningMedian()</tt>, but has proven to be a
For a detailed description of the algorithm see the * little faster and more stable. Check if it works for you.
LIGO document T-030168-00-D, Somya D. Mohanty: *
Efficient Algorithm for computing a Running Median * ### Algorithm ###
*
*/ * For a detailed description of the algorithm see the
* LIGO document T-030168-00-D, Somya D. Mohanty:
* Efficient Algorithm for computing a Running Median
*
*/
/*@{*/ /*@{*/
/** \name Error Codes */ /** \name Error Codes */
/*@{*/ /*@{*/
#define LALRUNNINGMEDIANH_EMALOC1 1 /**< Could not allocate inde xblock */ #define LALRUNNINGMEDIANH_EMALOC1 1 /**< Could not allocate inde xblock */
#define LALRUNNINGMEDIANH_EMALOC2 2 /**< Could not allocate chec ks */ #define LALRUNNINGMEDIANH_EMALOC2 2 /**< Could not allocate chec ks */
#define LALRUNNINGMEDIANH_EMALOC3 3 /**< Could not allocate chec ks4shift */ #define LALRUNNINGMEDIANH_EMALOC3 3 /**< Could not allocate chec ks4shift */
#define LALRUNNINGMEDIANH_EMALOC4 4 /**< Could not allocate node addresses */ #define LALRUNNINGMEDIANH_EMALOC4 4 /**< Could not allocate node addresses */
#define LALRUNNINGMEDIANH_EMALOC5 5 /**< Could not aloocate firs t node */ #define LALRUNNINGMEDIANH_EMALOC5 5 /**< Could not aloocate firs t node */
#define LALRUNNINGMEDIANH_EMALOC6 6 /**< Could not allocate node */ #define LALRUNNINGMEDIANH_EMALOC6 6 /**< Could not allocate node */
skipping to change at line 93 skipping to change at line 95
#define LALRUNNINGMEDIANH_MSGEMALOC6 "Could not allocate node" #define LALRUNNINGMEDIANH_MSGEMALOC6 "Could not allocate node"
#define LALRUNNINGMEDIANH_MSGECV "Could not create output vector (LALCr eateVector failed)" #define LALRUNNINGMEDIANH_MSGECV "Could not create output vector (LALCr eateVector failed)"
#define LALRUNNINGMEDIANH_MSGENULL "Invalid input: NULL pointer." #define LALRUNNINGMEDIANH_MSGENULL "Invalid input: NULL pointer."
#define LALRUNNINGMEDIANH_MSGEZERO "Invalid input: block length must be > 2" #define LALRUNNINGMEDIANH_MSGEZERO "Invalid input: block length must be > 2"
#define LALRUNNINGMEDIANH_MSGELARGE "Invalid input: block length larger th an imput length" #define LALRUNNINGMEDIANH_MSGELARGE "Invalid input: block length larger th an imput length"
#define LALRUNNINGMEDIANH_MSGEIMED "Invalid input: wrong size of median a rray" #define LALRUNNINGMEDIANH_MSGEIMED "Invalid input: wrong size of median a rray"
/** \endcond */ /** \endcond */
/* Structures. */ /* Structures. */
/** This is the parameter structure for the LALRunningMedian functions. /**
Currently the only parameter supported is the blocksize, the number * This is the parameter structure for the LALRunningMedian functions.
of elements a single median is calculated from. The current * Currently the only parameter supported is the blocksize, the number
implementation requires the blocksize to be \< 2. * of elements a single median is calculated from. The current
*/ * implementation requires the blocksize to be \< 2.
*/
typedef struct tagLALRunningMedianPar typedef struct tagLALRunningMedianPar
{ {
UINT4 blocksize; /**< the number of elements a single median is calcu lated from */ UINT4 blocksize; /**< the number of elements a single median is calcu lated from */
} }
LALRunningMedianPar; LALRunningMedianPar;
/* Function prototypes. */ /* Function prototypes. */
/** See LALRunningMedian_h for documentation */ /** See LALRunningMedian_h for documentation */
void void
 End of changes. 2 change blocks. 
37 lines changed or deleted 42 lines changed or added


 LALStatusMacros.h   LALStatusMacros.h 
skipping to change at line 20 skipping to change at line 20
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with with program; see the file COPYING. If not, write to the * along with with program; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA * MA 02111-1307 USA
*/ */
// ---------- SEE LALStatusMacros.dox for doxygen documentation ---------- /* ---------- SEE LALStatusMacros.dox for doxygen documentation ---------- */
#ifndef _LALSTATUSMACROS_H #ifndef _LALSTATUSMACROS_H
#define _LALSTATUSMACROS_H #define _LALSTATUSMACROS_H
#include <lal/LALConfig.h> #include <lal/LALConfig.h>
#ifdef NDEBUG #ifdef NDEBUG
#ifndef LAL_NDEBUG #ifndef LAL_NDEBUG
#define LAL_NDEBUG #define LAL_NDEBUG
#endif #endif
#endif #endif
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 LALStdio.h   LALStdio.h 
skipping to change at line 21 skipping to change at line 21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with with program; see the file COPYING. If not, write to the * along with with program; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA * MA 02111-1307 USA
*/ */
/** /**
\addtogroup LALStdio_h * \addtogroup LALStdio_h
*
\brief Provides LAL functions similar to the non-file functions in <tt>< * \brief Provides LAL functions similar to the non-file functions in <tt><
stdio.h></tt>. stdio.h></tt>.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/LALStdio.h> * \code
#include <lal/FileIO.h> * #include <lal/LALStdio.h>
\endcode * #include <lal/FileIO.h>
* \endcode
*/ *
*/
#ifndef _LALSTDIO_H #ifndef _LALSTDIO_H
#define _LALSTDIO_H #define _LALSTDIO_H
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
#include <inttypes.h> #include <inttypes.h>
#include <lal/LALConfig.h> #include <lal/LALConfig.h>
#ifdef __cplusplus #ifdef __cplusplus
 End of changes. 1 change blocks. 
12 lines changed or deleted 13 lines changed or added


 LALStdlib.h   LALStdlib.h 
skipping to change at line 21 skipping to change at line 21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with with program; see the file COPYING. If not, write to the * along with with program; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA * MA 02111-1307 USA
*/ */
/** /**
\author J. D. E. Creighton, T. D. Creighton * \author J. D. E. Creighton, T. D. Creighton
\addtogroup LALStdlib_h * \addtogroup LALStdlib_h
*
\brief Includes the standard LAL header files. * \brief Includes the standard LAL header files.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/LALStdlib.h> * \code
\endcode * #include <lal/LALStdlib.h>
* \endcode
This header is the overall header for the \c std *
package. It provides the datatypes, constants, and macros required by * This header is the overall header for the \c std
most LAL functions, by including the following header files in the * package. It provides the datatypes, constants, and macros required by
\c std package: * most LAL functions, by including the following header files in the
* \c std package:
\code *
#include <lal/LALDatatypes.h> * \code
#include <lal/LALStatusMacros.h> * #include <lal/LALDatatypes.h>
\endcode * #include <lal/LALStatusMacros.h>
* \endcode
This header also includes function prototype headers for certain standard m *
odules used * This header also includes function prototype headers for certain standar
by many LAL routines: d modules used
* by many LAL routines:
\code *
#include <stdio.h> * \code
#include <stdarg.h> * #include <stdio.h>
#include <lal/LALMalloc.h> * #include <stdarg.h>
\endcode * #include <lal/LALMalloc.h>
* \endcode
*/ *
*/
#ifndef _LALSTDLIB_H #ifndef _LALSTDLIB_H
#define _LALSTDLIB_H #define _LALSTDLIB_H
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#include <lal/LALStatusMacros.h> #include <lal/LALStatusMacros.h>
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
#include <lal/LALMalloc.h> #include <lal/LALMalloc.h>
/* Redefine the restict keyword when compiling with C++ */
#ifdef __cplusplus
#undef restrict
#ifdef __GNUC__
#define restrict __restrict__
#else
#define restrict
#endif
#endif
#endif /* _LALSTDLIB_H */ #endif /* _LALSTDLIB_H */
 End of changes. 2 change blocks. 
41 lines changed or deleted 32 lines changed or added


 LALString.h   LALString.h 
skipping to change at line 37 skipping to change at line 37
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
char *XLALStringAppend(char *s, const char *append); char *XLALStringAppend(char *s, const char *append);
char *XLALStringDuplicate(const char *s); char *XLALStringDuplicate(const char *s);
size_t XLALStringCopy(char *dst, const char *src, size_t size); size_t XLALStringCopy(char *dst, const char *src, size_t size);
size_t XLALStringConcatenate(char *dst, const char *src, size_t size); size_t XLALStringConcatenate(char *dst, const char *src, size_t size);
int XLALStringToLowerCase(CHAR * string); int XLALStringToLowerCase(CHAR * string);
int XLALStringToUpperCase(CHAR * string);
#if 0 #if 0
{ /* so that editors will match succeeding brace */ { /* so that editors will match succeeding brace */
#elif defined(__cplusplus) #elif defined(__cplusplus)
} }
#endif #endif
#endif /* _LALSTRING_H */ #endif /* _LALSTRING_H */
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 LALVCSInfo.h   LALVCSInfo.h 
skipping to change at line 33 skipping to change at line 33
#define _LALVCSINFO_H #define _LALVCSINFO_H
#include <lal/LALLibVCSInfo.h> #include <lal/LALLibVCSInfo.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* vcs information defines */ /* vcs information defines */
#define LAL_NAME "LAL" #define LAL_NAME "LAL"
#define LAL_VCS_ID "93c2cc4647065f8954108d6fdb68b3497c5ee798" #define LAL_VCS_ID "8140347ea6fa4167d17e64e1fe0c0d3d151cf229"
#define LAL_VCS_DATE "2013-06-27 15:59:46 +0000" #define LAL_VCS_DATE "2014-01-07 21:41:44 +0000"
#define LAL_VCS_BRANCH "None" #define LAL_VCS_BRANCH "None"
#define LAL_VCS_TAG "lal-v6.11.0" #define LAL_VCS_TAG "lal-v6.12.0"
#define LAL_VCS_AUTHOR "Adam Mercer <adam.mercer@ligo.org>" #define LAL_VCS_AUTHOR "Adam Mercer <adam.mercer@ligo.org>"
#define LAL_VCS_COMMITTER "Adam Mercer <adam.mercer@ligo.org>" #define LAL_VCS_COMMITTER "Adam Mercer <adam.mercer@ligo.org>"
#define LAL_VCS_STATUS "CLEAN: All modifications committed" #define LAL_VCS_STATUS "CLEAN: All modifications committed"
/* vcs information defines - identable*/ /* vcs information defines - identable*/
#define LAL_VCS_IDENT_ID "$" "LALId: 93c2cc4647065f8954108d6fdb68b3497c5ee7 #define LAL_VCS_IDENT_ID "$" "LALId: 8140347ea6fa4167d17e64e1fe0c0d3d151cf2
98 " "$" 29 " "$"
#define LAL_VCS_IDENT_DATE "$" "LALDate: 2013-06-27 15:59:46 +0000 " "$" #define LAL_VCS_IDENT_DATE "$" "LALDate: 2014-01-07 21:41:44 +0000 " "$"
#define LAL_VCS_IDENT_BRANCH "$" "LALBranch: None " "$" #define LAL_VCS_IDENT_BRANCH "$" "LALBranch: None " "$"
#define LAL_VCS_IDENT_TAG "$" "LALTag: lal-v6.11.0 " "$" #define LAL_VCS_IDENT_TAG "$" "LALTag: lal-v6.12.0 " "$"
#define LAL_VCS_IDENT_AUTHOR "$" "LALAuthor: Adam Mercer <adam.mercer@ligo. org> " "$" #define LAL_VCS_IDENT_AUTHOR "$" "LALAuthor: Adam Mercer <adam.mercer@ligo. org> " "$"
#define LAL_VCS_IDENT_COMMITTER "$" "LALCommitter: Adam Mercer <adam.mercer @ligo.org> " "$" #define LAL_VCS_IDENT_COMMITTER "$" "LALCommitter: Adam Mercer <adam.mercer @ligo.org> " "$"
#define LAL_VCS_IDENT_STATUS "$" "LALStatus: CLEAN: All modifications commi tted " "$" #define LAL_VCS_IDENT_STATUS "$" "LALStatus: CLEAN: All modifications commi tted " "$"
/* header vcs information structure */ /* header vcs information structure */
static const struct tagLALVCSInfo lalHeaderVCSInfo = { \ static const struct tagLALVCSInfo lalHeaderVCSInfo = { \
LAL_NAME, \ LAL_NAME, \
LAL_VERSION, \ LAL_VERSION, \
LAL_VCS_ID, \ LAL_VCS_ID, \
LAL_VCS_DATE, \ LAL_VCS_DATE, \
 End of changes. 4 change blocks. 
7 lines changed or deleted 7 lines changed or added


 LALVersion.h   LALVersion.h 
skipping to change at line 32 skipping to change at line 32
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
\addtogroup LALVersion_h * \addtogroup LALVersion_h
*
\brief Provides routines for reporting the LAL version. * \brief Provides routines for reporting the LAL version.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/LALVersion.h> * \code
\endcode * #include <lal/LALVersion.h>
* \endcode
\section ss_globals Global variables *
* \section ss_globals Global variables
\code *
extern const char *lalVersion; * \code
extern const int lalVersionMajor; * extern const char *lalVersion;
extern const int lalVersionMinor; * extern const int lalVersionMajor;
extern const char *lalConfigureArgs; * extern const int lalVersionMinor;
extern const char *lalConfigureDate; * extern const char *lalConfigureArgs;
\endcode * extern const char *lalConfigureDate;
* \endcode
These constant variables are set at compile time and included into the LAL *
library. They contain the information about the version of LAL and the * These constant variables are set at compile time and included into the L
configuration information. AL
* library. They contain the information about the version of LAL and the
*//*@{ */ * configuration information.
*
/**\name Error Codes *//*@{ */ */
/*@{*/
/**\name Error Codes */ /*@{ */
#define LALVERSIONH_ENULL 1 /**< Null string pointer */ #define LALVERSIONH_ENULL 1 /**< Null string pointer */
#define LALVERSIONH_ESIZE 2 /**< Zero string size */ #define LALVERSIONH_ESIZE 2 /**< Zero string size */
#define LALVERSIONH_ESPRN 4 /**< Error in snprintf */ #define LALVERSIONH_ESPRN 4 /**< Error in snprintf */
#define LALVERSIONH_ESHRT 8 /**< String too short */ #define LALVERSIONH_ESHRT 8 /**< String too short */
/*@}*/ /*@}*/
/*@}*/
#define LALVERSIONH_MSGENULL "Null string pointer." #define LALVERSIONH_MSGENULL "Null string pointer."
#define LALVERSIONH_MSGESIZE "Zero string size." #define LALVERSIONH_MSGESIZE "Zero string size."
#define LALVERSIONH_MSGESPRN "Error in snprintf." #define LALVERSIONH_MSGESPRN "Error in snprintf."
#define LALVERSIONH_MSGESHRT "String too short." #define LALVERSIONH_MSGESHRT "String too short."
extern const char *const lalVersion; extern const char *const lalVersion;
extern const int lalVersionMajor; extern const int lalVersionMajor;
extern const int lalVersionMinor; extern const int lalVersionMinor;
extern const int lalVersionMicro; extern const int lalVersionMicro;
extern const int lalVersionDevel; extern const int lalVersionDevel;
extern const char *const lalBuildDate; extern const char *const lalBuildDate;
extern const char *const lalConfigureArgs; extern const char *const lalConfigureArgs;
extern const char *const lalConfigureDate; extern const char *const lalConfigureDate;
void LALVersion(LALStatus * status, CHAR * message, UINT4 size, void LALVersion(LALStatus * status, CHAR * message, UINT4 size,
INT4 verbose); INT4 verbose);
/*@}*/
#if 0 #if 0
{ /* so that editors will match succeeding brace */ { /* so that editors will match succeeding brace */
#elif defined(__cplusplus) #elif defined(__cplusplus)
} }
#endif #endif
#endif /* _LALVERSION_H */ #endif /* _LALVERSION_H */
 End of changes. 4 change blocks. 
27 lines changed or deleted 30 lines changed or added


 LogPrintf.h   LogPrintf.h 
skipping to change at line 44 skipping to change at line 44
/*---------- INCLUDES ----------*/ /*---------- INCLUDES ----------*/
#include <stdarg.h> #include <stdarg.h>
#include <gsl/gsl_matrix.h> #include <gsl/gsl_matrix.h>
/** /**
* \addtogroup LogPrintf_h * \addtogroup LogPrintf_h
* \author Reinhard Prix * \author Reinhard Prix
* \date 2005 * \date 2005
* \brief General-purpose log-message handling, controlled by lalDebugLevel independent of lalDebugLevel, * \brief General-purpose log-message handling, controlled by lalDebugLevel independent of lalDebugLevel,
* mostly modelled after the MSG_LOG class in BOINC. * mostly modelled after the MSG_LOG class in BOINC.
* *
*/ */
/*@{*/ /*@{*/
/*---------- DEFINES ----------*/ /*---------- DEFINES ----------*/
/*---------- TYPES ----------*/ /*---------- TYPES ----------*/
/** Argument-type for LogPrintf(): determines log-level of this message */ /** Argument-type for LogPrintf(): determines log-level of this message */
typedef enum typedef enum
{ {
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 Matrix.h   Matrix.h 
skipping to change at line 39 skipping to change at line 39
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* \addtogroup Matrix_h * \addtogroup Matrix_h
* \author Matthew M. Tibbits * \author Matthew M. Tibbits
* *
* \brief Matlab Routines to handle Matrices \& Vectors. * \brief Matlab Routines to handle Matrices \& Vectors.
* *
* \heading{Synopsis} * ### Synopsis ###
*
* \code * \code
* #include <lal/Matrix.h> * #include <lal/Matrix.h>
* \endcode * \endcode
* *
* @{ * @{
* \defgroup MatrixMultiply_c Module MatrixMultiply.c * \defgroup MatrixMultiply_c Module MatrixMultiply.c
* \defgroup MatrixDivide_c Module MatrixDivide.c * \defgroup MatrixDivide_c Module MatrixDivide.c
* \defgroup MatrixPower_c Module MatrixPower.c * \defgroup MatrixPower_c Module MatrixPower.c
* \defgroup MiscMatlab_c Module MiscMatlab.c * \defgroup MiscMatlab_c Module MiscMatlab.c
* *
*/ */
/**\name Error Codes */ /**\name Error Codes */
/*@{*/ /*@{*/
#define MATLABMATRIXH_EARG 1 /**< Error parsing command-line argu ments */ #define MATLABMATRIXH_EARG 1 /**< Error parsing command-line argu ments */
#define MATLABMATRIXH_ECHK 2 /**< Error checking failed to catch bad data */ #define MATLABMATRIXH_ECHK 2 /**< Error checking failed to catch bad data */
#define MATLABMATRIXH_EFLS 3 /**< Incorrect answer for valid data */ #define MATLABMATRIXH_EFLS 3 /**< Incorrect answer for valid data */
#define MATLABMATRIXH_EUSE 4 /**< Bad user-entered data */ #define MATLABMATRIXH_EUSE 4 /**< Bad user-entered data */
#define MATLABMATRIXH_ENULL 5 /**< Null Pointer */ #define MATLABMATRIXH_ENULL 5 /**< Null Pointer */
#define MATLABMATRIXH_EALOC 6 /**< Memory Allocation Error */ #define MATLABMATRIXH_EALOC 6 /**< Memory Allocation Error */
#define MATLABMATRIXH_EFPMS 7 /**< Filter Parameter Structure Erro r */ #define MATLABMATRIXH_EFPMS 7 /**< Filter Parameter Structure Erro r */
skipping to change at line 83 skipping to change at line 84
#define MATLABMATRIXH_MSGENULL "Null Pointer." #define MATLABMATRIXH_MSGENULL "Null Pointer."
#define MATLABMATRIXH_MSGEALOC "Memory Allocation Error" #define MATLABMATRIXH_MSGEALOC "Memory Allocation Error"
#define MATLABMATRIXH_MSGEFPMS "Filter Parameter Structure Error" #define MATLABMATRIXH_MSGEFPMS "Filter Parameter Structure Error"
#define MATLABMATRIXH_MSGENUMZ "Incorrect number of command line arguments" #define MATLABMATRIXH_MSGENUMZ "Incorrect number of command line arguments"
#define MATLABMATRIXH_MSGELNTH "Vector/Array of Improper Length" #define MATLABMATRIXH_MSGELNTH "Vector/Array of Improper Length"
#define MATLABMATRIXH_MSGENNUL "Non-Null Pointer that should be NULL" #define MATLABMATRIXH_MSGENNUL "Non-Null Pointer that should be NULL"
/** \endcond */ /** \endcond */
/* ---------- Function prototypes ---------- */ /* ---------- Function prototypes ---------- */
/** /**
\addtogroup MatrixMultiply_c * \addtogroup MatrixMultiply_c
\author Tibbits, M. M. * \author Tibbits, M. M.
*
\brief This file is dedicated to reproducing the matlab function ".*" . * \brief This file is dedicated to reproducing the matlab function ".*" .
*
This file has several declarations of the same function taking all forms of * This file has several declarations of the same function taking all forms
available of available
input. This being said, I have yet to script the complex actions and their * input. This being said, I have yet to script the complex actions and th
counterparts. eir
* counterparts.
\heading{Description} *
* ### Description ###
This file is to help make the conversion from Matlab to c much earier. *
In this file, we have created all of the versions of .* that we plan on * This file is to help make the conversion from Matlab to c much earier.
using. * In this file, we have created all of the versions of .* that we plan on
* using.
\heading{Algorithms} *
* ### Algorithms ###
The algorithm is the same as it is in matlab. The dot in front of an opera *
tor * The algorithm is the same as it is in matlab. The dot in front of an op
in matlab signifies that if either or both of the operands are vectors, the erator
n * in matlab signifies that if either or both of the operands are vectors,
the operation will be carried out member by member. For instance then
* the operation will be carried out member by member. For instance
\code *
vector a[25]; * \code
vector b[25]; * vector a[25];
vector c[25]; * vector b[25];
* vector c[25];
c = a .* b; *
* c = a .* b;
The result of this is: *
* The result of this is:
c[0] = a[0] * b[0]; *
c[1] = a[1] * b[1]; * c[0] = a[0] * b[0];
. . . * c[1] = a[1] * b[1];
. . . * . . .
. . . * . . .
* . . .
etc. *
\endcode * etc.
* \endcode
\heading{Notes} *
* ### Notes ###
At the current time none of the operations have been specified for neither *
the * At the current time none of the operations have been specified for neith
complex datatypes nor the unsigned datatypes. er the
* complex datatypes nor the unsigned datatypes.
*/ *
*/
/*@{*/ /*@{*/
void LALDDotStarDVector ( void LALDDotStarDVector (
LALStatus *status, LALStatus *status,
REAL8Vector **result, REAL8Vector **result,
REAL8 B, REAL8 B,
REAL8Vector *A REAL8Vector *A
); );
void LALDVectorDotStarDVector ( void LALDVectorDotStarDVector (
LALStatus *status, LALStatus *status,
skipping to change at line 551 skipping to change at line 552
void LALI8ArrayDotStarI8Array ( void LALI8ArrayDotStarI8Array (
LALStatus *status, LALStatus *status,
INT8Array **result, INT8Array **result,
INT8Array *A, INT8Array *A,
INT8Array *B INT8Array *B
); );
/*@}*/ /* end: MatrixMultiply_c */ /*@}*/ /* end: MatrixMultiply_c */
/** /**
\addtogroup MatrixDivide_c * \addtogroup MatrixDivide_c
\author Tibbits, M. M. * \author Tibbits, M. M.
*
\brief This file is dedicated to reproducing the matlab function "./" . * \brief This file is dedicated to reproducing the matlab function "./" .
*
This file has several declarations of the same function taking all forms of * This file has several declarations of the same function taking all forms
available of available
input. This being said, I have yet to script the complex actions and their * input. This being said, I have yet to script the complex actions and th
counterparts. eir
* counterparts.
\heading{Description} *
* ### Description ###
This file is to help make the conversion from Matlab to c much earier. *
In this file, we have created all of the versions of ./ that we plan on * This file is to help make the conversion from Matlab to c much earier.
using. * In this file, we have created all of the versions of ./ that we plan on
* using.
\heading{Algorithms} *
* ### Algorithms ###
The algorithm is the same as it is in matlab. The dot in front of an opera *
tor * The algorithm is the same as it is in matlab. The dot in front of an op
in matlab signifies that if either or both of the operands are vectors, the erator
n * in matlab signifies that if either or both of the operands are vectors,
the operation will be carried out member by member. For instance then
* the operation will be carried out member by member. For instance
\code *
vector a[25]; * \code
vector b[25]; * vector a[25];
vector c[25]; * vector b[25];
* vector c[25];
c = a ./ b; *
* c = a ./ b;
The result of this is: *
* The result of this is:
c[0] = a[0] / b[0]; *
c[1] = a[1] / b[1]; * c[0] = a[0] / b[0];
. . . * c[1] = a[1] / b[1];
. . . * . . .
. . . * . . .
* . . .
etc. *
\endcode * etc.
* \endcode
\heading{Notes} *
* ### Notes ###
At the current time none of the operations have been specified for neither *
the * At the current time none of the operations have been specified for neith
complex datatypes nor the unsigned datatypes. er the
* complex datatypes nor the unsigned datatypes.
*/ *
*/
/*@{*/ /*@{*/
void LALDDotSlashDVector ( void LALDDotSlashDVector (
LALStatus *status, LALStatus *status,
REAL8Vector **result, REAL8Vector **result,
REAL8 A, REAL8 A,
REAL8Vector *B REAL8Vector *B
); );
void LALDVectorDotSlashD ( void LALDVectorDotSlashD (
LALStatus *status, LALStatus *status,
skipping to change at line 1230 skipping to change at line 1231
void LALI8ArrayDotSlashI8Array ( void LALI8ArrayDotSlashI8Array (
LALStatus *status, LALStatus *status,
INT8Array **result, INT8Array **result,
INT8Array *A, INT8Array *A,
INT8Array *B INT8Array *B
); );
/*@}*/ /* end: MatrixDivide_c */ /*@}*/ /* end: MatrixDivide_c */
/** /**
\addtogroup MatrixPower_c * \addtogroup MatrixPower_c
\author Tibbits, M. M. * \author Tibbits, M. M.
*
\brief This file is dedicated to reproducing the matlab function ".^" . * \brief This file is dedicated to reproducing the matlab function ".^" .
*
This file has several declarations of the same function taking all forms of * This file has several declarations of the same function taking all forms
available of available
input. This being said, I have yet to script the complex actions and their * input. This being said, I have yet to script the complex actions and th
counterparts. eir
* counterparts.
\heading{Description} *
* ### Description ###
This file is to help make the conversion from Matlab to c much earier. *
In this file, we have created all of the versions of .^ that we plan on * This file is to help make the conversion from Matlab to c much earier.
using. * In this file, we have created all of the versions of .^ that we plan on
* using.
\heading{Algorithms} *
* ### Algorithms ###
The algorithm is the same as it is in matlab. The dot in front of an opera *
tor * The algorithm is the same as it is in matlab. The dot in front of an op
in matlab signifies that if either or both of the operands are vectors, the erator
n * in matlab signifies that if either or both of the operands are vectors,
the operation will be carried out member by member. For instance then
* the operation will be carried out member by member. For instance
\code *
vector a[25]; * \code
vector b[25]; * vector a[25];
vector c[25]; * vector b[25];
* vector c[25];
c = a .^ b; *
* c = a .^ b;
The result of this is: *
* The result of this is:
\(c[0] = a[0]^(b[0]); *
\(c[1] = a[1]^(b[1]); * \(c[0] = a[0]^(b[0]);
. . . * \(c[1] = a[1]^(b[1]);
. . . * . . .
. . . * . . .
* . . .
etc. *
\endcode * etc.
* \endcode
\heading{Notes} *
* ### Notes ###
At the current time none of the operations have been specified for neither *
the * At the current time none of the operations have been specified for neith
complex datatypes nor the unsigned datatypes. er the
* complex datatypes nor the unsigned datatypes.
*/ *
*/
/*@{*/ /*@{*/
void LALDDotPowerDVector ( void LALDDotPowerDVector (
LALStatus *status, LALStatus *status,
REAL8Vector **result, REAL8Vector **result,
REAL8 A, REAL8 A,
REAL8Vector *B REAL8Vector *B
); );
void LALDVectorDotPowerD ( void LALDVectorDotPowerD (
LALStatus *status, LALStatus *status,
skipping to change at line 1908 skipping to change at line 1909
void LALI8ArrayDotPowerI8Array ( void LALI8ArrayDotPowerI8Array (
LALStatus *status, LALStatus *status,
REAL8Array **result, REAL8Array **result,
INT8Array *A, INT8Array *A,
INT8Array *B INT8Array *B
); );
/*@}*/ /* end: MatrixPower_c */ /*@}*/ /* end: MatrixPower_c */
/** /**
\addtogroup MiscMatlab_c * \addtogroup MiscMatlab_c
\author Tibbits, M. M. * \author Tibbits, M. M.
*
\brief This file reproduces the last few matlab functions that we needed fo * \brief This file reproduces the last few matlab functions that we needed
r our purposes. for our purposes.
*
It creates useable forms of cumsum, sum, max, and finally an implemenation * It creates useable forms of cumsum, sum, max, and finally an implemenati
of the on of the
array addressing in matlab. Matlab has an easy of inverting a vector, (end * array addressing in matlab. Matlab has an easy of inverting a vector, (
: -1: 1) end: -1: 1)
and the final function, FlipVector returns a result vector that has been fl * and the final function, FlipVector returns a result vector that has been
ipped in flipped in
that same manner. * that same manner.
*
\heading{Description} * ### Description ###
*
This file reproduces the last few matlab functions that we needed for our p * This file reproduces the last few matlab functions that we needed for ou
urposes. r purposes.
It creates useable forms of cumsum, sum, max, and finally an implemenation * It creates useable forms of cumsum, sum, max, and finally an implemenati
of the on of the
array addressing in matlab. Matlab has an easy of inverting a vector, (end * array addressing in matlab. Matlab has an easy of inverting a vector, (
: -1: 1) end: -1: 1)
and the final function, FlipVector returns a result vector that has been fl * and the final function, FlipVector returns a result vector that has been
ipped in flipped in
that same manner. * that same manner.
*
\heading{Algorithms} * ### Algorithms ###
*
The algorithms are the same as in matlab. Flip vector was discussed above. * The algorithms are the same as in matlab. Flip vector was discussed abo
Sum ve. Sum
takes the sum of all of the elements in a vector. Cum sum takes an input v * takes the sum of all of the elements in a vector. Cum sum takes an inpu
ector: t vector:
\code * \code
vector input[25]; * vector input[25];
vector output[25]; * vector output[25];
*
output[0] = input[0]; * output[0] = input[0];
output[1] = input[0] + input[1]; * output[1] = input[0] + input[1];
output[2] = input[0] + input[1] + input[2]; * output[2] = input[0] + input[1] + input[2];
*
etc * etc
\endcode * \endcode
*
\heading{Notes} * ### Notes ###
*
At the current time none of the operations have been specified for neither * At the current time none of the operations have been specified for neith
the er the
complex datatypes nor the unsigned datatypes. * complex datatypes nor the unsigned datatypes.
*
Also, the prototypes are out of order as I have used m4 to create all of th * Also, the prototypes are out of order as I have used m4 to create all of
e the
functions from one codebase. * functions from one codebase.
*
*/ */
/*@{*/ /*@{*/
void LALDCumSum ( void LALDCumSum (
LALStatus *status, LALStatus *status,
REAL8Vector **result, REAL8Vector **result,
REAL8Vector *data REAL8Vector *data
); );
void LALDSum ( void LALDSum (
LALStatus *status, LALStatus *status,
REAL8 *result, REAL8 *result,
 End of changes. 6 change blocks. 
203 lines changed or deleted 207 lines changed or added


 MatrixUtils.h   MatrixUtils.h 
skipping to change at line 30 skipping to change at line 30
#ifndef _MATRIXUTILS_H #ifndef _MATRIXUTILS_H
#define _MATRIXUTILS_H #define _MATRIXUTILS_H
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup MatrixUtils_h * \addtogroup MatrixUtils_h
\author Creighton, T. D. * \author Creighton, T. D.
*
\brief Provides routines to solve linear systems. * \brief Provides routines to solve linear systems.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/MatrixUtils.h> * \code
\endcode * #include <lal/MatrixUtils.h>
* \endcode
This header covers routines to solve linear systems of equations and *
eigensystems, using algorithms adapted from Chapters~2 and~11 of * This header covers routines to solve linear systems of equations and
Numerical Recipes [\ref ptvf1992]. The only routines at present are * eigensystems, using algorithms adapted from Chapters~2 and~11 of
for computing eigenvalues and eigenvectors of real symmetric matrices. * Numerical Recipes \cite ptvf1992. The only routines at present are
Routines for inverting or computing the determinant of arbitrary * for computing eigenvalues and eigenvectors of real symmetric matrices.
square matrices will likely follow. * Routines for inverting or computing the determinant of arbitrary
* square matrices will likely follow.
\heading{Notation} *
* ### Notation ###
A \e matrix is represented in LAL by a <tt>\<datatype\>Array</tt> *
structure with a <tt>dimLength-\>length</tt> field of 2; the * A \e matrix is represented in LAL by a <tt>\<datatype\>Array</tt>
<tt>dimLength-\>data</tt> field gives the dimensions \f$[M,N]\f$ of the * structure with a <tt>dimLength-\>length</tt> field of 2; the
matrix. Using the place-index notation common in tensor calculus, a * <tt>dimLength-\>data</tt> field gives the dimensions \f$[M,N]\f$ of the
matrix is a two-index tensor: * matrix. Using the place-index notation common in tensor calculus, a
\f{equation}{ * matrix is a two-index tensor:
\mathsf{A}^a{}_b = \left[\begin{array}{cccc} * \f{equation}{
A^1{}_1 & A^1{}_2 & \cdots & A^1{}_N \\ * \mathsf{A}^a{}_b = \left[\begin{array}{cccc}
A^2{}_1 & A^2{}_2 & \cdots & A^2{}_N \\ * A^1{}_1 & A^1{}_2 & \cdots & A^1{}_N \\
\vdots & \vdots & \ddots & \vdots \\ * A^2{}_1 & A^2{}_2 & \cdots & A^2{}_N \\
A^M{}_1 & A^M{}_2 & \cdots & A^M{}_N * \vdots & \vdots & \ddots & \vdots \\
\end{array}\right] \;, * A^M{}_1 & A^M{}_2 & \cdots & A^M{}_N
\f} * \end{array}\right] \;,
that is, the first (raised) index represents the row number and the * \f}
second (lowered) index the column number. The standard C array * that is, the first (raised) index represents the row number and the
structure declares this object as, say, <tt>float a[M][N]</tt>, where * second (lowered) index the column number. The standard C array
the element \f$A^i{}_j\f$ is stored in <tt>a[i][j]</tt>. The LAL array * structure declares this object as, say, <tt>float a[M][N]</tt>, where
structure <tt>REAL4Array a</tt> stores data in a flattened block of * the element \f$A^i{}_j\f$ is stored in <tt>a[i][j]</tt>. The LAL array
memory, where the element \f$A^i{}_j\f$ is stored in <tt>a.data[i*M+j]</tt> * structure <tt>REAL4Array a</tt> stores data in a flattened block of
. * memory, where the element \f$A^i{}_j\f$ is stored in <tt>a.data[i*M+j]</
tt>.
A <em>row vector</em> is a matrix with only one row (\f$M=1\f$). In the *
above place-index notation, it is represented with a single lowered * A <em>row vector</em> is a matrix with only one row (\f$M=1\f$). In the
index: * above place-index notation, it is represented with a single lowered
\f{equation}{ * index:
\mathsf{r}_a = \left[\begin{array}{cccc} r_1 & r_2 & \cdots & r_N * \f{equation}{
\end{array}\right] \;. * \mathsf{r}_a = \left[\begin{array}{cccc} r_1 & r_2 & \cdots & r_N
\f} * \end{array}\right] \;.
A <em>column vector</em> is a matrix with only one column (\f$N=1\f$). In * \f}
the above place-index notation, it is represented with a single raised * A <em>column vector</em> is a matrix with only one column (\f$N=1\f$).
index: In
\f{equation}{ * the above place-index notation, it is represented with a single raised
\mathsf{c}^a = \left[\begin{array}{c} c^1 \\ c^2 \\ \vdots \\ c^M * index:
\end{array}\right] \;. * \f{equation}{
\f} * \mathsf{c}^a = \left[\begin{array}{c} c^1 \\ c^2 \\ \vdots \\ c^M
In LAL, both of these objects are conventionally represented as a LAL * \end{array}\right] \;.
vector structure. Whether the object is to be used as a row or column * \f}
vector must be determined from context; it is not specified by the * In LAL, both of these objects are conventionally represented as a LAL
datatype. * vector structure. Whether the object is to be used as a row or column
* vector must be determined from context; it is not specified by the
\heading{Properties} * datatype.
*
The basic matrix operations are addition, scalar multiplication, and * ### Properties ###
vector multiplication. We assume the reader is familiar with these. *
In addition, we will refer to the following unary operations on * The basic matrix operations are addition, scalar multiplication, and
\e square matrices: * vector multiplication. We assume the reader is familiar with these.
* In addition, we will refer to the following unary operations on
\e Inversion: The inverse \f$(\mathsf{A}^{-1}){}^a{}_b\f$ of a * \e square matrices:
matrix \f$\mathsf{A}^a{}_b\f$ is one such that their matrix product is the *
identity matrix \f$\delta^a{}_b\f$ (whose elements \f$\delta^i{}_j\f$ are j * \e Inversion: The inverse \f$(\mathsf{A}^{-1}){}^a{}_b\f$ of a
ust * matrix \f$\mathsf{A}^a{}_b\f$ is one such that their matrix product is t
the Kronecker delta function). he
* identity matrix \f$\delta^a{}_b\f$ (whose elements \f$\delta^i{}_j\f$ ar
\e Transposition: The transpose \f$(\mathsf{A}^T){}^a{}_b\f$ of a e just
matrix \f$\mathsf{A}^a{}_b\f$ is given by interchanging the indecies on * the Kronecker delta function).
each component: \f$(A^T){}^i{}_j=A^j{}_i\f$. *
* \e Transposition: The transpose \f$(\mathsf{A}^T){}^a{}_b\f$ of a
\e Conjugation: The Hermitian conjugate (adjoint) * matrix \f$\mathsf{A}^a{}_b\f$ is given by interchanging the indecies on
\f$(\mathsf{A}^\dag){}^a{}_b\f$ of a matrix \f$\mathsf{A}^a{}_b\f$ is given * each component: \f$(A^T){}^i{}_j=A^j{}_i\f$.
by *
interchanging the indecies and taking the complex conjugate of each * \e Conjugation: The Hermitian conjugate (adjoint)
component: \f$(A^\dag){}^i{}_j={A^j{}_i}^*\f$. * \f$(\mathsf{A}^\dag){}^a{}_b\f$ of a matrix \f$\mathsf{A}^a{}_b\f$ is gi
ven by
A matrix that is identical to its own transpose is called * interchanging the indecies and taking the complex conjugate of each
\e symmetric. A matrix whose transpose is identical to the * component: \f$(A^\dag){}^i{}_j={A^j{}_i}^*\f$.
original matrix's inverse is called \e orthogonal. A matrix that *
is identical to its own Hermitian conjugate is called \e Hermitian * A matrix that is identical to its own transpose is called
(or <em>self-adjoint</em>. A matrix whose Hermitian conjugate is * \e symmetric. A matrix whose transpose is identical to the
identical to the original matrix's inverse is called \e unitary. * original matrix's inverse is called \e orthogonal. A matrix that
* is identical to its own Hermitian conjugate is called \e Hermitian
At present, the routines under this header only deal with \e real * (or <em>self-adjoint</em>. A matrix whose Hermitian conjugate is
matrices (i.e.\ matrices, vectors, and scalars whose components are * identical to the original matrix's inverse is called \e unitary.
all real). In this case, symmetric is equivalent to Hermitian, and *
orthogonal is equivalent to unitary. * At present, the routines under this header only deal with \e real
* matrices (i.e.\ matrices, vectors, and scalars whose components are
*/ * all real). In this case, symmetric is equivalent to Hermitian, and
* orthogonal is equivalent to unitary.
*
*/
/*@{*/ /*@{*/
/** \name Error Codes */ /** \name Error Codes */
/*@{*/ /*@{*/
#define MATRIXUTILSH_ENUL 1 /**< Unexpected null pointer in argu ments */ #define MATRIXUTILSH_ENUL 1 /**< Unexpected null pointer in argu ments */
#define MATRIXUTILSH_EDIM 2 /**< Bad matrix dimensions */ #define MATRIXUTILSH_EDIM 2 /**< Bad matrix dimensions */
#define MATRIXUTILSH_EITER 3 /**< Did not converge after maximum iterations */ #define MATRIXUTILSH_EITER 3 /**< Did not converge after maximum iterations */
#define MATRIXUTILSH_ESING 4 /**< Singular matrix */ #define MATRIXUTILSH_ESING 4 /**< Singular matrix */
#define MATRIXUTILSH_EMEM 5 /**< Memory allocation error */ #define MATRIXUTILSH_EMEM 5 /**< Memory allocation error */
/*@}*/ /*@}*/
 End of changes. 1 change blocks. 
95 lines changed or deleted 98 lines changed or added


 ODE.h   ODE.h 
skipping to change at line 37 skipping to change at line 37
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
* \addtogroup ODE_h * \addtogroup ODE_h
* \author J. D. E. Creighton * \author J. D. E. Creighton
* *
* \brief Routines for solving ordinary differential equations (ODEs). * \brief Routines for solving ordinary differential equations (ODEs).
* *
* \heading{Synopsis} * ### Synopsis ###
*
* \code * \code
* #include <lal/ODE.h> * #include <lal/ODE.h>
* \endcode * \endcode
* *
* These routines solve ordinary differential equations (ODEs) of the form: * These routines solve ordinary differential equations (ODEs) of the form:
* \f[ * \f[
* \dot{\mathbf{x}} = {\mathbf{f}}({\mathbf{x}},t,\ldots) * \dot{\mathbf{x}} = {\mathbf{f}}({\mathbf{x}},t,\ldots)
* \f] * \f]
* where \f$\mathbf{f}\f$ is a specified vector-valued function. * where \f$\mathbf{f}\f$ is a specified vector-valued function.
* *
*/ */
/*@{*/ /*@{*/
/**\name Error Codes */ /**\name Error Codes */
/*@{*/ /*@{*/
#define ODEH_ENULL 001 /**< Null pointer. */ #define ODEH_ENULL 001 /**< Null pointer. */
#define ODEH_ESAME 002 /**< Same data pointer. */ #define ODEH_ESAME 002 /**< Same data pointer. */
#define ODEH_ESIZE 004 /**< Invalid size. */ #define ODEH_ESIZE 004 /**< Invalid size. */
#define ODEH_ESZMM 010 /**< Size mismatch. */ #define ODEH_ESZMM 010 /**< Size mismatch. */
#define ODEH_ENSTP 020 /**< Step number mismatch. */ #define ODEH_ENSTP 020 /**< Step number mismatch. */
/*@}*/ /*@}*/
 End of changes. 3 change blocks. 
3 lines changed or deleted 4 lines changed or added


 PrintFTSeries.h   PrintFTSeries.h 
skipping to change at line 30 skipping to change at line 30
#ifndef _PRINTFTSERIES_H #ifndef _PRINTFTSERIES_H
#define _PRINTFTSERIES_H #define _PRINTFTSERIES_H
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup PrintFTSeries_h * \addtogroup PrintFTSeries_h
\author J. T. Whelan <jtwhelan@loyno.edu> * \author J. T. Whelan <jtwhelan@loyno.edu>
*
\brief This is a simple utility to print time and frequency series into * \brief This is a simple utility to print time and frequency series into
a file. a file.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/PrintFTSeries.h> * \code
\endcode * #include <lal/PrintFTSeries.h>
* \endcode
Provides prototype information for the routines in \ref PrintTimeSeries_ *
c and \ref PrintFrequencySeries_c. * Provides prototype information for the routines in \ref PrintTimeSeries_
c and \ref PrintFrequencySeries_c.
*/ *
*/
/*@{*/ /*@{*/
/** \defgroup PrintTimeSeries_c Module PrintTimeSeries.c /**
* \defgroup PrintTimeSeries_c Module PrintTimeSeries.c
Print a \<datatype\>TimeSeries object into a * Print a \<datatype\>TimeSeries object into a
file. For use in non-production and test code only. * file. For use in non-production and test code only.
*
\heading{Description} * ### Description ###
*
Each member of this family of functions prints the elements of * Each member of this family of functions prints the elements of
\f$\langle\mbox{datatype}\rangle\f$\c TimeSeries into a file. Note: * \f$\langle\mbox{datatype}\rangle\f$\c TimeSeries into a file. Note:
the file name is specified using a character string. This function is * the file name is specified using a character string. This function is
for debugging use only: its arguments do not conform to LAL standards * for debugging use only: its arguments do not conform to LAL standards
so it should not be used in any real analysis codes. * so it should not be used in any real analysis codes.
*
\heading{Notes} * ### Notes ###
*
This function's arguments do not conform to the LAL spec. For this * This function's arguments do not conform to the LAL spec. For this
reason it should only be used for debugging purposes in test * reason it should only be used for debugging purposes in test
functions, not in any production code. * functions, not in any production code.
*
Additionally, since printf cannot handle INT8 as integers, the * Additionally, since printf cannot handle INT8 as integers, the
functions <tt>LALI8PrintTimeSeries()</tt> and * functions <tt>LALI8PrintTimeSeries()</tt> and
<tt>LALU8PrintTimeSeries()</tt> use a typecast to REAL8 and are thus * <tt>LALU8PrintTimeSeries()</tt> use a typecast to REAL8 and are thus
only valid for numbers between around \f$-10^{15}\f$ and \f$10^{15}\f$. * only valid for numbers between around \f$-10^{15}\f$ and \f$10^{15}\f$.
*
The first five lines of the file are a header containing: * The first five lines of the file are a header containing:
<ol> * <ol>
<li> the name of the series</li> * <li> the name of the series</li>
<li> the starting epoch </li> * <li> the starting epoch </li>
<li> the units expressed in terms of the basic SI units</li> * <li> the units expressed in terms of the basic SI units</li>
<li> column labels</li> * <li> column labels</li>
</ol> * </ol>
after which come the data, one per line. * after which come the data, one per line.
*
The output format is two or three tab-separated columns: the first * The output format is two or three tab-separated columns: the first
column is the time corresponding to the row in question, in seconds * column is the time corresponding to the row in question, in seconds
after the series' starting epoch; for real and integer time * after the series' starting epoch; for real and integer time
series, the second column is the value of the series; for complex time * series, the second column is the value of the series; for complex time
series, the second column is the real part and the third the imaginary * series, the second column is the real part and the third the imaginary
part of the value. * part of the value.
*/ */
/*@{*/ /*@{*/
void LALI2PrintTimeSeries( INT2TimeSeries *series , const CHAR *filename ); void LALI2PrintTimeSeries( INT2TimeSeries *series , const CHAR *filename );
void LALI4PrintTimeSeries( INT4TimeSeries *series , const CHAR *filename ); void LALI4PrintTimeSeries( INT4TimeSeries *series , const CHAR *filename );
void LALI8PrintTimeSeries( INT8TimeSeries *series , const CHAR *filename ); void LALI8PrintTimeSeries( INT8TimeSeries *series , const CHAR *filename );
void LALU2PrintTimeSeries( UINT2TimeSeries *series , const CHAR *filename ) ; void LALU2PrintTimeSeries( UINT2TimeSeries *series , const CHAR *filename ) ;
void LALU4PrintTimeSeries( UINT4TimeSeries *series , const CHAR *filename ) ; void LALU4PrintTimeSeries( UINT4TimeSeries *series , const CHAR *filename ) ;
void LALU8PrintTimeSeries( UINT8TimeSeries *series , const CHAR *filename ) ; void LALU8PrintTimeSeries( UINT8TimeSeries *series , const CHAR *filename ) ;
void LALPrintTimeSeries( REAL4TimeSeries *series , const CHAR *filename ); void LALPrintTimeSeries( REAL4TimeSeries *series , const CHAR *filename );
void LALSPrintTimeSeries( REAL4TimeSeries *series , const CHAR *filename ); void LALSPrintTimeSeries( REAL4TimeSeries *series , const CHAR *filename );
void LALDPrintTimeSeries( REAL8TimeSeries *series , const CHAR *filename ); void LALDPrintTimeSeries( REAL8TimeSeries *series , const CHAR *filename );
void LALCPrintTimeSeries( COMPLEX8TimeSeries *series , const CHAR *filename ); void LALCPrintTimeSeries( COMPLEX8TimeSeries *series , const CHAR *filename );
void LALZPrintTimeSeries( COMPLEX16TimeSeries *series , const CHAR *filenam e ); void LALZPrintTimeSeries( COMPLEX16TimeSeries *series , const CHAR *filenam e );
/*@}*/ /*@}*/
/** \defgroup PrintFrequencySeries_c Module PrintFrequencySeries.c /**
* \defgroup PrintFrequencySeries_c Module PrintFrequencySeries.c
Print a \<datatype\>FrequencySeries object into a *
file. For use in non-production and test code only. * Print a \<datatype\>FrequencySeries object into a
* file. For use in non-production and test code only.
\heading{Description} *
* ### Description ###
Each member of this family of functions prints the elements of *
\<datatype\>FrequencySeries into a file. * Each member of this family of functions prints the elements of
Note: the file name is specified using a character string. This * \<datatype\>FrequencySeries into a file.
function is for debugging use only: its arguments do not conform to * Note: the file name is specified using a character string. This
LAL standards so it should not be used in any real analysis codes. * function is for debugging use only: its arguments do not conform to
* LAL standards so it should not be used in any real analysis codes.
\heading{Notes} *
* ### Notes ###
This function's arguments do not conform to the LAL spec. For this *
reason it should only be used for debugging purposes in test * This function's arguments do not conform to the LAL spec. For this
functions, not in any production code. * reason it should only be used for debugging purposes in test
* functions, not in any production code.
Additionally, since printf cannot handle INT8 as integers, the *
functions <tt>LALI8PrintFrequencySeries()</tt> and * Additionally, since printf cannot handle INT8 as integers, the
<tt>LALU8PrintFrequencySeries()</tt> use a typecast to REAL8 and are * functions <tt>LALI8PrintFrequencySeries()</tt> and
thus only valid for numbers between around \f$-10^{15}\f$ and \f$10^{15}\f$ * <tt>LALU8PrintFrequencySeries()</tt> use a typecast to REAL8 and are
. * thus only valid for numbers between around \f$-10^{15}\f$ and \f$10^{15}
\f$.
The first four lines of the file are a header containing: *
<ol> * The first four lines of the file are a header containing:
<li> the name of the series</li> * <ol>
<li> heterodyning information, if any</li> * <li> the name of the series</li>
<li> the starting epoch, relative to the GPS reference epoch (1980 January * <li> heterodyning information, if any</li>
6)</li> * <li> the starting epoch, relative to the GPS reference epoch (1980 Janua
<li> the units expressed in terms of the basic SI units</li> ry 6)</li>
<li> column labels</li> * <li> the units expressed in terms of the basic SI units</li>
</ol> * <li> column labels</li>
after which come the data, one per line. * </ol>
* after which come the data, one per line.
The output format is two or three tab-separated columns: the first *
column is the frequency in hertz corresponding to the row in question; * The output format is two or three tab-separated columns: the first
for real and integer frequency series, the second column is the value * column is the frequency in hertz corresponding to the row in question;
of the series; for complex frequency series, the second column is the * for real and integer frequency series, the second column is the value
real part and the third the imaginary part of the value. * of the series; for complex frequency series, the second column is the
* real part and the third the imaginary part of the value.
Note that the frequency given is the physical frequency. In the case *
of a heterodyned frequency series, this is the heterodyning frequency * Note that the frequency given is the physical frequency. In the case
plus the frequency offset. A frequency series of length \f$[N]\f$ is * of a heterodyned frequency series, this is the heterodyning frequency
assumed to be packed so that the 0th element corresponds to zero * plus the frequency offset. A frequency series of length \f$[N]\f$ is
frequency offset, elements 1 through \f$[N/2]\f$ to positive frequency * assumed to be packed so that the 0th element corresponds to zero
offsets (in ascending order), and elements \f$N-[N/2]\f$ to \f$N-1\f$ to * frequency offset, elements 1 through \f$[N/2]\f$ to positive frequency
negative frequency offsets (also in ascending order, so that the * offsets (in ascending order), and elements \f$N-[N/2]\f$ to \f$N-1\f$ to
frequency corresponding to the \f$N-1\f$st element is just below that of * negative frequency offsets (also in ascending order, so that the
the 0th element). If \f$N\f$ is even, the element in position \f$N/2\f$ is * frequency corresponding to the \f$N-1\f$st element is just below that of
assumed to correspond both the maximum poitive and negative frequency * the 0th element). If \f$N\f$ is even, the element in position \f$N/2\f$
offset. is
*/ * assumed to correspond both the maximum poitive and negative frequency
* offset.
*/
/*@{*/ /*@{*/
void LALI2PrintFrequencySeries( INT2FrequencySeries *series , const CHAR *f ilename ); void LALI2PrintFrequencySeries( INT2FrequencySeries *series , const CHAR *f ilename );
void LALI4PrintFrequencySeries( INT4FrequencySeries *series , const CHAR *f ilename ); void LALI4PrintFrequencySeries( INT4FrequencySeries *series , const CHAR *f ilename );
void LALI8PrintFrequencySeries( INT8FrequencySeries *series , const CHAR *f ilename ); void LALI8PrintFrequencySeries( INT8FrequencySeries *series , const CHAR *f ilename );
void LALU2PrintFrequencySeries( UINT2FrequencySeries *series , const CHAR * filename ); void LALU2PrintFrequencySeries( UINT2FrequencySeries *series , const CHAR * filename );
void LALU4PrintFrequencySeries( UINT4FrequencySeries *series , const CHAR * filename ); void LALU4PrintFrequencySeries( UINT4FrequencySeries *series , const CHAR * filename );
void LALU8PrintFrequencySeries( UINT8FrequencySeries *series , const CHAR * filename ); void LALU8PrintFrequencySeries( UINT8FrequencySeries *series , const CHAR * filename );
void LALPrintFrequencySeries( REAL4FrequencySeries *series , const CHAR *fi lename ); void LALPrintFrequencySeries( REAL4FrequencySeries *series , const CHAR *fi lename );
void LALSPrintFrequencySeries( REAL4FrequencySeries *series , const CHAR *f ilename ); void LALSPrintFrequencySeries( REAL4FrequencySeries *series , const CHAR *f ilename );
void LALDPrintFrequencySeries( REAL8FrequencySeries *series , const CHAR *f ilename ); void LALDPrintFrequencySeries( REAL8FrequencySeries *series , const CHAR *f ilename );
 End of changes. 3 change blocks. 
109 lines changed or deleted 112 lines changed or added


 PrintVector.h   PrintVector.h 
skipping to change at line 35 skipping to change at line 35
#ifndef _LALSTDLIB_H #ifndef _LALSTDLIB_H
#define _LALSTDLIB_H #define _LALSTDLIB_H
#endif #endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup PrintVector_h * \addtogroup PrintVector_h
\author Allen, B.; generalized by J. T. Whelan <jtwhelan@loyno.edu> * \author Allen, B.; generalized by J. T. Whelan <jtwhelan@loyno.edu>
*
\brief This is a simple utility to print vectors into a file. * \brief This is a simple utility to print vectors into a file.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/PrintVector.h> * \code
\endcode * #include <lal/PrintVector.h>
* \endcode
Contains the prototypes for the LAL <tt>\<datatype\>PrintVector</tt> fun *
ctions * Contains the prototypes for the LAL <tt>\<datatype\>PrintVector</tt> fun
ctions
\heading{Description} *
* ### Description ###
Each member of this family of functions prints the elements of *
\f$\langle\mbox{datatype}\rangle\f$\c Vector into a file. Note: the * Each member of this family of functions prints the elements of
file names are <tt>\<datatype\>PrintVector.000</tt>, * \f$\langle\mbox{datatype}\rangle\f$\c Vector into a file. Note: the
<tt>\<datatype\>PrintVector.001</tt>, and so on. * file names are <tt>\<datatype\>PrintVector.000</tt>,
(<tt>\<datatype\></tt> is the abbreviation for the datatype, * <tt>\<datatype\>PrintVector.001</tt>, and so on.
included in the function names above.) The file numbers are * (<tt>\<datatype\></tt> is the abbreviation for the datatype,
incremented with each additional call. This function is for debugging * included in the function names above.) The file numbers are
use only: it uses a static internal variable to keep track of the file * incremented with each additional call. This function is for debugging
number so it should not be used in any real analysis codes. * use only: it uses a static internal variable to keep track of the file
* number so it should not be used in any real analysis codes.
\heading{Notes} *
* ### Notes ###
This function uses an internal static variable to keep track of file *
numbers. For this reason it should only be used for debugging * This function uses an internal static variable to keep track of file
purposes in test functions, not in any production code. * numbers. For this reason it should only be used for debugging
* purposes in test functions, not in any production code.
Additionally, since printf cannot handle INT8 as integers, the *
functions <tt>LALI8PrintVector()</tt> and <tt>LALU8PrintVector()</tt> use * Additionally, since printf cannot handle INT8 as integers, the
a typecast to REAL8 and are thus only valid for numbers between around * functions <tt>LALI8PrintVector()</tt> and <tt>LALU8PrintVector()</tt> us
\f$-10^{15}\f$ and \f$10^{15}\f$. e
* a typecast to REAL8 and are thus only valid for numbers between around
The output format is two or three space-separated columns: the first * \f$-10^{15}\f$ and \f$10^{15}\f$.
column is the index of the element; the second is the element itself *
for real and integer vectors and the real part of the element for * The output format is two or three space-separated columns: the first
complex vectors; complex vectors have a third column containing the * column is the index of the element; the second is the element itself
imaginary part of the element. * for real and integer vectors and the real part of the element for
* complex vectors; complex vectors have a third column containing the
*/ * imaginary part of the element.
*
*/
/*@{*/ /*@{*/
void LALCHARPrintVector( CHARVector *vector ); void LALCHARPrintVector( CHARVector *vector );
void LALI2PrintVector( INT2Vector *vector ); void LALI2PrintVector( INT2Vector *vector );
void LALI4PrintVector( INT4Vector *vector ); void LALI4PrintVector( INT4Vector *vector );
void LALI8PrintVector( INT8Vector *vector ); void LALI8PrintVector( INT8Vector *vector );
void LALU2PrintVector( UINT2Vector *vector ); void LALU2PrintVector( UINT2Vector *vector );
void LALU4PrintVector( UINT4Vector *vector ); void LALU4PrintVector( UINT4Vector *vector );
void LALU8PrintVector( UINT8Vector *vector ); void LALU8PrintVector( UINT8Vector *vector );
void LALPrintVector( REAL4Vector *vector ); void LALPrintVector( REAL4Vector *vector );
void LALSPrintVector( REAL4Vector *vector ); void LALSPrintVector( REAL4Vector *vector );
 End of changes. 1 change blocks. 
43 lines changed or deleted 45 lines changed or added


 Random.h   Random.h 
skipping to change at line 36 skipping to change at line 36
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* \addtogroup Random_h * \addtogroup Random_h
* \author Creighton, J. D. E. and Tibbits, M. M. * \author Creighton, J. D. E. and Tibbits, M. M.
* *
* \brief Generates random numbers. * \brief Generates random numbers.
* *
* \heading{Synopsis} * ### Synopsis ###
*
* \code * \code
* #include <lal/Random.h> * #include <lal/Random.h>
* \endcode * \endcode
* *
* This header covers the routines for generating random numbers. * This header covers the routines for generating random numbers.
* *
*/ */
/*@{*/ /*@{*/
/**\name Error Codes */ /**\name Error Codes */
/*@{*/ /*@{*/
#define RANDOMH_ENULL 1 /**< Null pointer */ #define RANDOMH_ENULL 1 /**< Null pointer */
#define RANDOMH_ENNUL 2 /**< Non-null pointer */ #define RANDOMH_ENNUL 2 /**< Non-null pointer */
#define RANDOMH_ESIZE 4 /**< Invalid size */ #define RANDOMH_ESIZE 4 /**< Invalid size */
#define RANDOMH_ELNTH 8 /**< Must have more than one data po int */ #define RANDOMH_ELNTH 8 /**< Must have more than one data po int */
#define RANDOMH_ESEGZ 16 /**< Invalid number of segments */ #define RANDOMH_ESEGZ 16 /**< Invalid number of segments */
#define RANDOMH_ENUMZ 32 /**< Invalid number of points in seg ment */ #define RANDOMH_ENUMZ 32 /**< Invalid number of points in seg ment */
skipping to change at line 75 skipping to change at line 76
#define RANDOMH_MSGESIZE "Invalid size" #define RANDOMH_MSGESIZE "Invalid size"
#define RANDOMH_MSGELNTH "Must have more than one data point" #define RANDOMH_MSGELNTH "Must have more than one data point"
#define RANDOMH_MSGESEGZ "Invalid number of segments" #define RANDOMH_MSGESEGZ "Invalid number of segments"
#define RANDOMH_MSGENUMZ "Invalid number of points in segment" #define RANDOMH_MSGENUMZ "Invalid number of points in segment"
#define RANDOMH_MSGEALOC "Memory Allocation Error" #define RANDOMH_MSGEALOC "Memory Allocation Error"
#define RANDOMH_MSGEINIT "Params must be initialized with CreateParams firs t" #define RANDOMH_MSGEINIT "Params must be initialized with CreateParams firs t"
#define RANDOMH_MSGEZERO "Output Vector length must be greater than zero" #define RANDOMH_MSGEZERO "Output Vector length must be greater than zero"
#define RANDOMH_MSGESEED "Improper seed value" #define RANDOMH_MSGESEED "Improper seed value"
/** \endcond */ /** \endcond */
/** \ingroup Random_h /**
* \ingroup Random_h
* \brief This structure contains the parameters necessary for generating t he current * \brief This structure contains the parameters necessary for generating t he current
* sequence of random numbers (based on the initial seed). * sequence of random numbers (based on the initial seed).
* \note The contents should not be manually adjusted. * \note The contents should not be manually adjusted.
*/ */
typedef struct typedef struct
tagRandomParams tagRandomParams
{ {
INT4 i; INT4 i;
INT4 y; INT4 y;
INT4 v[32]; INT4 v[32];
 End of changes. 3 change blocks. 
3 lines changed or deleted 5 lines changed or added


 ReadFTSeries.h   ReadFTSeries.h 
skipping to change at line 30 skipping to change at line 30
#ifndef _READFTSERIES_H #ifndef _READFTSERIES_H
#define _READFTSERIES_H #define _READFTSERIES_H
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup ReadFTSeries_h * \addtogroup ReadFTSeries_h
\author Torres, C. W. * \author Torres, C. W.
*
\brief This is a simple utility to Read time and frequency series into a * \brief This is a simple utility to Read time and frequency series into a
file. file.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/ReadFTSeries.h> * \code
\endcode * #include <lal/ReadFTSeries.h>
* \endcode
Provides prototype information for the routines in \ref ReadTimeSeries_c *
and \ref ReadFrequencySeries_c. * Provides prototype information for the routines in \ref ReadTimeSeries_c
*/ /*@{*/ and \ref ReadFrequencySeries_c.
*/
/*@{*/
/**\name Error Codes */ /*@{*/ /**\name Error Codes */ /*@{*/
#define READFTSERIESH_EFILENOTFOUND 1 /**< Invalid Filename or Fi le Not Found */ #define READFTSERIESH_EFILENOTFOUND 1 /**< Invalid Filename or Fi le Not Found */
#define READFTSERIESH_EPARSE 2 /**< Error Parsing File */ #define READFTSERIESH_EPARSE 2 /**< Error Parsing File */
/*@}*/ /*@}*/
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
#define READFTSERIESH_MSGEFILENOTFOUND "Invalid Filename or File Not Fo und" #define READFTSERIESH_MSGEFILENOTFOUND "Invalid Filename or File Not Fo und"
#define READFTSERIESH_MSGEPARSE "Error Parsing File" #define READFTSERIESH_MSGEPARSE "Error Parsing File"
/** \endcond */ /** \endcond */
skipping to change at line 67 skipping to change at line 69
"s^-32768/32767 A^-32768/32767 " "s^-32768/32767 A^-32768/32767 "
"K^-32768/32767 strain^-32768/32767 " "K^-32768/32767 strain^-32768/32767 "
"count^-32768/32767") "count^-32768/32767")
}; };
enum enumMaxLineLength { enum enumMaxLineLength {
MaxLineLength = LALSupportUnitTextSize + sizeof("Units are ()\n") MaxLineLength = LALSupportUnitTextSize + sizeof("Units are ()\n")
}; };
/** \endcond */ /** \endcond */
#endif /* SWIG */ #endif /* SWIG */
/** \defgroup ReadTimeSeries_c Module ReadTimeSeries.c /**
\author Torres, C. V. * \defgroup ReadTimeSeries_c Module ReadTimeSeries.c
* \author Torres, C. V.
\brief Each member of this family of functions reads from a file the ou *
tput of the corresponding \c PrintTimeSeries routine. * \brief Each member of this family of functions reads from a file the out
put of the corresponding \c PrintTimeSeries routine.
\heading{Notes} *
* ### Notes ###
These functions perform I/O operations, which are not a part of LAL *
proper They should only be used for debugging purposes in test * These functions perform I/O operations, which are not a part of LAL
functions, not in any production code. * proper They should only be used for debugging purposes in test
*/ /*@{*/ * functions, not in any production code.
*/
/*@{*/
void LALReadTimeSeries(LALStatus* status, REAL4TimeSeries *series , const CHAR *filename ); void LALReadTimeSeries(LALStatus* status, REAL4TimeSeries *series , const CHAR *filename );
void LALSReadTimeSeries(LALStatus* status, REAL4TimeSeries *series , const CHAR *filename ); void LALSReadTimeSeries(LALStatus* status, REAL4TimeSeries *series , const CHAR *filename );
void LALDReadTimeSeries(LALStatus* status, REAL8TimeSeries *series , const CHAR *filename ); void LALDReadTimeSeries(LALStatus* status, REAL8TimeSeries *series , const CHAR *filename );
void LALCReadTimeSeries(LALStatus* status, COMPLEX8TimeSeries *series , co nst CHAR *filename ); void LALCReadTimeSeries(LALStatus* status, COMPLEX8TimeSeries *series , co nst CHAR *filename );
void LALZReadTimeSeries(LALStatus* status, COMPLEX16TimeSeries *series , c onst CHAR *filename ); void LALZReadTimeSeries(LALStatus* status, COMPLEX16TimeSeries *series , c onst CHAR *filename );
/*@}*/ /*@}*/
/** \defgroup ReadFrequencySeries_c Module ReadFrequencySeries.c /**
\author Torres, C. V. * \defgroup ReadFrequencySeries_c Module ReadFrequencySeries.c
* \author Torres, C. V.
\brief Each member of this family of functions reads from a file the ou *
tput of the corresponding \c PrintFrequencySeries routine. * \brief Each member of this family of functions reads from a file the out
put of the corresponding \c PrintFrequencySeries routine.
\heading{Notes} *
* ### Notes ###
These functions perform I/O operations, which are not a part of LAL *
proper. They should only be used for debugging purposes in test * These functions perform I/O operations, which are not a part of LAL
functions, not in any production code. * proper. They should only be used for debugging purposes in test
*/ /*@{*/ * functions, not in any production code.
*/
/*@{*/
void LALReadFrequencySeries(LALStatus* status, REAL4FrequencySeries *serie s , const CHAR *filename ); void LALReadFrequencySeries(LALStatus* status, REAL4FrequencySeries *serie s , const CHAR *filename );
void LALSReadFrequencySeries(LALStatus* status, REAL4FrequencySeries *seri es , const CHAR *filename ); void LALSReadFrequencySeries(LALStatus* status, REAL4FrequencySeries *seri es , const CHAR *filename );
void LALDReadFrequencySeries(LALStatus* status, REAL8FrequencySeries *seri es , const CHAR *filename ); void LALDReadFrequencySeries(LALStatus* status, REAL8FrequencySeries *seri es , const CHAR *filename );
void LALCReadFrequencySeries(LALStatus* status, COMPLEX8FrequencySeries *se ries , const CHAR *filename ); void LALCReadFrequencySeries(LALStatus* status, COMPLEX8FrequencySeries *se ries , const CHAR *filename );
void LALZReadFrequencySeries(LALStatus* status, COMPLEX16FrequencySeries * series , const CHAR *filename ); void LALZReadFrequencySeries(LALStatus* status, COMPLEX16FrequencySeries * series , const CHAR *filename );
/*@}*/ /*@}*/
/*@}*/ /*@}*/
#ifdef __cplusplus #ifdef __cplusplus
 End of changes. 3 change blocks. 
38 lines changed or deleted 44 lines changed or added


 ReadNoiseSpectrum.h   ReadNoiseSpectrum.h 
skipping to change at line 43 skipping to change at line 43
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#include <lal/Date.h> #include <lal/Date.h>
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
\addtogroup ReadNoiseSpectrum_h * \addtogroup ReadNoiseSpectrum_h
\author Brady, P. R. * \author Brady, P. R.
*
\brief Provides function to read in a file containing a possibly unequal * \brief Provides function to read in a file containing a possibly unequal
ly sampled ly sampled
noise amplitude spectrum (\f$\textrm{strain}/\sqrt(\textrm{Hz})\f$) and * noise amplitude spectrum (\f$\textrm{strain}/\sqrt(\textrm{Hz})\f$) and
return as return as
a frequency series. * a frequency series.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/ReadNoiseSpectrum.h> * \code
\endcode * #include <lal/ReadNoiseSpectrum.h>
*/ /*@{*/ * \endcode
*/
/*@{*/
/**\name Error Codes */ /*@{*/ /**\name Error Codes */ /*@{*/
#define LALREADNOISESPECTRUMH_ENULL 1 /**< Null pointer */ #define LALREADNOISESPECTRUMH_ENULL 1 /**< Null pointer */
#define LALREADNOISESPECTRUMH_ENNUL 2 /**< Non-null pointer */ #define LALREADNOISESPECTRUMH_ENNUL 2 /**< Non-null pointer */
#define LALREADNOISESPECTRUMH_EALOC 3 /**< Memory allocation error */ #define LALREADNOISESPECTRUMH_EALOC 3 /**< Memory allocation error */
#define LALREADNOISESPECTRUMH_EOPEN 4 /**< Error opening file */ #define LALREADNOISESPECTRUMH_EOPEN 4 /**< Error opening file */
#define LALREADNOISESPECTRUMH_EFCLO 5 /**< Error closing file */ #define LALREADNOISESPECTRUMH_EFCLO 5 /**< Error closing file */
#define LALREADNOISESPECTRUMH_EPARS 8 /**< Error parsing spectrum file */ #define LALREADNOISESPECTRUMH_EPARS 8 /**< Error parsing spectrum file */
/*@}*/ /*@}*/
/*@}*/ /*@}*/
 End of changes. 1 change blocks. 
14 lines changed or deleted 16 lines changed or added


 RealFFT.h   RealFFT.h 
skipping to change at line 33 skipping to change at line 33
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
*
* \addtogroup RealFFT_h * \addtogroup RealFFT_h
* \brief Performs real-to-complex and complex-to-real FFTs. * \brief Performs real-to-complex and complex-to-real FFTs.
* *
* \heading{Synopsis} * ### Synopsis ###
*
* \code * \code
* #include <lal/RealFFT.h> * #include <lal/RealFFT.h>
* \endcode * \endcode
* *
* Perform real-to-complex and complex-to-real fast Fourier * Perform real-to-complex and complex-to-real fast Fourier
* transforms of vectors, and sequences of vectors using the package * transforms of vectors, and sequences of vectors using the package
* FFTW [\ref fj_1998]. * FFTW \cite fj_1998.
*
* *
* \section sec_RealFFT_XLAL XLAL Functions * \section sec_RealFFT_XLAL XLAL Functions
* *
* \heading{Synopsis} * ### Synopsis ###
*
* \code * \code
* #include <lal/RealFFT.h> * #include <lal/RealFFT.h>
* *
* REAL4FFTPlan * XLALCreateREAL4FFTPlan( UINT4 size, int fwdflg, int measu relvl ); * REAL4FFTPlan * XLALCreateREAL4FFTPlan( UINT4 size, int fwdflg, int measu relvl );
* REAL4FFTPlan * XLALCreateForwardREAL4FFTPlan( UINT4 size, int measurelvl ); * REAL4FFTPlan * XLALCreateForwardREAL4FFTPlan( UINT4 size, int measurelvl );
* REAL4FFTPlan * XLALCreateReverseREAL4FFTPlan( UINT4 size, int measurelvl ); * REAL4FFTPlan * XLALCreateReverseREAL4FFTPlan( UINT4 size, int measurelvl );
* void XLALDestroyREAL4FFTPlan( REAL4FFTPlan *plan ); * void XLALDestroyREAL4FFTPlan( REAL4FFTPlan *plan );
* *
* int XLALREAL4ForwardFFT( COMPLEX8Vector *output, REAL4Vector *input, REA L4FFTPlan *plan ); * int XLALREAL4ForwardFFT( COMPLEX8Vector *output, REAL4Vector *input, REA L4FFTPlan *plan );
* int XLALREAL4ReverseFFT( REAL4Vector *output, COMPLEX8Vector *input, REA L4FFTPlan *plan ); * int XLALREAL4ReverseFFT( REAL4Vector *output, COMPLEX8Vector *input, REA L4FFTPlan *plan );
skipping to change at line 74 skipping to change at line 74
* REAL8FFTPlan * XLALCreateForwardREAL8FFTPlan( UINT4 size, int measurelvl ); * REAL8FFTPlan * XLALCreateForwardREAL8FFTPlan( UINT4 size, int measurelvl );
* REAL8FFTPlan * XLALCreateReverseREAL8FFTPlan( UINT4 size, int measurelvl ); * REAL8FFTPlan * XLALCreateReverseREAL8FFTPlan( UINT4 size, int measurelvl );
* void XLALDestroyREAL8FFTPlan( REAL8FFTPlan *plan ); * void XLALDestroyREAL8FFTPlan( REAL8FFTPlan *plan );
* *
* int XLALREAL8ForwardFFT( COMPLEX16Vector *output, REAL8Vector *input, RE AL8FFTPlan *plan ); * int XLALREAL8ForwardFFT( COMPLEX16Vector *output, REAL8Vector *input, RE AL8FFTPlan *plan );
* int XLALREAL8ReverseFFT( REAL8Vector *output, COMPLEX16Vector *input, RE AL8FFTPlan *plan ); * int XLALREAL8ReverseFFT( REAL8Vector *output, COMPLEX16Vector *input, RE AL8FFTPlan *plan );
* int XLALREAL8VectorFFT( REAL8Vector *output, REAL8Vector *input, REAL8FF TPlan *plan ); * int XLALREAL8VectorFFT( REAL8Vector *output, REAL8Vector *input, REAL8FF TPlan *plan );
* int XLALREAL8PowerSpectrum( REAL8Vector *spec, REAL8Vector *data, REAL8F FTPlan *plan ); * int XLALREAL8PowerSpectrum( REAL8Vector *spec, REAL8Vector *data, REAL8F FTPlan *plan );
* \endcode * \endcode
* *
* \heading{Description} * ### Description ###
* *
* The \c REAL4 routines are described below. These use single-precision * The \c REAL4 routines are described below. These use single-precision
* FFTs, i.e., they convert \c REAL4Vectors into \c COMPLEX8Vectors * FFTs, i.e., they convert \c REAL4Vectors into \c COMPLEX8Vectors
* and vice-versa. The \c REAL8 versions of the routines are the same * and vice-versa. The \c REAL8 versions of the routines are the same
* but they are double-precision versions, i.e., they convert * but they are double-precision versions, i.e., they convert
* \c REAL8Vectors into \c COMPLEX16Vectors. * \c REAL8Vectors into \c COMPLEX16Vectors.
* *
* The routine XLALCreateREAL4FFTPlan() creates a REAL4FFTPlan * The routine XLALCreateREAL4FFTPlan() creates a REAL4FFTPlan
* structure to perform FFTs of vectors of length \c size. If * structure to perform FFTs of vectors of length \c size. If
* \c fwdflg is non-zero then the plan is created to perform forward * \c fwdflg is non-zero then the plan is created to perform forward
skipping to change at line 119 skipping to change at line 119
* *
* XLALREAL4VectorFFT() is a low-level routine that transforms * XLALREAL4VectorFFT() is a low-level routine that transforms
* a real vector to a half-complex real vector (with a forward plan) or * a real vector to a half-complex real vector (with a forward plan) or
* a half-complex real vector to a real vector (with a reverse plan). * a half-complex real vector to a real vector (with a reverse plan).
* If you're not sure what this means, don't use this routine. * If you're not sure what this means, don't use this routine.
* The input and output vectors (and their data) must be distinct pointers. * The input and output vectors (and their data) must be distinct pointers.
* *
* XLALREAL4PowerSpectrum() computes a real power spectrum of the * XLALREAL4PowerSpectrum() computes a real power spectrum of the
* input real vector and a forward FFT plan. * input real vector and a forward FFT plan.
* *
* \heading{Return Values} * ### Return Values ###
* *
* Upon success, * Upon success,
* XLALCreateREAL4FFTPlan(), * XLALCreateREAL4FFTPlan(),
* XLALCreateForwardREAL4FFTPlan(), and * XLALCreateForwardREAL4FFTPlan(), and
* XLALCreateReverseREAL4FFTPlan() return a pointer to a newly-allocated * XLALCreateReverseREAL4FFTPlan() return a pointer to a newly-allocated
* FFT plan. Upon failure, they return a \c NULL pointer and set * FFT plan. Upon failure, they return a \c NULL pointer and set
* \c xlalErrno to one of the following values: * \c xlalErrno to one of the following values:
* #XLAL_EBADLEN if \c size is not greater than zero, * #XLAL_EBADLEN if \c size is not greater than zero,
* #XLAL_ENOMEM if a memory allocation failed, or * #XLAL_ENOMEM if a memory allocation failed, or
* #XLAL_EFAILED if the FFTW plan creation routine failed. * #XLAL_EFAILED if the FFTW plan creation routine failed.
skipping to change at line 156 skipping to change at line 156
* directions or if the input and output data pointers are not distinct * directions or if the input and output data pointers are not distinct
* for XLALREAL4VectorFFT(), * for XLALREAL4VectorFFT(),
* #XLAL_EBADLEN if the input and output vectors and the plan have * #XLAL_EBADLEN if the input and output vectors and the plan have
* incompatible lengths, * incompatible lengths,
* #XLAL_ENOMEM if a memory allocation of temporary internal memory * #XLAL_ENOMEM if a memory allocation of temporary internal memory
* fails. * fails.
* *
* As before, the \c REAL8 versions of these routines behave the * As before, the \c REAL8 versions of these routines behave the
* same way but for double-precision transforms. * same way but for double-precision transforms.
* *
*/ */
/*@{*/ /*@{*/
/** Plan to perform FFT of REAL4 data */ /** Plan to perform FFT of REAL4 data */
typedef struct tagREAL4FFTPlan REAL4FFTPlan; typedef struct tagREAL4FFTPlan REAL4FFTPlan;
/** Plan to perform FFT of REAL8 data */ /** Plan to perform FFT of REAL8 data */
typedef struct tagREAL8FFTPlan REAL8FFTPlan; typedef struct tagREAL8FFTPlan REAL8FFTPlan;
#define tagRealFFTPlan tagREAL4FFTPlan #define tagRealFFTPlan tagREAL4FFTPlan
#define RealFFTPlan REAL4FFTPlan #define RealFFTPlan REAL4FFTPlan
/** \name Error Codes */ /** \name Error Codes */
skipping to change at line 203 skipping to change at line 203
#define REALFFTH_MSGESNGL "FFTW library is not single-precision" #define REALFFTH_MSGESNGL "FFTW library is not single-precision"
#define REALFFTH_MSGEINTL "Error in Intel FFT library" #define REALFFTH_MSGEINTL "Error in Intel FFT library"
/** \endcond */ /** \endcond */
/* /*
* *
* XLAL REAL4 functions * XLAL REAL4 functions
* *
*/ */
/** Returns a new REAL4FFTPlan /**
* * Returns a new REAL4FFTPlan
* A REAL4FFTPlan is required to perform a FFT that involves real data. * A REAL4FFTPlan is required to perform a FFT that involves real data.
* A different plan is required for each size of the real data vector * A different plan is required for each size of the real data vector
* and for each direction of transform (forward or reverse). * and for each direction of transform (forward or reverse).
* A forward transform performs * A forward transform performs
* \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f]
* where N, the size of the transform, is the length of the vector x. * where N, the size of the transform, is the length of the vector x.
* A reverse transform performs * A reverse transform performs
* \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f]
* where N, the size of the transform, is the length of the vector y. * where N, the size of the transform, is the length of the vector y.
* *
* @note * @note
* The reverse transform of the forward transform of some data is * The reverse transform of the forward transform of some data is
* equal to N times the original data (we therefore call it a \"reverse\" * equal to N times the original data (we therefore call it a \"reverse\"
* transform rather than an \"inverse\" transform). * transform rather than an \"inverse\" transform).
* *
* @param[in] size The number of points in the real data. * @param[in] size The number of points in the real data.
* @param[in] fwdflg Set non-zero for a forward FFT plan; * @param[in] fwdflg Set non-zero for a forward FFT plan;
* otherwise create a reverse plan * otherwise create a reverse plan
* @param[in] measurelvl Measurement level for plan creation: * @param[in] measurelvl Measurement level for plan creation:
* - 0: no measurement, just estimate the plan; * - 0: no measurement, just estimate the plan;
* - 1: measure the best plan; * - 1: measure the best plan;
* - 2: perform a lengthy measurement of the best plan * - 2: perform a lengthy measurement of the best plan;
; * - 3: perform an exhasutive measurement of the best plan.
* - 3: perform an exhasutive measurement of the best
plan.
* @return A pointer to an allocated \c REAL4FFTPlan structure is returned * @return A pointer to an allocated \c REAL4FFTPlan structure is returned
* upon successful completion. Otherwise, a \c NULL pointer is returned * upon successful completion. Otherwise, a \c NULL pointer is returned
* and \c xlalErrno is set to indicate the error. * and \c xlalErrno is set to indicate the error.
* @par Errors: * @par Errors:
* The \c XLALCreateREAL4Plan() function shall fail if: * The \c XLALCreateREAL4Plan() function shall fail if:
* - [\c XLAL_EBADLEN] The size of the requested plan is 0. * - [\c XLAL_EBADLEN] The size of the requested plan is 0.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed.
* . * .
*/ */
REAL4FFTPlan * XLALCreateREAL4FFTPlan( UINT4 size, int fwdflg, int measurel vl ); REAL4FFTPlan * XLALCreateREAL4FFTPlan( UINT4 size, int fwdflg, int measurel vl );
/** Returns a new REAL4FFTPlan for a forward transform /**
* Returns a new REAL4FFTPlan for a forward transform
* *
* A REAL4FFTPlan is required to perform a FFT that involves real data. * A REAL4FFTPlan is required to perform a FFT that involves real data.
* A different plan is required for each size of the real data vector. * A different plan is required for each size of the real data vector.
* A forward transform performs * A forward transform performs
* \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f]
* where N, the size of the transform, is the length of the vector x. * where N, the size of the transform, is the length of the vector x.
* *
* @param[in] size The number of points in the real data. * @param[in] size The number of points in the real data.
* @param[in] measurelvl Measurement level for plan creation: * @param[in] measurelvl Measurement level for plan creation:
* - 0: no measurement, just estimate the plan; * - 0: no measurement, just estimate the plan;
* - 1: measure the best plan; * - 1: measure the best plan;
* - 2: perform a lengthy measurement of the best plan * - 2: perform a lengthy measurement of the best plan;
; * - 3: perform an exhasutive measurement of the best plan.
* - 3: perform an exhasutive measurement of the best
plan.
* @return A pointer to an allocated \c REAL4FFTPlan structure is returned * @return A pointer to an allocated \c REAL4FFTPlan structure is returned
* upon successful completion. Otherwise, a \c NULL pointer is returned * upon successful completion. Otherwise, a \c NULL pointer is returned
* and \c xlalErrno is set to indicate the error. * and \c xlalErrno is set to indicate the error.
* @par Errors: * @par Errors:
* The \c XLALCreateForwardREAL4Plan() function shall fail if: * The \c XLALCreateForwardREAL4Plan() function shall fail if:
* - [\c XLAL_EBADLEN] The size of the requested plan is 0. * - [\c XLAL_EBADLEN] The size of the requested plan is 0.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed.
* . * .
*/ */
REAL4FFTPlan * XLALCreateForwardREAL4FFTPlan( UINT4 size, int measurelvl ); REAL4FFTPlan * XLALCreateForwardREAL4FFTPlan( UINT4 size, int measurelvl );
/** Returns a new REAL4FFTPlan for a reverse transform /**
* Returns a new REAL4FFTPlan for a reverse transform
* *
* A REAL4FFTPlan is required to perform a FFT that involves real data. * A REAL4FFTPlan is required to perform a FFT that involves real data.
* A reverse transform performs * A reverse transform performs
* \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f]
* where N, the size of the transform, is the length of the vector y. * where N, the size of the transform, is the length of the vector y.
* *
* @note * @note
* The reverse transform of the forward transform of some data is * The reverse transform of the forward transform of some data is
* equal to N times the original data (we therefore call it a \"reverse\" * equal to N times the original data (we therefore call it a \"reverse\"
* transform rather than an \"inverse\" transform). * transform rather than an \"inverse\" transform).
* *
* @param[in] size The number of points in the real data. * @param[in] size The number of points in the real data.
* @param[in] measurelvl Measurement level for plan creation: * @param[in] measurelvl Measurement level for plan creation:
* - 0: no measurement, just estimate the plan; * - 0: no measurement, just estimate the plan;
* - 1: measure the best plan; * - 1: measure the best plan;
* - 2: perform a lengthy measurement of the best plan * - 2: perform a lengthy measurement of the best plan;
; * - 3: perform an exhasutive measurement of the best plan.
* - 3: perform an exhasutive measurement of the best
plan.
* @return A pointer to an allocated \c REAL4FFTPlan structure is returned * @return A pointer to an allocated \c REAL4FFTPlan structure is returned
* upon successful completion. Otherwise, a \c NULL pointer is returned * upon successful completion. Otherwise, a \c NULL pointer is returned
* and \c xlalErrno is set to indicate the error. * and \c xlalErrno is set to indicate the error.
* @par Errors: * @par Errors:
* The \c XLALCreateReverseREAL4Plan() function shall fail if: * The \c XLALCreateReverseREAL4Plan() function shall fail if:
* - [\c XLAL_EBADLEN] The size of the requested plan is 0. * - [\c XLAL_EBADLEN] The size of the requested plan is 0.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed.
* . * .
*/ */
REAL4FFTPlan * XLALCreateReverseREAL4FFTPlan( UINT4 size, int measurelvl ); REAL4FFTPlan * XLALCreateReverseREAL4FFTPlan( UINT4 size, int measurelvl );
/** Destroys a REAL4FFTPlan /**
* Destroys a REAL4FFTPlan
* @param[in] plan A pointer to the REAL4FFTPlan to be destroyed. * @param[in] plan A pointer to the REAL4FFTPlan to be destroyed.
* @return None. * @return None.
*/ */
void XLALDestroyREAL4FFTPlan( REAL4FFTPlan *plan ); void XLALDestroyREAL4FFTPlan( REAL4FFTPlan *plan );
/** Performs a forward FFT of REAL4 data /**
* Performs a forward FFT of REAL4 data
* *
* This routine performs the transformation: * This routine performs the transformation:
* \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f]
* where N, the size of the transform, is the length of the vector x. * where N, the size of the transform, is the length of the vector x.
* *
* @note * @note
* Due to the reality of the input data x, the following identity * Due to the reality of the input data x, the following identity
* holds for the complex FFT data: \f$z[N-k]=z^\ast[k]\f$. Therefore, * holds for the complex FFT data: \f$z[N-k]=z^\ast[k]\f$. Therefore,
* the length of the output vector is equal to \f$\lfloor N/2\rfloor + 1\f$ * the length of the output vector is equal to \f$\lfloor N/2\rfloor + 1\f$
* since the remaining \"negative\" frequency components can be obtained fr om the * since the remaining \"negative\" frequency components can be obtained fr om the
* \"positive\" frequency components. * \"positive\" frequency components.
* *
* @param[out] output The complex data vector z of length [N/2] + 1 * @param[out] output The complex data vector z of length [N/2] + 1
* that results from the transform * that results from the transform
* @param[in] input The real data vector x of length to be transformed * @param[in] input The real data vector x of length to be transformed
* @param[in] plan The FFT plan to use for the transform * @param[in] plan The FFT plan to use for the transform
* @return 0 upon successful completion or non-zero upon failure. * @return 0 upon successful completion or non-zero upon failure.
* @par Errors: * @par Errors:
* The \c XLALREAL4ForwardFFT() function shall fail if: * The \c XLALREAL4ForwardFFT() function shall fail if:
* - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments
s. .
* - [\c XLAL_EINVAL] A argument is invalid or the plan is for a * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a
* reverse transform. * reverse transform.
* - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are
* incompatible. * incompatible.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* . * .
*/ */
int XLALREAL4ForwardFFT( COMPLEX8Vector *output, const REAL4Vector *input, int XLALREAL4ForwardFFT( COMPLEX8Vector *output, const REAL4Vector *input,
const REAL4FFTPlan *plan ); const REAL4FFTPlan *plan );
/** Performs a reverse FFT of REAL4 data /**
* Performs a reverse FFT of REAL4 data
* *
* This routine performs the transformation: * This routine performs the transformation:
* \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f]
* where N, the size of the transform, is the length of the vector y. * where N, the size of the transform, is the length of the vector y.
* *
* @note * @note
* Due to the reality of the output data y, the following identity * Due to the reality of the output data y, the following identity
* holds for the complex data: \f$z[N-k]=z^\ast[k]\f$. Therefore, * holds for the complex data: \f$z[N-k]=z^\ast[k]\f$. Therefore,
* the length of the input vector is equal to \f$\lfloor N/2\rfloor + 1\f$ * the length of the input vector is equal to \f$\lfloor N/2\rfloor + 1\f$
* since the remaining \"negative\" frequency components can be obtained fr om the * since the remaining \"negative\" frequency components can be obtained fr om the
* \"positive\" frequency components. * \"positive\" frequency components.
* *
* @param[out] output The real data vector y of length N * @param[out] output The real data vector y of length N
* that results from the transform * that results from the transform
* @param[in] input The complex data vector z of length [N/2] + 1 * @param[in] input The complex data vector z of length [N/2] + 1
* to be transformed * to be transformed
* @param[in] plan The FFT plan to use for the transform * @param[in] plan The FFT plan to use for the transform
* @return 0 upon successful completion or non-zero upon failure. * @return 0 upon successful completion or non-zero upon failure.
* @par Errors: * @par Errors:
* The \c XLALREAL4ForwardFFT() function shall fail if: * The \c XLALREAL4ForwardFFT() function shall fail if:
* - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments
s. .
* - [\c XLAL_EINVAL] A argument is invalid or the plan is for a * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a
* reverse transform. * reverse transform.
* - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are
* incompatible. * incompatible.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* - [\c XLAL_EDOM] Domain error if the DC component of the input data, z[ * - [\c XLAL_EDOM] Domain error if the DC component of the input data, z[0
0], ],
* is not purely real * is not purely real
* or if the length of the output vector N is even and the Nyquist * or if the length of the output vector N is even and the Nyquist
* component of the input data, z[N/2], is not purely real. * component of the input data, z[N/2], is not purely real.
* . * .
*/ */
int XLALREAL4ReverseFFT( REAL4Vector *output, const COMPLEX8Vector *input, int XLALREAL4ReverseFFT( REAL4Vector *output, const COMPLEX8Vector *input,
const REAL4FFTPlan *plan ); const REAL4FFTPlan *plan );
/** Perform a REAL4Vector to REAL4Vector FFT /**
* Perform a REAL4Vector to REAL4Vector FFT
* *
* This routine computes * This routine computes
* \f[y[k]=\left\{\begin{array}{ll}\Re z[k]&0\le k\le\lfloor N/2\rfloor\\\I m z[N-k]&\lfloor N/2\rfloor<k<N\end{array}\right.\f] * \f[y[k]=\left\{\begin{array}{ll}\Re z[k]&0\le k\le\lfloor N/2\rfloor\\\I m z[N-k]&\lfloor N/2\rfloor<k<N\end{array}\right.\f]
* where \f[z[k] = \sum_{j=0}^{N-1} e^{\mp2\pi ijk/N}\,x[j],\f] * where \f[z[k] = \sum_{j=0}^{N-1} e^{\mp2\pi ijk/N}\,x[j],\f]
* and where the minus sign is used if a forward plan is provided as the ar gument * and where the minus sign is used if a forward plan is provided as the ar gument
* and the plus sign is used if a reverse plan is provided as the argument; * and the plus sign is used if a reverse plan is provided as the argument;
* here N is the length of the input vector x. * here N is the length of the input vector x.
* *
* @param[out] output The real output data vector y of length N * @param[out] output The real output data vector y of length N
* @param[in] input The input real data vector x of length N * @param[in] input The input real data vector x of length N
* @param[in] plan The FFT plan to use for the transform * @param[in] plan The FFT plan to use for the transform
* @note * @note
* The input and output vectors must be distinct. * The input and output vectors must be distinct.
* @return 0 upon successful completion or non-zero upon failure. * @return 0 upon successful completion or non-zero upon failure.
* @par Errors: * @par Errors:
* The \c XLALREAL4VectorFFT() function shall fail if: * The \c XLALREAL4VectorFFT() function shall fail if:
* - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments
s. .
* - [\c XLAL_EINVAL] A argument is invalid or the plan is for a * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a
* reverse transform. * reverse transform.
* - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are
* incompatible. * incompatible.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* . * .
*/ */
int XLALREAL4VectorFFT( REAL4Vector * restrict output, const REAL4Vector * restrict input, int XLALREAL4VectorFFT( REAL4Vector * _LAL_RESTRICT_ output, const REAL4Vec tor * _LAL_RESTRICT_ input,
const REAL4FFTPlan *plan ); const REAL4FFTPlan *plan );
/** Computes the power spectrum of REAL4 data /**
* Computes the power spectrum of REAL4 data
* *
* This routine computes * This routine computes
* \f[P[k]=\left\{\begin{array}{ll}|z[0]|^2&k=0\\2|z[k]|^2&1\leq \lfloor (N +1)/2\rfloor\\|z[N/2]|^2&k=N/2,\;\mbox{$N$ even}\end{array}\right.\f] * \f[P[k]=\left\{\begin{array}{ll}|z[0]|^2&k=0\\2|z[k]|^2&1\leq \lfloor (N +1)/2\rfloor\\|z[N/2]|^2&k=N/2,\;\mbox{$N$ even}\end{array}\right.\f]
* where \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j],\f] * where \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j],\f]
* and N is the length of the input vector x. * and N is the length of the input vector x.
* *
* @param[out] spec The real power spectrum P of length [N/2] + 1 of the da ta x * @param[out] spec The real power spectrum P of length [N/2] + 1 of the da ta x
* @param[in] data The input real data vector x of length N * @param[in] data The input real data vector x of length N
* @param[in] plan The FFT plan to use for the transform * @param[in] plan The FFT plan to use for the transform
* @return 0 upon successful completion or non-zero upon failure. * @return 0 upon successful completion or non-zero upon failure.
* @par Errors: * @par Errors:
* The \c XLALREAL4PowerSpectrum() function shall fail if: * The \c XLALREAL4PowerSpectrum() function shall fail if:
* - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments
s. .
* - [\c XLAL_EINVAL] A argument is invalid or the input and output * - [\c XLAL_EINVAL] A argument is invalid or the input and output
* data vectors are the same. * data vectors are the same.
* - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are
* incompatible. * incompatible.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* . * .
*/ */
int XLALREAL4PowerSpectrum( REAL4Vector *spec, const REAL4Vector *data, int XLALREAL4PowerSpectrum( REAL4Vector *spec, const REAL4Vector *data,
const REAL4FFTPlan *plan ); const REAL4FFTPlan *plan );
/* /*
* *
* XLAL REAL8 functions * XLAL REAL8 functions
* *
*/ */
/** Returns a new REAL8FFTPlan /**
* Returns a new REAL8FFTPlan
* *
* A REAL8FFTPlan is required to perform a FFT that involves real data. * A REAL8FFTPlan is required to perform a FFT that involves real data.
* A different plan is required for each size of the real data vector * A different plan is required for each size of the real data vector
* and for each direction of transform (forward or reverse). * and for each direction of transform (forward or reverse).
* A forward transform performs * A forward transform performs
* \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f]
* where N, the size of the transform, is the length of the vector x. * where N, the size of the transform, is the length of the vector x.
* A reverse transform performs * A reverse transform performs
* \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f]
* where N, the size of the transform, is the length of the vector y. * where N, the size of the transform, is the length of the vector y.
* *
* @note * @note
* The reverse transform of the forward transform of some data is * The reverse transform of the forward transform of some data is
* equal to N times the original data (we therefore call it a \"reverse\" * equal to N times the original data (we therefore call it a \"reverse\"
* transform rather than an \"inverse\" transform). * transform rather than an \"inverse\" transform).
* *
* @param[in] size The number of points in the real data. * @param[in] size The number of points in the real data.
* @param[in] fwdflg Set non-zero for a forward FFT plan; * @param[in] fwdflg Set non-zero for a forward FFT plan;
* otherwise create a reverse plan * otherwise create a reverse plan
* @param[in] measurelvl Measurement level for plan creation: * @param[in] measurelvl Measurement level for plan creation:
* - 0: no measurement, just estimate the plan; * - 0: no measurement, just estimate the plan;
* - 1: measure the best plan; * - 1: measure the best plan;
* - 2: perform a lengthy measurement of the best plan * - 2: perform a lengthy measurement of the best plan;
; * - 3: perform an exhasutive measurement of the best plan.
* - 3: perform an exhasutive measurement of the best
plan.
* @return A pointer to an allocated \c REAL8FFTPlan structure is returned * @return A pointer to an allocated \c REAL8FFTPlan structure is returned
* upon successful completion. Otherwise, a \c NULL pointer is returned * upon successful completion. Otherwise, a \c NULL pointer is returned
* and \c xlalErrno is set to indicate the error. * and \c xlalErrno is set to indicate the error.
* @par Errors: * @par Errors:
* The \c XLALCreateREAL8Plan() function shall fail if: * The \c XLALCreateREAL8Plan() function shall fail if:
* - [\c XLAL_EBADLEN] The size of the requested plan is 0. * - [\c XLAL_EBADLEN] The size of the requested plan is 0.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed.
* . * .
*/ */
REAL8FFTPlan * XLALCreateREAL8FFTPlan( UINT4 size, int fwdflg, int measurel vl ); REAL8FFTPlan * XLALCreateREAL8FFTPlan( UINT4 size, int fwdflg, int measurel vl );
/** Returns a new REAL8FFTPlan for a forward transform /**
* Returns a new REAL8FFTPlan for a forward transform
* *
* A REAL8FFTPlan is required to perform a FFT that involves real data. * A REAL8FFTPlan is required to perform a FFT that involves real data.
* A different plan is required for each size of the real data vector. * A different plan is required for each size of the real data vector.
* A forward transform performs * A forward transform performs
* \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f]
* where N, the size of the transform, is the length of the vector x. * where N, the size of the transform, is the length of the vector x.
* *
* @param[in] size The number of points in the real data. * @param[in] size The number of points in the real data.
* @param[in] measurelvl Measurement level for plan creation: * @param[in] measurelvl Measurement level for plan creation:
* - 0: no measurement, just estimate the plan; * - 0: no measurement, just estimate the plan;
* - 1: measure the best plan; * - 1: measure the best plan;
* - 2: perform a lengthy measurement of the best plan * - 2: perform a lengthy measurement of the best plan;
; * - 3: perform an exhasutive measurement of the best plan.
* - 3: perform an exhasutive measurement of the best
plan.
* @return A pointer to an allocated \c REAL8FFTPlan structure is returned * @return A pointer to an allocated \c REAL8FFTPlan structure is returned
* upon successful completion. Otherwise, a \c NULL pointer is returned * upon successful completion. Otherwise, a \c NULL pointer is returned
* and \c xlalErrno is set to indicate the error. * and \c xlalErrno is set to indicate the error.
* @par Errors: * @par Errors:
* The \c XLALCreateForwardREAL8Plan() function shall fail if: * The \c XLALCreateForwardREAL8Plan() function shall fail if:
* - [\c XLAL_EBADLEN] The size of the requested plan is 0. * - [\c XLAL_EBADLEN] The size of the requested plan is 0.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed.
* . * .
*/ */
REAL8FFTPlan * XLALCreateForwardREAL8FFTPlan( UINT4 size, int measurelvl ); REAL8FFTPlan * XLALCreateForwardREAL8FFTPlan( UINT4 size, int measurelvl );
/** Returns a new REAL8FFTPlan for a reverse transform /**
* Returns a new REAL8FFTPlan for a reverse transform
* *
* A REAL8FFTPlan is required to perform a FFT that involves real data. * A REAL8FFTPlan is required to perform a FFT that involves real data.
* A reverse transform performs * A reverse transform performs
* \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f]
* where N, the size of the transform, is the length of the vector y. * where N, the size of the transform, is the length of the vector y.
* *
* @note * @note
* The reverse transform of the forward transform of some data is * The reverse transform of the forward transform of some data is
* equal to N times the original data (we therefore call it a \"reverse\" * equal to N times the original data (we therefore call it a \"reverse\"
* transform rather than an \"inverse\" transform). * transform rather than an \"inverse\" transform).
* *
* @param[in] size The number of points in the real data. * @param[in] size The number of points in the real data.
* @param[in] measurelvl Measurement level for plan creation: * @param[in] measurelvl Measurement level for plan creation:
* - 0: no measurement, just estimate the plan; * - 0: no measurement, just estimate the plan;
* - 1: measure the best plan; * - 1: measure the best plan;
* - 2: perform a lengthy measurement of the best plan * - 2: perform a lengthy measurement of the best plan;
; * - 3: perform an exhasutive measurement of the best plan.
* - 3: perform an exhasutive measurement of the best
plan.
* @return A pointer to an allocated \c REAL8FFTPlan structure is returned * @return A pointer to an allocated \c REAL8FFTPlan structure is returned
* upon successful completion. Otherwise, a \c NULL pointer is returned * upon successful completion. Otherwise, a \c NULL pointer is returned
* and \c xlalErrno is set to indicate the error. * and \c xlalErrno is set to indicate the error.
* @par Errors: * @par Errors:
* The \c XLALCreateReverseREAL8Plan() function shall fail if: * The \c XLALCreateReverseREAL8Plan() function shall fail if:
* - [\c XLAL_EBADLEN] The size of the requested plan is 0. * - [\c XLAL_EBADLEN] The size of the requested plan is 0.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed.
* . * .
*/ */
REAL8FFTPlan * XLALCreateReverseREAL8FFTPlan( UINT4 size, int measurelvl ); REAL8FFTPlan * XLALCreateReverseREAL8FFTPlan( UINT4 size, int measurelvl );
/** Destroys a REAL8FFTPlan /**
* Destroys a REAL8FFTPlan
* @param[in] plan A pointer to the REAL8FFTPlan to be destroyed. * @param[in] plan A pointer to the REAL8FFTPlan to be destroyed.
* @return None. * @return None.
*/ */
void XLALDestroyREAL8FFTPlan( REAL8FFTPlan *plan ); void XLALDestroyREAL8FFTPlan( REAL8FFTPlan *plan );
/** Performs a forward FFT of REAL8 data /**
* Performs a forward FFT of REAL8 data
* *
* This routine performs the transformation: * This routine performs the transformation:
* \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f]
* where N, the size of the transform, is the length of the vector x. * where N, the size of the transform, is the length of the vector x.
* *
* @note * @note
* Due to the reality of the input data x, the following identity * Due to the reality of the input data x, the following identity
* holds for the complex FFT data: \f$z[N-k]=z^\ast[k]\f$. Therefore, * holds for the complex FFT data: \f$z[N-k]=z^\ast[k]\f$. Therefore,
* the length of the output vector is equal to \f$\lfloor N/2\rfloor + 1\f$ * the length of the output vector is equal to \f$\lfloor N/2\rfloor + 1\f$
* since the remaining \"negative\" frequency components can be obtained fr om the * since the remaining \"negative\" frequency components can be obtained fr om the
* \"positive\" frequency components. * \"positive\" frequency components.
* *
* @param[out] output The complex data vector z of length [N/2] + 1 * @param[out] output The complex data vector z of length [N/2] + 1
* that results from the transform * that results from the transform
* @param[in] input The real data vector x of length to be transformed * @param[in] input The real data vector x of length to be transformed
* @param[in] plan The FFT plan to use for the transform * @param[in] plan The FFT plan to use for the transform
* @return 0 upon successful completion or non-zero upon failure. * @return 0 upon successful completion or non-zero upon failure.
* @par Errors: * @par Errors:
* The \c XLALREAL8ForwardFFT() function shall fail if: * The \c XLALREAL8ForwardFFT() function shall fail if:
* - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments
s. .
* - [\c XLAL_EINVAL] A argument is invalid or the plan is for a * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a
* reverse transform. * reverse transform.
* - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are
* incompatible. * incompatible.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* . * .
*/ */
int XLALREAL8ForwardFFT( COMPLEX16Vector *output, REAL8Vector *input, int XLALREAL8ForwardFFT( COMPLEX16Vector *output, REAL8Vector *input,
const REAL8FFTPlan *plan ); const REAL8FFTPlan *plan );
/** Performs a reverse FFT of REAL8 data /**
* Performs a reverse FFT of REAL8 data
* *
* This routine performs the transformation: * This routine performs the transformation:
* \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f]
* where N, the size of the transform, is the length of the vector y. * where N, the size of the transform, is the length of the vector y.
* *
* @note * @note
* Due to the reality of the output data y, the following identity * Due to the reality of the output data y, the following identity
* holds for the complex data: \f$z[N-k]=z^\ast[k]\f$. Therefore, * holds for the complex data: \f$z[N-k]=z^\ast[k]\f$. Therefore,
* the length of the input vector is equal to \f$\lfloor N/2\rfloor + 1\f$ * the length of the input vector is equal to \f$\lfloor N/2\rfloor + 1\f$
* since the remaining \"negative\" frequency components can be obtained fr om the * since the remaining \"negative\" frequency components can be obtained fr om the
* \"positive\" frequency components. * \"positive\" frequency components.
* *
* @param[out] output The real data vector y of length N * @param[out] output The real data vector y of length N
* that results from the transform * that results from the transform
* @param[in] input The complex data vector z of length [N/2] + 1 * @param[in] input The complex data vector z of length [N/2] + 1
* to be transformed * to be transformed
* @param[in] plan The FFT plan to use for the transform * @param[in] plan The FFT plan to use for the transform
* @return 0 upon successful completion or non-zero upon failure. * @return 0 upon successful completion or non-zero upon failure.
* @par Errors: * @par Errors:
* The \c XLALREAL8ForwardFFT() function shall fail if: * The \c XLALREAL8ForwardFFT() function shall fail if:
* - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments
s. .
* - [\c XLAL_EINVAL] A argument is invalid or the plan is for a * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a
* reverse transform. * reverse transform.
* - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are
* incompatible. * incompatible.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* - [\c XLAL_EDOM] Domain error if the DC component of the input data, z[ * - [\c XLAL_EDOM] Domain error if the DC component of the input data, z[0
0], ],
* is not purely real * is not purely real
* or if the length of the output vector N is even and the Nyquist * or if the length of the output vector N is even and the Nyquist
* component of the input data, z[N/2], is not purely real. * component of the input data, z[N/2], is not purely real.
* . * .
*/ */
int XLALREAL8ReverseFFT( REAL8Vector *output, COMPLEX16Vector *input, int XLALREAL8ReverseFFT( REAL8Vector *output, COMPLEX16Vector *input,
const REAL8FFTPlan *plan ); const REAL8FFTPlan *plan );
/** Perform a REAL8Vector to REAL8Vector FFT /**
* Perform a REAL8Vector to REAL8Vector FFT
* *
* This routine computes * This routine computes
* \f[y[k]=\left\{\begin{array}{ll}\Re z[k]&0\le k\le\lfloor N/2\rfloor\\\I m z[N-k]&\lfloor N/2\rfloor<k<N\end{array}\right.\f] * \f[y[k]=\left\{\begin{array}{ll}\Re z[k]&0\le k\le\lfloor N/2\rfloor\\\I m z[N-k]&\lfloor N/2\rfloor<k<N\end{array}\right.\f]
* where \f[z[k] = \sum_{j=0}^{N-1} e^{\mp2\pi ijk/N}\,x[j],\f] * where \f[z[k] = \sum_{j=0}^{N-1} e^{\mp2\pi ijk/N}\,x[j],\f]
* and where the minus sign is used if a forward plan is provided as the ar gument * and where the minus sign is used if a forward plan is provided as the ar gument
* and the plus sign is used if a reverse plan is provided as the argument; * and the plus sign is used if a reverse plan is provided as the argument;
* here N is the length of the input vector x. * here N is the length of the input vector x.
* *
* @param[out] output The real output data vector y of length N * @param[out] output The real output data vector y of length N
* @param[in] input The input real data vector x of length N * @param[in] input The input real data vector x of length N
* @param[in] plan The FFT plan to use for the transform * @param[in] plan The FFT plan to use for the transform
* @note * @note
* The input and output vectors must be distinct. * The input and output vectors must be distinct.
* @return 0 upon successful completion or non-zero upon failure. * @return 0 upon successful completion or non-zero upon failure.
* @par Errors: * @par Errors:
* The \c XLALREAL8VectorFFT() function shall fail if: * The \c XLALREAL8VectorFFT() function shall fail if:
* - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments
s. .
* - [\c XLAL_EINVAL] A argument is invalid or the input and output data * - [\c XLAL_EINVAL] A argument is invalid or the input and output data
* vectors are the same. * vectors are the same.
* - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are
* incompatible. * incompatible.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* . * .
*/ */
int XLALREAL8VectorFFT( REAL8Vector *output, REAL8Vector *input, int XLALREAL8VectorFFT( REAL8Vector *output, REAL8Vector *input,
const REAL8FFTPlan *plan ); const REAL8FFTPlan *plan );
/** Computes the power spectrum of REAL8 data /**
* Computes the power spectrum of REAL8 data
* *
* This routine computes * This routine computes
* \f[P[k]=\left\{\begin{array}{ll}|z[0]|^2 & k=0\\2|z[k]|^2 & 1\leq \lfloo r (N+1)/2\rfloor\\ |z[N/2]|^2 & k=N/2,\;\mbox{$N$ even}\end{array}\right.\f ] * \f[P[k]=\left\{\begin{array}{ll}|z[0]|^2 & k=0\\2|z[k]|^2 & 1\leq \lfloo r (N+1)/2\rfloor\\ |z[N/2]|^2 & k=N/2,\;\mbox{$N$ even}\end{array}\right.\f ]
* where \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j],\f] * where \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j],\f]
* and N is the length of the input vector x. * and N is the length of the input vector x.
* *
* @param[out] spec The real power spectrum P of length [N/2] + 1 of the da ta x * @param[out] spec The real power spectrum P of length [N/2] + 1 of the da ta x
* @param[in] data The input real data vector x of length N * @param[in] data The input real data vector x of length N
* @param[in] plan The FFT plan to use for the transform * @param[in] plan The FFT plan to use for the transform
* @return 0 upon successful completion or non-zero upon failure. * @return 0 upon successful completion or non-zero upon failure.
* @par Errors: * @par Errors:
* The \c XLALREAL8PowerSpectrum() function shall fail if: * The \c XLALREAL8PowerSpectrum() function shall fail if:
* - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments
s. .
* - [\c XLAL_EINVAL] A argument is invalid or the plan is for a * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a
* reverse transform. * reverse transform.
* - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are
* incompatible. * incompatible.
* - [\c XLAL_ENOMEM] Insufficient storage space is available. * - [\c XLAL_ENOMEM] Insufficient storage space is available.
* . * .
*/ */
int XLALREAL8PowerSpectrum( REAL8Vector *spec, REAL8Vector *data, int XLALREAL8PowerSpectrum( REAL8Vector *spec, REAL8Vector *data,
const REAL8FFTPlan *plan ); const REAL8FFTPlan *plan );
/* /*
* *
* LAL REAL4 functions * LAL REAL4 functions
* *
*/ */
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALCreateForwardREAL4FFTPlan() instead. * @deprecated Use XLALCreateForwardREAL4FFTPlan() instead.
*/ */
void void
LALCreateForwardREAL4FFTPlan( LALCreateForwardREAL4FFTPlan(
LALStatus *status, LALStatus *status,
REAL4FFTPlan **plan, REAL4FFTPlan **plan,
UINT4 size, UINT4 size,
INT4 measure INT4 measure
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALCreateForwardREAL4FFTPlan() instead. * @deprecated Use XLALCreateForwardREAL4FFTPlan() instead.
*/ */
#define LALCreateForwardRealFFTPlan LALCreateForwardREAL4FFTPlan #define LALCreateForwardRealFFTPlan LALCreateForwardREAL4FFTPlan
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALCreateReverseREAL4FFTPlan() instead. * @deprecated Use XLALCreateReverseREAL4FFTPlan() instead.
*/ */
void void
LALCreateReverseREAL4FFTPlan( LALCreateReverseREAL4FFTPlan(
LALStatus *status, LALStatus *status,
REAL4FFTPlan **plan, REAL4FFTPlan **plan,
UINT4 size, UINT4 size,
INT4 measure INT4 measure
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALCreateReverseREAL4FFTPlan() instead. * @deprecated Use XLALCreateReverseREAL4FFTPlan() instead.
*/ */
#define LALCreateReverseRealFFTPlan LALCreateReverseREAL4FFTPlan #define LALCreateReverseRealFFTPlan LALCreateReverseREAL4FFTPlan
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALDestroyREAL4FFTPlan() instead. * @deprecated Use XLALDestroyREAL4FFTPlan() instead.
*/ */
void void
LALDestroyREAL4FFTPlan( LALDestroyREAL4FFTPlan(
LALStatus *status, LALStatus *status,
REAL4FFTPlan **plan REAL4FFTPlan **plan
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALDestroyREAL4FFTPlan() instead. * @deprecated Use XLALDestroyREAL4FFTPlan() instead.
*/ */
#define LALDestroyRealFFTPlan LALDestroyREAL4FFTPlan #define LALDestroyRealFFTPlan LALDestroyREAL4FFTPlan
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALREAL4ForwardFFT() instead. * @deprecated Use XLALREAL4ForwardFFT() instead.
*/ */
void void
LALForwardREAL4FFT( LALForwardREAL4FFT(
LALStatus *status, LALStatus *status,
COMPLEX8Vector *output, COMPLEX8Vector *output,
REAL4Vector *input, REAL4Vector *input,
REAL4FFTPlan *plan REAL4FFTPlan *plan
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALREAL4ForwardFFT() instead. * @deprecated Use XLALREAL4ForwardFFT() instead.
*/ */
#define LALForwardRealFFT LALForwardREAL4FFT #define LALForwardRealFFT LALForwardREAL4FFT
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALREAL4ReverseFFT() instead. * @deprecated Use XLALREAL4ReverseFFT() instead.
*/ */
void void
LALReverseREAL4FFT( LALReverseREAL4FFT(
LALStatus *status, LALStatus *status,
REAL4Vector *output, REAL4Vector *output,
COMPLEX8Vector *input, COMPLEX8Vector *input,
REAL4FFTPlan *plan REAL4FFTPlan *plan
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALREAL4ReverseFFT() instead. * @deprecated Use XLALREAL4ReverseFFT() instead.
*/ */
#define LALReverseRealFFT LALReverseREAL4FFT #define LALReverseRealFFT LALReverseREAL4FFT
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALREAL4PowerSpectrum() instead. * @deprecated Use XLALREAL4PowerSpectrum() instead.
*/ */
void void
LALREAL4PowerSpectrum ( LALREAL4PowerSpectrum (
LALStatus *status, LALStatus *status,
REAL4Vector *spec, REAL4Vector *spec,
REAL4Vector *data, REAL4Vector *data,
REAL4FFTPlan *plan REAL4FFTPlan *plan
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALREAL4PowerSpectrum() instead. * @deprecated Use XLALREAL4PowerSpectrum() instead.
*/ */
#define LALRealPowerSpectrum LALREAL4PowerSpectrum #define LALRealPowerSpectrum LALREAL4PowerSpectrum
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALREAL4VectorFFT() instead. * @deprecated Use XLALREAL4VectorFFT() instead.
*/ */
void void
LALREAL4VectorFFT( LALREAL4VectorFFT(
LALStatus *status, LALStatus *status,
REAL4Vector *output, REAL4Vector *output,
REAL4Vector *input, REAL4Vector *input,
REAL4FFTPlan *plan REAL4FFTPlan *plan
); );
/* /*
* *
* LAL REAL8 functions * LAL REAL8 functions
* *
*/ */
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALCreateForwardREAL8FFTPlan() instead. * @deprecated Use XLALCreateForwardREAL8FFTPlan() instead.
*/ */
void void
LALCreateForwardREAL8FFTPlan( LALCreateForwardREAL8FFTPlan(
LALStatus *status, LALStatus *status,
REAL8FFTPlan **plan, REAL8FFTPlan **plan,
UINT4 size, UINT4 size,
INT4 measure INT4 measure
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALCreateReverseREAL8FFTPlan() instead. * @deprecated Use XLALCreateReverseREAL8FFTPlan() instead.
*/ */
void void
LALCreateReverseREAL8FFTPlan( LALCreateReverseREAL8FFTPlan(
LALStatus *status, LALStatus *status,
REAL8FFTPlan **plan, REAL8FFTPlan **plan,
UINT4 size, UINT4 size,
INT4 measure INT4 measure
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALDestroyREAL8FFTPlan() instead. * @deprecated Use XLALDestroyREAL8FFTPlan() instead.
*/ */
void void
LALDestroyREAL8FFTPlan( LALDestroyREAL8FFTPlan(
LALStatus *status, LALStatus *status,
REAL8FFTPlan **plan REAL8FFTPlan **plan
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALREAL8ForwardFFT() instead. * @deprecated Use XLALREAL8ForwardFFT() instead.
*/ */
void void
LALForwardREAL8FFT( LALForwardREAL8FFT(
LALStatus *status, LALStatus *status,
COMPLEX16Vector *output, COMPLEX16Vector *output,
REAL8Vector *input, REAL8Vector *input,
REAL8FFTPlan *plan REAL8FFTPlan *plan
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALREAL8ReverseFFT() instead. * @deprecated Use XLALREAL8ReverseFFT() instead.
*/ */
void void
LALReverseREAL8FFT( LALReverseREAL8FFT(
LALStatus *status, LALStatus *status,
REAL8Vector *output, REAL8Vector *output,
COMPLEX16Vector *input, COMPLEX16Vector *input,
REAL8FFTPlan *plan REAL8FFTPlan *plan
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALREAL8PowerSpectrum() instead. * @deprecated Use XLALREAL8PowerSpectrum() instead.
*/ */
void void
LALREAL8PowerSpectrum ( LALREAL8PowerSpectrum (
LALStatus *status, LALStatus *status,
REAL8Vector *spec, REAL8Vector *spec,
REAL8Vector *data, REAL8Vector *data,
REAL8FFTPlan *plan REAL8FFTPlan *plan
); );
/** \b DEPRECATED /**
* \b DEPRECATED
* @deprecated Use XLALREAL8VectorFFT() instead. * @deprecated Use XLALREAL8VectorFFT() instead.
*/ */
void void
LALREAL8VectorFFT( LALREAL8VectorFFT(
LALStatus *status, LALStatus *status,
REAL8Vector *output, REAL8Vector *output,
REAL8Vector *input, REAL8Vector *input,
REAL8FFTPlan *plan REAL8FFTPlan *plan
); );
 End of changes. 66 change blocks. 
182 lines changed or deleted 205 lines changed or added


 ResampleTimeSeries.h   ResampleTimeSeries.h 
skipping to change at line 32 skipping to change at line 32
#ifndef _RESAMPLETIMESERIES_H #ifndef _RESAMPLETIMESERIES_H
#define _RESAMPLETIMESERIES_H #define _RESAMPLETIMESERIES_H
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** \addtogroup ResampleTimeSeries_h /**
* \author Brown, D. A. * \addtogroup ResampleTimeSeries_h
* \author Brown, D. A.
* *
* \brief Provides routines to resample a time series. * \brief Provides routines to resample a time series.
* *
* At present only integer downsampling of ::REAL4TimeSeries by a power of two is supported. * At present only integer downsampling of ::REAL4TimeSeries by a power of two is supported.
* *
* \heading{Synopsis} * ### Synopsis ###
*
* \code * \code
* #include <lal/ResampleTimeSeries.h> * #include <lal/ResampleTimeSeries.h>
* \endcode * \endcode
* *
* This header covers routines that resample time series by applying * This header covers routines that resample time series by applying
* a low pass filter and decimating the resulting time series. Further * a low pass filter and decimating the resulting time series. Further
* documentation is given in the individual routines' modules. * documentation is given in the individual routines' modules.
* *
*/ */
/*@{*/ /*@{*/
/**\name Error Codes */ /**\name Error Codes */
/*@{*/ /*@{*/
#define RESAMPLETIMESERIESH_ENULL 1 /**< Null pointer */ #define RESAMPLETIMESERIESH_ENULL 1 /**< Null pointer */
#define RESAMPLETIMESERIESH_ENNUL 2 /**< Non-null pointer */ #define RESAMPLETIMESERIESH_ENNUL 2 /**< Non-null pointer */
#define RESAMPLETIMESERIESH_EZERO 3 /**< Length of input time series is zero */ #define RESAMPLETIMESERIESH_EZERO 3 /**< Length of input time series is zero */
#define RESAMPLETIMESERIESH_ERATE 4 /**< Sample rate is zero */ #define RESAMPLETIMESERIESH_ERATE 4 /**< Sample rate is zero */
#define RESAMPLETIMESERIESH_EUPSM 5 /**< Cannot upsample */ #define RESAMPLETIMESERIESH_EUPSM 5 /**< Cannot upsample */
#define RESAMPLETIMESERIESH_EHIGH 6 /**< Input sample rate is greater th an 32kHz */ #define RESAMPLETIMESERIESH_EHIGH 6 /**< Input sample rate is greater th an 32kHz */
skipping to change at line 78 skipping to change at line 80
#define RESAMPLETIMESERIESH_MSGEZERO "Length of input time series is zero" #define RESAMPLETIMESERIESH_MSGEZERO "Length of input time series is zero"
#define RESAMPLETIMESERIESH_MSGERATE "Sample rate is zero" #define RESAMPLETIMESERIESH_MSGERATE "Sample rate is zero"
#define RESAMPLETIMESERIESH_MSGEUPSM "Cannot upsample" #define RESAMPLETIMESERIESH_MSGEUPSM "Cannot upsample"
#define RESAMPLETIMESERIESH_MSGEHIGH "Input sample rate is greater than 32k Hz" #define RESAMPLETIMESERIESH_MSGEHIGH "Input sample rate is greater than 32k Hz"
#define RESAMPLETIMESERIESH_MSGELOG2 "Only power-of-two resampling is avali able" #define RESAMPLETIMESERIESH_MSGELOG2 "Only power-of-two resampling is avali able"
#define RESAMPLETIMESERIESH_MSGEFILT "Unknown filter type" #define RESAMPLETIMESERIESH_MSGEFILT "Unknown filter type"
#define RESAMPLETIMESERIESH_MSGEINVD "Invalid or non-integer resample facto r" #define RESAMPLETIMESERIESH_MSGEINVD "Invalid or non-integer resample facto r"
#define RESAMPLETIMESERIESH_MSGELDAS "Input resample factor with LDAS FIR" #define RESAMPLETIMESERIESH_MSGELDAS "Input resample factor with LDAS FIR"
/** \endcond */ /** \endcond */
/** This enum type contains the different low pass filters available to /**
* This enum type contains the different low pass filters available to
* prevent power above the new Nyquist frequency entering the resampled * prevent power above the new Nyquist frequency entering the resampled
* time series due to aliasing. * time series due to aliasing.
*/ */
typedef enum typedef enum
{ {
defaultButterworth, /**< An IIR butterwoth filter of order 20 with atten uation 0.1 at the new Nyquist frequency. defaultButterworth, /**< An IIR butterwoth filter of order 20 with atten uation 0.1 at the new Nyquist frequency.
* See the package tdfilters for documentation of b utterworth filters in LAL. * See the package tdfilters for documentation of b utterworth filters in LAL.
*/ */
LDASfirLP /**< For downsampling by a factor of 2, 4 or 8 an LDASfirLP /**< For downsampling by a factor of 2, 4 or 8 an
* implementation of the FIR filter used by the LDA S datacondAPI resample(). * implementation of the FIR filter used by the LDA S datacondAPI resample().
* This is provided for testing the result of stand alone codes and codes * This is provided for testing the result of stand alone codes and codes
* running under LDAS. The LDAS filter provided her e has filter order parameter * running under LDAS. The LDAS filter provided her e has filter order parameter
* 10, so the order of the filter is \f$2 \times 10 \times q\f$ where \f$q\f$ is the * 10, so the order of the filter is \f$2 \times 10 \times q\f$ where \f$q\f$ is the
* resampling ratio. * resampling ratio.
*/ */
} }
ResampleTSFilter; ResampleTSFilter;
/** This union is provided so that the code can store the parameters of the /**
* This union is provided so that the code can store the parameters of the
* filter in a place accessible by the user for user designed low pass filt ers. * filter in a place accessible by the user for user designed low pass filt ers.
* This is not presently implemented and this structure may be ignored. * This is not presently implemented and this structure may be ignored.
*/ */
typedef union typedef union
tagResampleTSFilterParams tagResampleTSFilterParams
{ {
PassBandParamStruc butterworth; /**< A structure of type \c PassBand ParamStruc used to store the parameters PassBandParamStruc butterworth; /**< A structure of type \c PassBand ParamStruc used to store the parameters
* of the butterworth filter used t o perform low pass filtering * of the butterworth filter used t o perform low pass filtering
*/ */
REAL8IIRFilter iirfilter; /**< A structure of type \c REAL8IIR Filter used to store the parameters of REAL8IIRFilter iirfilter; /**< A structure of type \c REAL8IIR Filter used to store the parameters of
* the IIR or FIR filter used to pe rform low pass filtering * the IIR or FIR filter used to pe rform low pass filtering
*/ */
} }
ResampleTSFilterParams; ResampleTSFilterParams;
/** This structure controls the behaviour of the resampling function. /**
* This structure controls the behaviour of the resampling function.
*/ */
typedef struct typedef struct
tagResampleTSParams tagResampleTSParams
{ {
REAL8 deltaT; /**< The sample interval desired in the down sampled time series */ REAL8 deltaT; /**< The sample interval desired in the down sampled time series */
ResampleTSFilter filterType; /**< The type of filter with which t o perform the low pass filtering */ ResampleTSFilter filterType; /**< The type of filter with which t o perform the low pass filtering */
ResampleTSFilterParams filterParams; /**< Filter parameters for t he low pass filter (Presently ignored) */ ResampleTSFilterParams filterParams; /**< Filter parameters for t he low pass filter (Presently ignored) */
} }
ResampleTSParams; ResampleTSParams;
 End of changes. 6 change blocks. 
7 lines changed or deleted 12 lines changed or added


 RngMedBias.h   RngMedBias.h 
skipping to change at line 48 skipping to change at line 48
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup RngMedBias_h * \addtogroup RngMedBias_h
\author Krishnan, B., Itoh, Y. * \author Krishnan, B., Itoh, Y.
*
\brief Routine for finding bias in median for exponential distribution * \brief Routine for finding bias in median for exponential distribution
*
\heading{Synopsis} * ### Synopsis ###
*
\code * \code
#include <lal/RngMedBias.h> * #include <lal/RngMedBias.h>
\endcode * \endcode
*
*/ */
/*@{*/ /*@{*/
/**\name Error Codes */ /**\name Error Codes */
/*@{*/ /*@{*/
#define RNGMEDBIASH_ENULL 1 /**< Null pointer */ #define RNGMEDBIASH_ENULL 1 /**< Null pointer */
#define RNGMEDBIASH_EVAL 5 /**< Invalid value */ #define RNGMEDBIASH_EVAL 5 /**< Invalid value */
/*@}*/ /*@}*/
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
#define RNGMEDBIASH_MSGENULL "Null pointer" #define RNGMEDBIASH_MSGENULL "Null pointer"
skipping to change at line 95 skipping to change at line 95
/* /*
* 11. Extern Global variables. (discouraged) * 11. Extern Global variables. (discouraged)
*/ */
/* /*
* 12. Functions Declarations (i.e., prototypes). * 12. Functions Declarations (i.e., prototypes).
*/ */
REAL8 XLALRngMedBias ( INT4 blkSize ); REAL8 XLALRngMedBias ( INT4 blkSize );
// ------------------------------ obsolte and deprecated LAL-interface func tions -------------------- /* ------------------------------ obsolte and deprecated LAL-interface func tions -------------------- */
void LALRngMedBias (LALStatus *status, void LALRngMedBias (LALStatus *status,
REAL8 *biasFactor, REAL8 *biasFactor,
INT4 blkSize INT4 blkSize
); );
/*@}*/ /*@}*/
#ifdef __cplusplus #ifdef __cplusplus
} /* Close C++ protection */ } /* Close C++ protection */
#endif #endif
 End of changes. 2 change blocks. 
13 lines changed or deleted 13 lines changed or added


 Segments.h   Segments.h 
skipping to change at line 32 skipping to change at line 32
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#include <lal/XLALError.h> #include <lal/XLALError.h>
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** \addtogroup Segments_h /**
\author Peter Shawhan * \addtogroup Segments_h
* \author Peter Shawhan
\brief Provides data types and functions for manipulating lists of ``se *
gments'' (GPS time intervals). * \brief Provides data types and functions for manipulating lists of ``seg
ments'' (GPS time intervals).
\heading{Synopsis} *
\code * ### Synopsis ###
#include <lal/Segments.h> *
\endcode * \code
* #include <lal/Segments.h>
This header defines data structures for segments and lists of * \endcode
segments, as well as prototypes for functions that manipulate them. *
* This header defines data structures for segments and lists of
A segment is a time interval with a start time and an end time. The end ti * segments, as well as prototypes for functions that manipulate them.
me *
must be equal to or later than the start time. If the end time is equal to * A segment is a time interval with a start time and an end time. The end
the start time, then the segment represents a point in time. If the end ti time
me * must be equal to or later than the start time. If the end time is equal
is later than the start time, then the segment represents a half-open time to
interval, inclusive of its starting point and exclusive of its ending point * the start time, then the segment represents a point in time. If the end
. time
* is later than the start time, then the segment represents a half-open ti
All of the segment list manipulation functions are XLAL functions. me
They handle error conditions by invoking the current XLAL error handler * interval, inclusive of its starting point and exclusive of its ending po
and setting \c xlalErrno to a nonzero value. int.
*
\heading{Error conditions} * All of the segment list manipulation functions are XLAL functions.
* They handle error conditions by invoking the current XLAL error handler
<table><tr><th>xlalErrno</th><th>description</th></tr> * and setting \c xlalErrno to a nonzero value.
<tr><td> XLAL_EFAULT</td><td>Null pointer passed for some argument</td></ *
tr> * ### Error conditions ###
<tr><td> XLAL_EINVAL</td><td>Attempted to use an uninitialized segment li *
st structure</td></tr> * <table><tr><th>xlalErrno</th><th>description</th></tr>
<tr><td> XLAL_EDOM</td><td>Pair of GPS times does not represent a valid s * <tr><td> XLAL_EFAULT</td><td>Null pointer passed for some argument</td
egment</td></tr> ></tr>
</table> * <tr><td> XLAL_EINVAL</td><td>Attempted to use an uninitialized segment
list structure</td></tr>
\heading{Notes} * <tr><td> XLAL_EDOM</td><td>Pair of GPS times does not represent a vali
d segment</td></tr>
A \c LALSegList must be initialized before it is used. Initialization * </table>
leaves it in an ``empty'' state, containing no segments. They also must be *
''cleared'' * ### Notes ###
after using \c XLALSegListClear(), and freed with \c LALFree() if it was dy *
namically allocated. * A \c LALSegList must be initialized before it is used. Initialization
Segments can then be added to the list through an ``append'' operation. Th * leaves it in an ``empty'' state, containing no segments. They also must
e information about be ''cleared''
each segment appended is copied to a memory location managed by the * after using \c XLALSegListClear(), and freed with \c LALFree() if it was
\c LALSegList object. In fact, the segments are stored in the form of dynamically allocated.
an array of \c LALSeg structures, with the \c segs field of * Segments can then be added to the list through an ``append'' operation.
the segment list structure being the base address of the array. The information about
This allows the segments to be accessed directly using a pointer as an * each segment appended is copied to a memory location managed by the
iterator, as in the following example code: * \c LALSegList object. In fact, the segments are stored in the form of
* an array of \c LALSeg structures, with the \c segs field of
\code * the segment list structure being the base address of the array.
LALSegList mylist; * This allows the segments to be accessed directly using a pointer as an
LALSeg *segp; * iterator, as in the following example code:
... *
/\* (Append segments to the segment list 'mylist' here) *\/ * \code
... * LALSegList mylist;
for ( segp=mylist.segs; segp<mylist.segs+mylist.length; segp++ ) { * LALSeg *segp;
* ...
printf( "The end time of the segment is GPS %d.%09d\n", segp->end.gpsSe * /\* (Append segments to the segment list 'mylist' here) *\/
conds, segp->end.gpsNanoSeconds ); * ...
* for ( segp=mylist.segs; segp<mylist.segs+mylist.length; segp++ ) {
} *
\endcode * printf( "The end time of the segment is GPS %d.%09d\n", segp->end.gpsSec
onds, segp->end.gpsNanoSeconds );
... or by using an integer array index, as in the following example code: *
* }
\code * \endcode
LALSegList mylist; *
LALSeg *segp; * ... or by using an integer array index, as in the following example code
INT4 iseg; :
LIGOTimeGPS startgps; *
... * \code
/\* (Append segments to the segment list 'mylist' here) *\/ * LALSegList mylist;
... * LALSeg *segp;
for ( iseg=0; iseg<mylist.length; iseg++ ) { * INT4 iseg;
* LIGOTimeGPS startgps;
/\* One way to access the segment... *\/ * ...
startgps = mylist.segs[iseg].start; * /\* (Append segments to the segment list 'mylist' here) *\/
printf( "The start time of the segment is GPS %d.%09d\n", startgps.gpsS * ...
econds, startgps.gpsNanoSeconds ); * for ( iseg=0; iseg<mylist.length; iseg++ ) {
*
/\* Another way to access the segment... *\/ * /\* One way to access the segment... *\/
segp = mylist.segs + iseg; * startgps = mylist.segs[iseg].start;
printf( "The end time of the segment is GPS %d.%09d\n", segp->end.gpsSe * printf( "The start time of the segment is GPS %d.%09d\n", startgps.gpsSe
conds, segp->end.gpsNanoSeconds ); conds, startgps.gpsNanoSeconds );
*
} * /\* Another way to access the segment... *\/
\endcode * segp = mylist.segs + iseg;
* printf( "The end time of the segment is GPS %d.%09d\n", segp->end.gpsSec
Note that if the segment list is empty, then the \c segs field will onds, segp->end.gpsNanoSeconds );
be NULL and the \c length field will be \f$0\f$. So be careful not to *
dereference the \c segs pointer unless you know that the length is * }
nonzero. * \endcode
*
A segment list is considered ``sorted'' if the segments are in ascending * Note that if the segment list is empty, then the \c segs field will
(or at least non-descending) order according to the comparison done by * be NULL and the \c length field will be \f$0\f$. So be careful not to
the \c XLALSegCmp() function. A segment list is considered ``disjoint'' * dereference the \c segs pointer unless you know that the length is
if no two segments in the list overlap, although they * nonzero.
may touch at an endpoint due to the half-open nature of the time intervals *
represented by segments. The \c LALSegList structure includes fields * A segment list is considered ``sorted'' if the segments are in ascending
which record whether the segment list is sorted and/or disjoint, and these * (or at least non-descending) order according to the comparison done by
are used to search the segment list more efficiently when possible. Note * the \c XLALSegCmp() function. A segment list is considered ``disjoint''
that a segment list could in principle be disjoint but not sorted, but that * if no two segments in the list overlap, although they
case is not of interest for the code; the \c disjoint field in the * may touch at an endpoint due to the half-open nature of the time interva
structure specifically means that the list is sorted \e and disjoint. ls
* represented by segments. The \c LALSegList structure includes fields
Also all segments in a segment list can be time-shifted using \c XLALSegLis * which record whether the segment list is sorted and/or disjoint, and the
tShift(). se
* are used to search the segment list more efficiently when possible. Not
*/ e
* that a segment list could in principle be disjoint but not sorted, but t
hat
* case is not of interest for the code; the \c disjoint field in the
* structure specifically means that the list is sorted \e and disjoint.
*
* Also all segments in a segment list can be time-shifted using \c XLALSeg
ListShift().
*
*/
/*@{*/ /*@{*/
/*------------------- Compile-time parameters -------------------*/ /*------------------- Compile-time parameters -------------------*/
#define SEGMENTSH_ALLOCBLOCK 64 /**< Initial number of LALSeg spaces to #define SEGMENTSH_ALLOCBLOCK 64 /**< Initial number of LALSeg spaces to
* allocate in memory at one time; this is * allocate in memory at one time; this is
* intended to reduce the number of memory * intended to reduce the number of memory
* reallocation calls needing to be made to * reallocation calls needing to be made to
* build up a segment list. For a large * build up a segment list. For a large
* segment list, the reallocation size * segment list, the reallocation size
* switches over to a multiplicative factor . * switches over to a multiplicative factor .
 End of changes. 1 change blocks. 
114 lines changed or deleted 123 lines changed or added


 SegmentsIO.h   SegmentsIO.h 
skipping to change at line 26 skipping to change at line 26
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA * MA 02111-1307 USA
*/ */
/** /**
* \addtogroup SegmentsIO_h * \addtogroup SegmentsIO_h
* \author Peter Shawhan * \author Peter Shawhan
* *
* \brief Provides segment list reading and writing functions as part of th e \c lalsupport library. * \brief Provides segment list reading and writing functions as part of th e \c lalsupport library.
* *
* \heading{Synopsis} * ### Synopsis ###
*
* \code * \code
* #include <lal/Segments.h> * #include <lal/Segments.h>
* #include <lal/SegmentsIO.h> * #include <lal/SegmentsIO.h>
* \endcode * \endcode
* *
* \heading{Notes} * ### Notes ###
*
* The baseline format of a segment list file is described at * The baseline format of a segment list file is described at
* <tt>http://www.lsc-group.phys.uwm.edu/daswg/docs/technical/seglist_forma t.html</tt> . * <tt>http://www.lsc-group.phys.uwm.edu/daswg/docs/technical/seglist_forma t.html</tt> .
*/ */
/*@{*/ /*@{*/
/**\name Error Codes */ /*@{*/ /**\name Error Codes */ /*@{*/
#define SEGMENTSIOH_ENULL 1 /**< Null pointer passed to function */ #define SEGMENTSIOH_ENULL 1 /**< Null pointer passed to function */
#define SEGMENTSIOH_EINVAL 2 /**< LALSegList structure was not properly initialized */ #define SEGMENTSIOH_EINVAL 2 /**< LALSegList structure was not properly initialized */
#define SEGMENTSIOH_EBADOPT 3 /**< Invalid option letter in options strin g */ #define SEGMENTSIOH_EBADOPT 3 /**< Invalid option letter in options strin g */
#define SEGMENTSIOH_ENOFMT 4 /**< No output format specified in options string */ #define SEGMENTSIOH_ENOFMT 4 /**< No output format specified in options string */
#define SEGMENTSIOH_EOPENR 5 /**< Error opening segment list file for re ading */ #define SEGMENTSIOH_EOPENR 5 /**< Error opening segment list file for re ading */
 End of changes. 2 change blocks. 
2 lines changed or deleted 4 lines changed or added


 SeqFactories.h   SeqFactories.h 
skipping to change at line 12 skipping to change at line 12
#define _SEQFACTORIES_H #define _SEQFACTORIES_H
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#include <lal/AVFactories.h> #include <lal/AVFactories.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup SeqFactories_h * \addtogroup SeqFactories_h
*
\brief Provides prototype and status code information for use of CreateVect * \brief Provides prototype and status code information for use of CreateV
orSequence and DestroyVectorSequence. ectorSequence and DestroyVectorSequence.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/SeqFactories.h> * \code
\endcode * #include <lal/SeqFactories.h>
* \endcode
\section sec_SF_XLALfcts XLAL Functions *
* \section sec_SF_XLALfcts XLAL Functions
\code *
REAL4VectorSequence * XLALCreateVectorSequence(UINT4 length, UINT4 veclen); * \code
void XLALCreateVectorSequence(REAL4VectorSequence *vecseq); * REAL4VectorSequence * XLALCreateVectorSequence(UINT4 length, UINT4 vecle
n);
<vecseqtype> * XLALCreate<vecseqtype>(UINT4 length, UINT4 veclen); * void XLALCreateVectorSequence(REAL4VectorSequence *vecseq);
void XLALCreate<vecseqtype>(<vecseqtype> *vecseq); *
\endcode * <vecseqtype> * XLALCreate<vecseqtype>(UINT4 length, UINT4 veclen);
* void XLALCreate<vecseqtype>(<vecseqtype> *vecseq);
Here <tt>\<vecseqtype\></tt> is one of * \endcode
\c COMPLEX16VectorSequence, *
\c COMPLEX8VectorSequence, * Here <tt>\<vecseqtype\></tt> is one of
\c REAL8VectorSequence, * \c COMPLEX16VectorSequence,
\c REAL4VectorSequence, * \c COMPLEX8VectorSequence,
\c INT8VectorSequence, * \c REAL8VectorSequence,
\c INT4VectorSequence, * \c REAL4VectorSequence,
\c INT2VectorSequence, * \c INT8VectorSequence,
\c UINT8VectorSequence, * \c INT4VectorSequence,
\c UINT4VectorSequence, * \c INT2VectorSequence,
\c UINT2VectorSequence, or * \c UINT8VectorSequence,
\c CHARVectorSequence. * \c UINT4VectorSequence,
* \c UINT2VectorSequence, or
\subsection ss_SF_desc Description * \c CHARVectorSequence.
*
The <tt>XLALCreate\<type\>VectorSequence</tt> functions create vector seque * \subsection ss_SF_desc Description
nces *
of type <tt>\<type\></tt>, length and vector length \c veclen. * The <tt>XLALCreate\<type\>VectorSequence</tt> functions create vector se
The function \c XLALCreateVectorSequence is the same as quences
\c XLALCreateREAL4VectorSequence. * of type <tt>\<type\></tt>, length and vector length \c veclen.
* The function \c XLALCreateVectorSequence is the same as
The <tt>XLALDestroy\<type\>VectorSequence</tt> functions deallocate the mem * \c XLALCreateREAL4VectorSequence.
ory *
allocation pointed to by \c vecseq including its contents. The function * The <tt>XLALDestroy\<type\>VectorSequence</tt> functions deallocate the
\c XLALDestroyVectorSequence is the same as memory
\c XLALDestroyREAL4VectorSequence. * allocation pointed to by \c vecseq including its contents. The function
* \c XLALDestroyVectorSequence is the same as
\subsection ss_SF_ret Return Values * \c XLALDestroyREAL4VectorSequence.
*
The create functions return a pointer to the created vector sequence if * \subsection ss_SF_ret Return Values
successful; upon failure they will return \c NULL and set \c xlalErrno *
to one of the following values: \c #XLAL_ENOMEM if memory allocation * The create functions return a pointer to the created vector sequence if
failed, or \c #XLAL_EBADLEN if the requested \c length or \c veclen * successful; upon failure they will return \c NULL and set \c xlalErrno
is zero. * to one of the following values: \c #XLAL_ENOMEM if memory allocation
* failed, or \c #XLAL_EBADLEN if the requested \c length or \c veclen
The destroy functions do not have a return value. They can fail if they ar * is zero.
e *
passed a \c NULL pointer, in which case \c xlalErrno is set to * The destroy functions do not have a return value. They can fail if they
\c #XLAL_EFAULT, or if the vector sequency passed to the destroy routine are
has zero length, vector length, or \c NULL data pointer then * passed a \c NULL pointer, in which case \c xlalErrno is set to
\c xlalErrno is set to \c #XLAL_EINVAL. * \c #XLAL_EFAULT, or if the vector sequency passed to the destroy routine
* has zero length, vector length, or \c NULL data pointer then
*/ * \c xlalErrno is set to \c #XLAL_EINVAL.
*
*/
/*@{*/ /*@{*/
/**\name Error Codes */ /**\name Error Codes */
/*@{*/ /*@{*/
#define SEQFACTORIESH_ESLENGTH 1 /**< Illegal sequence length. */ #define SEQFACTORIESH_ESLENGTH 1 /**< Illegal sequence length. */
#define SEQFACTORIESH_EVLENGTH 2 /**< Illegal vector length. */ #define SEQFACTORIESH_EVLENGTH 2 /**< Illegal vector length. */
#define SEQFACTORIESH_EALENGTH 4 /**< Illegal array dimension. */ #define SEQFACTORIESH_EALENGTH 4 /**< Illegal array dimension. */
#define SEQFACTORIESH_EVPTR 8 /**< Null sequence handle. */ #define SEQFACTORIESH_EVPTR 8 /**< Null sequence handle. */
#define SEQFACTORIESH_EUPTR 16 /**< Non-null sequence pointer. */ #define SEQFACTORIESH_EUPTR 16 /**< Non-null sequence pointer. */
#define SEQFACTORIESH_EDPTR 32 /**< Null sequence data. */ #define SEQFACTORIESH_EDPTR 32 /**< Null sequence data. */
skipping to change at line 96 skipping to change at line 97
#define SEQFACTORIESH_MSGESLENGTH "Illegal sequence length." #define SEQFACTORIESH_MSGESLENGTH "Illegal sequence length."
#define SEQFACTORIESH_MSGEVLENGTH "Illegal vector length." #define SEQFACTORIESH_MSGEVLENGTH "Illegal vector length."
#define SEQFACTORIESH_MSGEALENGTH "Illegal array dimension." #define SEQFACTORIESH_MSGEALENGTH "Illegal array dimension."
#define SEQFACTORIESH_MSGEVPTR "Null sequence handle." #define SEQFACTORIESH_MSGEVPTR "Null sequence handle."
#define SEQFACTORIESH_MSGEUPTR "Non-null sequence pointer." #define SEQFACTORIESH_MSGEUPTR "Non-null sequence pointer."
#define SEQFACTORIESH_MSGEDPTR "Null sequence data." #define SEQFACTORIESH_MSGEDPTR "Null sequence data."
#define SEQFACTORIESH_MSGEINPTR "Null input pointer." #define SEQFACTORIESH_MSGEINPTR "Null input pointer."
#define SEQFACTORIESH_MSGEMALLOC "Malloc failure." #define SEQFACTORIESH_MSGEMALLOC "Malloc failure."
/** \endcond */ /** \endcond */
/** \brief This structure stores the input required for creating a vector /**
* \brief This structure stores the input required for creating a vector
* sequence. This input includes the length of the sequence (i.e., the num ber of * sequence. This input includes the length of the sequence (i.e., the num ber of
* vectors) and the length of each vector. * vectors) and the length of each vector.
*/ */
typedef struct tagCreateVectorSequenceIn { typedef struct tagCreateVectorSequenceIn {
UINT4 length; /**< The sequence length */ UINT4 length; /**< The sequence length */
UINT4 vectorLength; /**< The length of each vector in the sequence */ UINT4 vectorLength; /**< The length of each vector in the sequence */
} CreateVectorSequenceIn; } CreateVectorSequenceIn;
/** \brief This structure stores the input required for creating an array /**
* \brief This structure stores the input required for creating an array
* sequence. This input includes the length of the sequence (i.e., the num ber of * sequence. This input includes the length of the sequence (i.e., the num ber of
* array) and the dimensions of each array index. * array) and the dimensions of each array index.
*/ */
typedef struct tagCreateArraySequenceIn { typedef struct tagCreateArraySequenceIn {
UINT4 length; /**< The sequence length */ UINT4 length; /**< The sequence length */
UINT4Vector *dimLength; /**< The dimensions of each array index (the same for every array in the sequence) */ UINT4Vector *dimLength; /**< The dimensions of each array index (the same for every array in the sequence) */
} CreateArraySequenceIn; } CreateArraySequenceIn;
/*@}*/ /*@}*/
/* ---------- end:SeqFactories_h ---------- */ /* ---------- end:SeqFactories_h ---------- */
/** \defgroup ArraySequenceFactories_c Module ArraySequenceFactories.c /**
\ingroup SeqFactories_h * \defgroup ArraySequenceFactories_c Module ArraySequenceFactories.c
* \ingroup SeqFactories_h
\brief Create/destroy \<datatype\>ArraySequence objects. *
* \brief Create/destroy \<datatype\>ArraySequence objects.
\heading{Description} *
* ### Description ###
The \c CreateArraySequence family of functions create a \<datatype\>ArraySe *
quence of the appropriate dimensions. * The \c CreateArraySequence family of functions create a \<datatype\>Arra
ySequence of the appropriate dimensions.
The \c DestroyArraySequence family of functions return the storage allocate *
d by the \c CreateArraySequence functions to the system. * The \c DestroyArraySequence family of functions return the storage alloc
*/ ated by the \c CreateArraySequence functions to the system.
*/
/*@{*/ /*@{*/
/** \name REAL4 prototypes (default name) */ /** \name REAL4 prototypes (default name) */
/*@{*/ /*@{*/
void LALCreateArraySequence(LALStatus *, REAL4ArraySequence **, void LALCreateArraySequence(LALStatus *, REAL4ArraySequence **,
CreateArraySequenceIn *); CreateArraySequenceIn *);
void LALDestroyArraySequence(LALStatus *, REAL4ArraySequence **); void LALDestroyArraySequence(LALStatus *, REAL4ArraySequence **);
/*@}*/ /*@}*/
/** \name INT2 prototypes */ /** \name INT2 prototypes */
skipping to change at line 240 skipping to change at line 244
COMPLEX16ArraySequence **arraySequence, COMPLEX16ArraySequence **arraySequence,
CreateArraySequenceIn *aSeqParams); CreateArraySequenceIn *aSeqParams);
void LALZDestroyArraySequence ( LALStatus *status, void LALZDestroyArraySequence ( LALStatus *status,
COMPLEX16ArraySequence **arraySeqence); COMPLEX16ArraySequence **arraySeqence);
/*@}*/ /*@}*/
/*@}*/ /*@}*/
/* ---------- end: ArraySequenceFactories_c ---------- */ /* ---------- end: ArraySequenceFactories_c ---------- */
/** \defgroup VectorSequenceFactories_c Module VectorSequenceFactories.c /**
\ingroup SeqFactories_h * \defgroup VectorSequenceFactories_c Module VectorSequenceFactories.c
\brief Create/destroy \<datatype\>VectorSequence objects. * \ingroup SeqFactories_h
* \brief Create/destroy \<datatype\>VectorSequence objects.
\heading{Description} *
* ### Description ###
The \c CreateVectorSequence family of functions create a \<datatype\>Vector *
Sequence of the appropriate dimensions. * The \c CreateVectorSequence family of functions create a \<datatype\>Vec
torSequence of the appropriate dimensions.
The \c DestroyVectorSequence family of functions return the storage allocat *
ed by the \c CreateVectorSequence functions to the system. * The \c DestroyVectorSequence family of functions return the storage allo
*/ cated by the \c CreateVectorSequence functions to the system.
*/
/*@{*/ /*@{*/
/** \name REAL4 prototypes (default name) */ /** \name REAL4 prototypes (default name) */
/*@{*/ /*@{*/
REAL4VectorSequence * XLALCreateVectorSequence ( UINT4 length, UINT4 veclen ); REAL4VectorSequence * XLALCreateVectorSequence ( UINT4 length, UINT4 veclen );
#ifndef SWIG /* exclude from SWIG interface */
void XLALDestroyVectorSequence ( REAL4VectorSequence * vecseq ); void XLALDestroyVectorSequence ( REAL4VectorSequence * vecseq );
#endif /* SWIG */
void LALCreateVectorSequence(LALStatus *, REAL4VectorSequence **, void LALCreateVectorSequence(LALStatus *, REAL4VectorSequence **,
CreateVectorSequenceIn *); CreateVectorSequenceIn *);
void LALDestroyVectorSequence(LALStatus *, REAL4VectorSequence**); void LALDestroyVectorSequence(LALStatus *, REAL4VectorSequence**);
/*@}*/ /*@}*/
/** \name CHAR prototypes */ /** \name CHAR prototypes */
/*@{*/ /*@{*/
CHARVectorSequence * XLALCreateCHARVectorSequence ( UINT4 length, UINT4 vec len ); CHARVectorSequence * XLALCreateCHARVectorSequence ( UINT4 length, UINT4 vec len );
void XLALDestroyCHARVectorSequence ( CHARVectorSequence * vecseq ); void XLALDestroyCHARVectorSequence ( CHARVectorSequence * vecseq );
 End of changes. 7 change blocks. 
90 lines changed or deleted 98 lines changed or added


 Sequence.h   Sequence.h 
skipping to change at line 33 skipping to change at line 33
#include <stddef.h> #include <stddef.h>
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
\addtogroup SequenceManipulation * \addtogroup SequenceManipulation
\author Kipp Cannon <kipp@gravity.phys.uwm.edu> * \author Kipp Cannon <kipp@gravity.phys.uwm.edu>
*
\brief This is a suite of functions for creating, destroying, and manipulat * \brief This is a suite of functions for creating, destroying, and manipu
ing LAL lating LAL
sequences. For example XLALCreateREAL4Sequence() is available for * sequences. For example XLALCreateREAL4Sequence() is available for
creating sequences of \c REAL4 data. * creating sequences of \c REAL4 data.
*/ */
/*@{*/ /*@{*/
/** \name Creation Functions /**
\heading{Synopsis} * \name Creation Functions
*
\code * ### Synopsis ###
#include <lal/Sequence.h> *
* \code
XLALCreate<sequencetype>() * #include <lal/Sequence.h>
LALCreate<sequencetype>() *
\endcode * XLALCreate<sequencetype>()
* LALCreate<sequencetype>()
\heading{Description} * \endcode
*
These functions create LAL sequences. The parameter \c length * ### Description ###
specifies the length of the desired sequence. The return value is a *
pointer to the newly created sequence or \c NULL on failure. * These functions create LAL sequences. The parameter \c length
*/ * specifies the length of the desired sequence. The return value is a
* pointer to the newly created sequence or \c NULL on failure.
*/
/*@{*/ /*@{*/
COMPLEX8Sequence *XLALCreateCOMPLEX8Sequence ( size_t length ); COMPLEX8Sequence *XLALCreateCOMPLEX8Sequence ( size_t length );
COMPLEX16Sequence *XLALCreateCOMPLEX16Sequence ( size_t length ); COMPLEX16Sequence *XLALCreateCOMPLEX16Sequence ( size_t length );
REAL4Sequence *XLALCreateREAL4Sequence ( size_t length ); REAL4Sequence *XLALCreateREAL4Sequence ( size_t length );
REAL8Sequence *XLALCreateREAL8Sequence ( size_t length ); REAL8Sequence *XLALCreateREAL8Sequence ( size_t length );
INT2Sequence *XLALCreateINT2Sequence ( size_t length ); INT2Sequence *XLALCreateINT2Sequence ( size_t length );
INT4Sequence *XLALCreateINT4Sequence ( size_t length ); INT4Sequence *XLALCreateINT4Sequence ( size_t length );
INT8Sequence *XLALCreateINT8Sequence ( size_t length ); INT8Sequence *XLALCreateINT8Sequence ( size_t length );
UINT2Sequence *XLALCreateUINT2Sequence ( size_t length ); UINT2Sequence *XLALCreateUINT2Sequence ( size_t length );
UINT4Sequence *XLALCreateUINT4Sequence ( size_t length ); UINT4Sequence *XLALCreateUINT4Sequence ( size_t length );
UINT8Sequence *XLALCreateUINT8Sequence ( size_t length ); UINT8Sequence *XLALCreateUINT8Sequence ( size_t length );
/*@}*/ /*@}*/
/** \name Destruction Functions /**
* \name Destruction Functions
\heading{Synopsis} *
* ### Synopsis ###
\code *
#include <lal/Sequence.h> * \code
* #include <lal/Sequence.h>
XLALDestroy<sequencetype>() *
\endcode * XLALDestroy<sequencetype>()
* \endcode
\heading{Description} *
* ### Description ###
These functions free all memory associated with a LAL sequence. It is safe *
to pass \c NULL to these functions. * These functions free all memory associated with a LAL sequence. It is s
afe
*/ * to pass \c NULL to these functions.
*
*/
/*@{*/ /*@{*/
void XLALDestroyCOMPLEX8Sequence ( COMPLEX8Sequence *sequence ); void XLALDestroyCOMPLEX8Sequence ( COMPLEX8Sequence *sequence );
void XLALDestroyCOMPLEX16Sequence ( COMPLEX16Sequence *sequence ); void XLALDestroyCOMPLEX16Sequence ( COMPLEX16Sequence *sequence );
void XLALDestroyREAL4Sequence ( REAL4Sequence *sequence ); void XLALDestroyREAL4Sequence ( REAL4Sequence *sequence );
void XLALDestroyREAL8Sequence ( REAL8Sequence *sequence ); void XLALDestroyREAL8Sequence ( REAL8Sequence *sequence );
void XLALDestroyINT2Sequence ( INT2Sequence *sequence ); void XLALDestroyINT2Sequence ( INT2Sequence *sequence );
void XLALDestroyINT4Sequence ( INT4Sequence *sequence ); void XLALDestroyINT4Sequence ( INT4Sequence *sequence );
void XLALDestroyINT8Sequence ( INT8Sequence *sequence ); void XLALDestroyINT8Sequence ( INT8Sequence *sequence );
void XLALDestroyUINT2Sequence ( UINT2Sequence *sequence ); void XLALDestroyUINT2Sequence ( UINT2Sequence *sequence );
void XLALDestroyUINT4Sequence ( UINT4Sequence *sequence ); void XLALDestroyUINT4Sequence ( UINT4Sequence *sequence );
void XLALDestroyUINT8Sequence ( UINT8Sequence *sequence ); void XLALDestroyUINT8Sequence ( UINT8Sequence *sequence );
/*@}*/ /*@}*/
/** \name Cutting Functions /**
* \name Cutting Functions
\heading{Synopsis} *
* ### Synopsis ###
\code *
#include <lal/Sequence.h> * \code
* #include <lal/Sequence.h>
XLALCut<sequencetype>() *
XLALCopy<sequencetype>() * XLALCut<sequencetype>()
\endcode * XLALCopy<sequencetype>()
* \endcode
\heading{Description} *
* ### Description ###
These functions create a new sequence by extracting a section of an *
existing sequence. * These functions create a new sequence by extracting a section of an
* existing sequence.
*/ *
*/
/*@{*/ /*@{*/
COMPLEX8Sequence *XLALCutCOMPLEX8Sequence ( COMPLEX8Sequence *sequence, siz e_t first, size_t length ); COMPLEX8Sequence *XLALCutCOMPLEX8Sequence ( COMPLEX8Sequence *sequence, siz e_t first, size_t length );
COMPLEX16Sequence *XLALCutCOMPLEX16Sequence ( COMPLEX16Sequence *sequence, size_t first, size_t length ); COMPLEX16Sequence *XLALCutCOMPLEX16Sequence ( COMPLEX16Sequence *sequence, size_t first, size_t length );
REAL4Sequence *XLALCutREAL4Sequence ( REAL4Sequence *sequence, size_t first , size_t length ); REAL4Sequence *XLALCutREAL4Sequence ( REAL4Sequence *sequence, size_t first , size_t length );
REAL8Sequence *XLALCutREAL8Sequence ( REAL8Sequence *sequence, size_t first , size_t length ); REAL8Sequence *XLALCutREAL8Sequence ( REAL8Sequence *sequence, size_t first , size_t length );
INT2Sequence *XLALCutINT2Sequence ( INT2Sequence *sequence, size_t first, s ize_t length ); INT2Sequence *XLALCutINT2Sequence ( INT2Sequence *sequence, size_t first, s ize_t length );
INT4Sequence *XLALCutINT4Sequence ( INT4Sequence *sequence, size_t first, s ize_t length ); INT4Sequence *XLALCutINT4Sequence ( INT4Sequence *sequence, size_t first, s ize_t length );
INT8Sequence *XLALCutINT8Sequence ( INT8Sequence *sequence, size_t first, s ize_t length ); INT8Sequence *XLALCutINT8Sequence ( INT8Sequence *sequence, size_t first, s ize_t length );
UINT2Sequence *XLALCutUINT2Sequence ( UINT2Sequence *sequence, size_t first , size_t length ); UINT2Sequence *XLALCutUINT2Sequence ( UINT2Sequence *sequence, size_t first , size_t length );
UINT4Sequence *XLALCutUINT4Sequence ( UINT4Sequence *sequence, size_t first , size_t length ); UINT4Sequence *XLALCutUINT4Sequence ( UINT4Sequence *sequence, size_t first , size_t length );
skipping to change at line 141 skipping to change at line 145
REAL4Sequence *XLALCopyREAL4Sequence ( REAL4Sequence *sequence ); REAL4Sequence *XLALCopyREAL4Sequence ( REAL4Sequence *sequence );
REAL8Sequence *XLALCopyREAL8Sequence ( REAL8Sequence *sequence ); REAL8Sequence *XLALCopyREAL8Sequence ( REAL8Sequence *sequence );
INT2Sequence *XLALCopyINT2Sequence ( INT2Sequence *sequence ); INT2Sequence *XLALCopyINT2Sequence ( INT2Sequence *sequence );
INT4Sequence *XLALCopyINT4Sequence ( INT4Sequence *sequence ); INT4Sequence *XLALCopyINT4Sequence ( INT4Sequence *sequence );
INT8Sequence *XLALCopyINT8Sequence ( INT8Sequence *sequence ); INT8Sequence *XLALCopyINT8Sequence ( INT8Sequence *sequence );
UINT2Sequence *XLALCopyUINT2Sequence ( UINT2Sequence *sequence ); UINT2Sequence *XLALCopyUINT2Sequence ( UINT2Sequence *sequence );
UINT4Sequence *XLALCopyUINT4Sequence ( UINT4Sequence *sequence ); UINT4Sequence *XLALCopyUINT4Sequence ( UINT4Sequence *sequence );
UINT8Sequence *XLALCopyUINT8Sequence ( UINT8Sequence *sequence ); UINT8Sequence *XLALCopyUINT8Sequence ( UINT8Sequence *sequence );
/*@}*/ /*@}*/
/** \name Shifting Functions /**
* \name Shifting Functions
\heading{Synopsis} *
* ### Synopsis ###
\code *
#include <lal/Sequence.h> * \code
* #include <lal/Sequence.h>
XLALShift<sequencetype>() *
\endcode * XLALShift<sequencetype>()
* \endcode
\heading{Description} *
* ### Description ###
These functions shift the samples in a sequence, with zeros being placed in *
the space that is freed. * These functions shift the samples in a sequence, with zeros being placed
*/ in
* the space that is freed.
*/
/*@{*/ /*@{*/
void XLALShiftCOMPLEX8Sequence ( COMPLEX8Sequence *sequence, int count ); void XLALShiftCOMPLEX8Sequence ( COMPLEX8Sequence *sequence, int count );
void XLALShiftCOMPLEX16Sequence ( COMPLEX16Sequence *sequence, int count ); void XLALShiftCOMPLEX16Sequence ( COMPLEX16Sequence *sequence, int count );
void XLALShiftREAL4Sequence ( REAL4Sequence *sequence, int count ); void XLALShiftREAL4Sequence ( REAL4Sequence *sequence, int count );
void XLALShiftREAL8Sequence ( REAL8Sequence *sequence, int count ); void XLALShiftREAL8Sequence ( REAL8Sequence *sequence, int count );
void XLALShiftINT2Sequence ( INT2Sequence *sequence, int count ); void XLALShiftINT2Sequence ( INT2Sequence *sequence, int count );
void XLALShiftINT4Sequence ( INT4Sequence *sequence, int count ); void XLALShiftINT4Sequence ( INT4Sequence *sequence, int count );
void XLALShiftINT8Sequence ( INT8Sequence *sequence, int count ); void XLALShiftINT8Sequence ( INT8Sequence *sequence, int count );
void XLALShiftUINT2Sequence ( UINT2Sequence *sequence, int count ); void XLALShiftUINT2Sequence ( UINT2Sequence *sequence, int count );
void XLALShiftUINT4Sequence ( UINT4Sequence *sequence, int count ); void XLALShiftUINT4Sequence ( UINT4Sequence *sequence, int count );
void XLALShiftUINT8Sequence ( UINT8Sequence *sequence, int count ); void XLALShiftUINT8Sequence ( UINT8Sequence *sequence, int count );
/*@}*/ /*@}*/
/** \name Resizing Functions /**
* \name Resizing Functions
\heading{Synopsis} *
* ### Synopsis ###
\code *
#include <lal/Sequence.h> * \code
* #include <lal/Sequence.h>
XLALResize<sequencetype>() *
XLALShrink<sequencetype>() * XLALResize<sequencetype>()
\endcode * XLALShrink<sequencetype>()
* \endcode
\heading{Description} *
* ### Description ###
The resize functions alter the size of an existing sequence. The sequence *
is adjusted to have the specified length, and that part of the original * The resize functions alter the size of an existing sequence. The sequen
sequence starting at sample first is used to fill the new sequence. If ce
first is negative, then the start of the new sequence is padded by that * is adjusted to have the specified length, and that part of the original
many samples. If part of the new sequence does not correspond to some part * sequence starting at sample first is used to fill the new sequence. If
of the original sequence, then those samples are set to 0. * first is negative, then the start of the new sequence is padded by that
* many samples. If part of the new sequence does not correspond to some p
The shrink functions, originally, could only handle the special case in art
which the new sequence is wholly contained in the original sequence. Now * of the original sequence, then those samples are set to 0.
the shrink functions are wrappers for the resize functions and are only *
retained for backwards compatibility. * The shrink functions, originally, could only handle the special case in
* which the new sequence is wholly contained in the original sequence. No
*/ w
* the shrink functions are wrappers for the resize functions and are only
* retained for backwards compatibility.
*
*/
/*@{*/ /*@{*/
COMPLEX8Sequence *XLALResizeCOMPLEX8Sequence ( COMPLEX8Sequence *sequence, int first, size_t length ); COMPLEX8Sequence *XLALResizeCOMPLEX8Sequence ( COMPLEX8Sequence *sequence, int first, size_t length );
COMPLEX16Sequence *XLALResizeCOMPLEX16Sequence ( COMPLEX16Sequence *sequenc e, int first, size_t length ); COMPLEX16Sequence *XLALResizeCOMPLEX16Sequence ( COMPLEX16Sequence *sequenc e, int first, size_t length );
REAL4Sequence *XLALResizeREAL4Sequence ( REAL4Sequence *sequence, int first , size_t length ); REAL4Sequence *XLALResizeREAL4Sequence ( REAL4Sequence *sequence, int first , size_t length );
REAL8Sequence *XLALResizeREAL8Sequence ( REAL8Sequence *sequence, int first , size_t length ); REAL8Sequence *XLALResizeREAL8Sequence ( REAL8Sequence *sequence, int first , size_t length );
INT2Sequence *XLALResizeINT2Sequence ( INT2Sequence *sequence, int first, s ize_t length ); INT2Sequence *XLALResizeINT2Sequence ( INT2Sequence *sequence, int first, s ize_t length );
INT4Sequence *XLALResizeINT4Sequence ( INT4Sequence *sequence, int first, s ize_t length ); INT4Sequence *XLALResizeINT4Sequence ( INT4Sequence *sequence, int first, s ize_t length );
INT8Sequence *XLALResizeINT8Sequence ( INT8Sequence *sequence, int first, s ize_t length ); INT8Sequence *XLALResizeINT8Sequence ( INT8Sequence *sequence, int first, s ize_t length );
UINT2Sequence *XLALResizeUINT2Sequence ( UINT2Sequence *sequence, int first , size_t length ); UINT2Sequence *XLALResizeUINT2Sequence ( UINT2Sequence *sequence, int first , size_t length );
UINT4Sequence *XLALResizeUINT4Sequence ( UINT4Sequence *sequence, int first , size_t length ); UINT4Sequence *XLALResizeUINT4Sequence ( UINT4Sequence *sequence, int first , size_t length );
skipping to change at line 219 skipping to change at line 225
REAL4Sequence *XLALShrinkREAL4Sequence ( REAL4Sequence *sequence, size_t fi rst, size_t length ); REAL4Sequence *XLALShrinkREAL4Sequence ( REAL4Sequence *sequence, size_t fi rst, size_t length );
REAL8Sequence *XLALShrinkREAL8Sequence ( REAL8Sequence *sequence, size_t fi rst, size_t length ); REAL8Sequence *XLALShrinkREAL8Sequence ( REAL8Sequence *sequence, size_t fi rst, size_t length );
INT2Sequence *XLALShrinkINT2Sequence ( INT2Sequence *sequence, size_t first , size_t length ); INT2Sequence *XLALShrinkINT2Sequence ( INT2Sequence *sequence, size_t first , size_t length );
INT4Sequence *XLALShrinkINT4Sequence ( INT4Sequence *sequence, size_t first , size_t length ); INT4Sequence *XLALShrinkINT4Sequence ( INT4Sequence *sequence, size_t first , size_t length );
INT8Sequence *XLALShrinkINT8Sequence ( INT8Sequence *sequence, size_t first , size_t length ); INT8Sequence *XLALShrinkINT8Sequence ( INT8Sequence *sequence, size_t first , size_t length );
UINT2Sequence *XLALShrinkUINT2Sequence ( UINT2Sequence *sequence, size_t fi rst, size_t length ); UINT2Sequence *XLALShrinkUINT2Sequence ( UINT2Sequence *sequence, size_t fi rst, size_t length );
UINT4Sequence *XLALShrinkUINT4Sequence ( UINT4Sequence *sequence, size_t fi rst, size_t length ); UINT4Sequence *XLALShrinkUINT4Sequence ( UINT4Sequence *sequence, size_t fi rst, size_t length );
UINT8Sequence *XLALShrinkUINT8Sequence ( UINT8Sequence *sequence, size_t fi rst, size_t length ); UINT8Sequence *XLALShrinkUINT8Sequence ( UINT8Sequence *sequence, size_t fi rst, size_t length );
/*@}*/ /*@}*/
/** \name Summing Functions /**
* \name Summing Functions
\heading{Synopsis} *
* ### Synopsis ###
\code *
#include <lal/Sequence.h> * \code
* #include <lal/Sequence.h>
XLAL<datatype>Sum() *
XLAL<datatype>SumSquares() * XLAL<datatype>Sum()
XLAL<sequencetype>Sum>() * XLAL<datatype>SumSquares()
XLAL<sequencetype>SumSquares() * XLAL<sequencetype>Sum>()
\endcode * XLAL<sequencetype>SumSquares()
* \endcode
\heading{Description} *
* ### Description ###
The \c XLAL\<datatype\>Sum() and *
\c XLAL\<datatype\>SumSquares() functions sum the * The \c XLAL\<datatype\>Sum() and
elements and squares of the elements, respectively, in an array. * \c XLAL\<datatype\>SumSquares() functions sum the
* elements and squares of the elements, respectively, in an array.
The \c XLAL\<sequencetype\>Sum() and *
\c XLAL\<sequencetype\>SumSquares() functions sum the * The \c XLAL\<sequencetype\>Sum() and
elements and the squares of the elements, respectively in a sequence. * \c XLAL\<sequencetype\>SumSquares() functions sum the
Bounds checking is performed. * elements and the squares of the elements, respectively in a sequence.
* Bounds checking is performed.
In all cases, the return value is the sum, and these functions cannot fail. *
In the case of the sequence-related functions, if the sum extends beyond * In all cases, the return value is the sum, and these functions cannot fa
the bounds of the sequence, then the missing values are assumed to be 0. il.
* In the case of the sequence-related functions, if the sum extends beyond
\heading{Bugs} * the bounds of the sequence, then the missing values are assumed to be 0.
*
Because the LAL library must conform to the C89 specification, aggregate * ### Bugs ###
data types cannot be returned from functions so the COMPLEX8 and COMPLEX16 *
versions of the sum functions (not sum-of-squares functions) are commented * Because the LAL library must conform to the C89 specification, aggregate
out at this time. * data types cannot be returned from functions so the COMPLEX8 and COMPLEX
*/ 16
* versions of the sum functions (not sum-of-squares functions) are comment
ed
* out at this time.
*/
/*@{*/ /*@{*/
COMPLEX8 XLALCOMPLEX8Sum ( const COMPLEX8 *data, size_t first, size_t count ); COMPLEX8 XLALCOMPLEX8Sum ( const COMPLEX8 *data, size_t first, size_t count );
REAL4 XLALCOMPLEX8SumSquares ( const COMPLEX8 *data, size_t first, size_t c ount ); REAL4 XLALCOMPLEX8SumSquares ( const COMPLEX8 *data, size_t first, size_t c ount );
COMPLEX8 XLALCOMPLEX8SequenceSum ( const COMPLEX8Sequence *sequence, size_t first, size_t count ); COMPLEX8 XLALCOMPLEX8SequenceSum ( const COMPLEX8Sequence *sequence, size_t first, size_t count );
REAL4 XLALCOMPLEX8SequenceSumSquares ( const COMPLEX8Sequence *sequence, si ze_t first, size_t count ); REAL4 XLALCOMPLEX8SequenceSumSquares ( const COMPLEX8Sequence *sequence, si ze_t first, size_t count );
COMPLEX16 XLALCOMPLEX16Sum ( const COMPLEX16 *data, size_t first, size_t co unt ); COMPLEX16 XLALCOMPLEX16Sum ( const COMPLEX16 *data, size_t first, size_t co unt );
REAL8 XLALCOMPLEX16SumSquares ( const COMPLEX16 *data, size_t first, size_t count ); REAL8 XLALCOMPLEX16SumSquares ( const COMPLEX16 *data, size_t first, size_t count );
COMPLEX16 XLALCOMPLEX16SequenceSum ( const COMPLEX16Sequence *sequence, siz e_t first, size_t count ); COMPLEX16 XLALCOMPLEX16SequenceSum ( const COMPLEX16Sequence *sequence, siz e_t first, size_t count );
REAL8 XLALCOMPLEX16SequenceSumSquares ( const COMPLEX16Sequence *sequence, size_t first, size_t count ); REAL8 XLALCOMPLEX16SequenceSumSquares ( const COMPLEX16Sequence *sequence, size_t first, size_t count );
REAL4 XLALREAL4Sum ( const REAL4 *data, size_t first, size_t count ); REAL4 XLALREAL4Sum ( const REAL4 *data, size_t first, size_t count );
skipping to change at line 297 skipping to change at line 304
UINT4 XLALUINT4Sum ( const UINT4 *data, size_t first, size_t count ); UINT4 XLALUINT4Sum ( const UINT4 *data, size_t first, size_t count );
UINT4 XLALUINT4SumSquares ( const UINT4 *data, size_t first, size_t count ) ; UINT4 XLALUINT4SumSquares ( const UINT4 *data, size_t first, size_t count ) ;
UINT4 XLALUINT4SequenceSum ( const UINT4Sequence *sequence, size_t first, s ize_t count ); UINT4 XLALUINT4SequenceSum ( const UINT4Sequence *sequence, size_t first, s ize_t count );
UINT4 XLALUINT4SequenceSumSquares ( const UINT4Sequence *sequence, size_t f irst, size_t count ); UINT4 XLALUINT4SequenceSumSquares ( const UINT4Sequence *sequence, size_t f irst, size_t count );
UINT8 XLALUINT8Sum ( const UINT8 *data, size_t first, size_t count ); UINT8 XLALUINT8Sum ( const UINT8 *data, size_t first, size_t count );
UINT8 XLALUINT8SumSquares ( const UINT8 *data, size_t first, size_t count ) ; UINT8 XLALUINT8SumSquares ( const UINT8 *data, size_t first, size_t count ) ;
UINT8 XLALUINT8SequenceSum ( const UINT8Sequence *sequence, size_t first, s ize_t count ); UINT8 XLALUINT8SequenceSum ( const UINT8Sequence *sequence, size_t first, s ize_t count );
UINT8 XLALUINT8SequenceSumSquares ( const UINT8Sequence *sequence, size_t f irst, size_t count ); UINT8 XLALUINT8SequenceSumSquares ( const UINT8Sequence *sequence, size_t f irst, size_t count );
/*@}*/ /*@}*/
/** \name Conjugate Functions /**
* \name Conjugate Functions
\heading{Synopsis} *
* ### Synopsis ###
\code *
#include <lal/Sequence.h> * \code
* #include <lal/Sequence.h>
XLAL<datatype>Conjugate() *
\endcode * XLAL<datatype>Conjugate()
* \endcode
\heading{Description} *
* ### Description ###
These functions replace a sequence with its complex conjugate. *
* These functions replace a sequence with its complex conjugate.
*/ *
*/
/*@{*/ /*@{*/
COMPLEX8Sequence *XLALConjugateCOMPLEX8Sequence ( COMPLEX8Sequence *series ); COMPLEX8Sequence *XLALConjugateCOMPLEX8Sequence ( COMPLEX8Sequence *series );
COMPLEX16Sequence *XLALConjugateCOMPLEX16Sequence ( COMPLEX16Sequence *seri es ); COMPLEX16Sequence *XLALConjugateCOMPLEX16Sequence ( COMPLEX16Sequence *seri es );
/*@}*/ /*@}*/
/*@}*/ /*@}*/
#if 0 #if 0
{ /* so that editors will match succeeding brace */ { /* so that editors will match succeeding brace */
#elif defined(__cplusplus) #elif defined(__cplusplus)
 End of changes. 8 change blocks. 
148 lines changed or deleted 164 lines changed or added


 SimulateCoherentGW.h   SimulateCoherentGW.h 
skipping to change at line 34 skipping to change at line 34
#include <lal/DetectorSite.h> #include <lal/DetectorSite.h>
#include <lal/SkyCoordinates.h> #include <lal/SkyCoordinates.h>
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
\addtogroup SimulateCoherentGW_h * \addtogroup SimulateCoherentGW_h
\author Creighton, T. D. * \author Creighton, T. D.
\deprecated This module is deprecated, please see LALSimulation for a re * \deprecated This module is deprecated, please see LALSimulation for a re
placement. placement.
*/ *
/* * \brief Provides routines to simulate generic gravitational waveforms
\brief Provides routines to simulate generic gravitational waveforms * originating from a particular source.
originating from a particular source. *
* ### Synopsis ###
\heading{Synopsis} *
\code * \code
#include <lal/SimulateCoherentGW.h> * #include <lal/SimulateCoherentGW.h>
\endcode * \endcode
*
This header covers generic routines and structures to represent and * This header covers generic routines and structures to represent and
simulate the effects of a plane gravitational wave propagating from a * simulate the effects of a plane gravitational wave propagating from a
distinct point on the sky. * distinct point on the sky.
*
Any plane gravitational wave is specified by a direction * Any plane gravitational wave is specified by a direction
\f$\mathbf{\hat{n}}\f$ to its apparent source (i.e.\ opposite to its dir * \f$\mathbf{\hat{n}}\f$ to its apparent source (i.e.\ opposite to its dir
ection ection
of propagation), and by the inistantaneous values \f$h_+(t)\f$, * of propagation), and by the inistantaneous values \f$h_+(t)\f$,
\f$h_\times(t)\f$ of its plus and cross polarizations as functions of * \f$h_\times(t)\f$ of its plus and cross polarizations as functions of
(retarded) time \f$t=t_0+\mathbf{\hat{n}}\cdot(\mathbf{x}-\mathbf{x}_0)\ * (retarded) time \f$t=t_0+\mathbf{\hat{n}}\cdot(\mathbf{x}-\mathbf{x}_0)\
f$, where f$, where
\f$t_0\f$ is the time measured at some local reference point \f$\mathbf{ * \f$t_0\f$ is the time measured at some local reference point \f$\mathbf{
x}_0\f$, x}_0\f$,
and \f$t\f$ is the time measured by a synchronized clock at \f$\mathbf{x * and \f$t\f$ is the time measured by a synchronized clock at \f$\mathbf{x
}\f$. We }\f$. We
adopt the standard meaning of the instantaneous strain amplitudes * adopt the standard meaning of the instantaneous strain amplitudes
\f$h_{+,\times}\f$: in some reference transverse \f$x\f$-\f$y\f$ coordin * \f$h_{+,\times}\f$: in some reference transverse \f$x\f$-\f$y\f$ coordin
ate system ate system
oriented such that \f$\mathbf{\hat{x}}\times\mathbf{\hat{y}}=-\mathbf{\h * oriented such that \f$\mathbf{\hat{x}}\times\mathbf{\hat{y}}=-\mathbf{\h
at{n}}\f$ at{n}}\f$
points in the direction of propagation, two free observers originally * points in the direction of propagation, two free observers originally
separated by a displacement \f$(x,y)\f$ will experience an additional * separated by a displacement \f$(x,y)\f$ will experience an additional
tidal displacement \f$\delta x=(xh_+ + yh_\times)/2\f$, \f$\delta * tidal displacement \f$\delta x=(xh_+ + yh_\times)/2\f$, \f$\delta
y=(xh_\times - yh_+)/2\f$. * y=(xh_\times - yh_+)/2\f$.
*
\heading{Quasiperiodic waves:} Most astrophysical sources of * \par Quasiperiodic waves:
gravitational radiation are described as \e quasiperiodic (or, * Most astrophysical sources of
less accurately, as "adiabatic"), in that they can be said to have * gravitational radiation are described as \e quasiperiodic (or,
an instantaneous frequency, amplitude, and polarization, all of which * less accurately, as "adiabatic"), in that they can be said to have
vary on timescales much longer than a wave period. Mathematically we * an instantaneous frequency, amplitude, and polarization, all of which
write this as: * vary on timescales much longer than a wave period. Mathematically we
\f[ * write this as:
h_{+,\times}(t) = A_{+,\times}(t)\cos\phi(t) * \f[
+ B_{+,\times}(t)\sin\phi(t) \; , * h_{+,\times}(t) = A_{+,\times}(t)\cos\phi(t)
\f] * + B_{+,\times}(t)\sin\phi(t) \; ,
* \f]
\wrapfig{r,0.47\textwidth,fig_phase_diagram} *
\image html inject_phase_diagram.png "Fig. [fig_phase_diagram]: Polariza * \figure{inject_phase_diagram,eps,0.42,Polarization phase diagram for a q
tion phase diagram for a quasiperiodic gravitational wave. The phase point uasiperiodic gravitational wave. The phase point p(t) traces out the indica
p(t) traces out the indicated ellipse in the h_+,h_x plane; the parameters ted ellipse in the h_+\,h_x plane; the parameters A1\, A2 and Phi remain ro
A1, A2 and Phi remain roughly constant over many cycles in phi." ughly constant over many cycles in phi.}
\image latex inject_phase_diagram.eps "Polarization phase diagram for a *
quasiperiodic gravitational wave. The phase point p(t) traces out the indic * where \f$\phi(t)=2\pi\int f(t)\,dt\f$, and the <em>evolution timescale</
ated ellipse in the h_+,h_x plane; the parameters A1, A2 and Phi remain rou em>
ghly constant over many cycles in phi." width=0.42\textwidth * \f$\tau=\min\{A/\dot{A},B/\dot{B},f/\dot{f}\}\f$ is much greater than
* \f$h/\dot{h}\sim1/f\f$. Obviously it is mathematically impossible for t
where \f$\phi(t)=2\pi\int f(t)\,dt\f$, and the <em>evolution timescale</ he
em> * physical functions \f$h_{+,\times}(t)\f$ to specify uniquely more than t
\f$\tau=\min\{A/\dot{A},B/\dot{B},f/\dot{f}\}\f$ is much greater than wo
\f$h/\dot{h}\sim1/f\f$. Obviously it is mathematically impossible for t * other functions of time; we rely on the notion of quasiperiodicity to
he * define "natural" choices of instantaneous frequency and amplitude.
physical functions \f$h_{+,\times}(t)\f$ to specify uniquely more than t * The ambiguity in this choice is on the order of the amount that these
wo * quantities change over a cycle.
other functions of time; we rely on the notion of quasiperiodicity to *
define "natural" choices of instantaneous frequency and amplitude. * While the above formula appears to have five degrees of freedom (two
The ambiguity in this choice is on the order of the amount that these * quadrature amplitudes \f$A\f$ and \f$B\f$ for each polarization, plus a
quantities change over a cycle. common
* phase function \f$\phi\f$), there is a degeneracy between the two
While the above formula appears to have five degrees of freedom (two * quadrature amplitudes and a shift in phase. One could simply treat
quadrature amplitudes \f$A\f$ and \f$B\f$ for each polarization, plus a * each polarization independently and represent the system with two
common * amplitude functions \f$A_{+,\times}\f$ and two phase functions
phase function \f$\phi\f$), there is a degeneracy between the two * \f$\phi_{+,\times}\f$, but we would like to preserve the notion that the
quadrature amplitudes and a shift in phase. One could simply treat * phases of the two waveforms derive from a single underlying
each polarization independently and represent the system with two * instantaneous frequency. We therefore write the waveforms in terms of
amplitude functions \f$A_{+,\times}\f$ and two phase functions * two polarization amplitudes \f$A_1(t)\f$ and \f$A_2(t)\f$, a single phas
\f$\phi_{+,\times}\f$, but we would like to preserve the notion that the e
phases of the two waveforms derive from a single underlying * function \f$\phi(t)\f$, and a polarization shift \f$\Phi(t)\f$:
instantaneous frequency. We therefore write the waveforms in terms of * \f{eqnarray}{
two polarization amplitudes \f$A_1(t)\f$ and \f$A_2(t)\f$, a single phas * \label{eq_quasiperiodic_hpluscross}
e * h_+(t) & = & A_1(t)\cos\Phi(t)\cos\phi(t)
function \f$\phi(t)\f$, and a polarization shift \f$\Phi(t)\f$: * - A_2(t)\sin\Phi(t)\sin\phi(t) \; , \\
\anchor eq_quasiperiodic_hpluscross \f{eqnarray}{ * h_\times(t) & = & A_1(t)\sin\Phi(t)\cos\phi(t)
\label{eq_quasiperiodic_hpluscross} * + A_2(t)\cos\Phi(t)\sin\phi(t) \; .
h_+(t) & = & A_1(t)\cos\Phi(t)\cos\phi(t) * \f}
- A_2(t)\sin\Phi(t)\sin\phi(t) \; , \\ * The physical meaning of these functions is shown in \figref{inject_phase
h_\times(t) & = & A_1(t)\sin\Phi(t)\cos\phi(t) _diagram}.
+ A_2(t)\cos\Phi(t)\sin\phi(t) \; . *
\f} * There is a close relationship between the polarization shift \f$\Phi\f$
The physical meaning of these functions is shown in Fig.\figref{fig_phas * and the orientation of the \f$x\f$-\f$y\f$ coordinates used to define ou
e_diagram}. r
* polarization basis: if we rotate the \f$x\f$ and \f$y\f$ axes by an angl
There is a close relationship between the polarization shift \f$\Phi\f$ e
and the orientation of the \f$x\f$-\f$y\f$ coordinates used to define ou * \f$\Delta\psi\f$, we change \f$\Phi\f$ by an amount \f$-2\Delta\psi\f$.
r (The
polarization basis: if we rotate the \f$x\f$ and \f$y\f$ axes by an angl * factor of 2 comes from the fact that the + and \f$\times\f$ modes are
e * quadrupolar: a + mode rotated \f$45^\circ\f$ is a \f$\times\f$ mode, and
\f$\Delta\psi\f$, we change \f$\Phi\f$ by an amount \f$-2\Delta\psi\f$. a
(The * mode rotated \f$90^\circ\f$ is the opposite of itself.) We use the
factor of 2 comes from the fact that the + and \f$\times\f$ modes are * <em>polarization angle</em> \f$\psi\f$ to define the orientation of the
quadrupolar: a + mode rotated \f$45^\circ\f$ is a \f$\times\f$ mode, and * \f$x\f$-axis of the polarization basis relative to an Earth-fixed
a * reference frame (see the coordinate conventions below). If \f$\Phi\f$ i
mode rotated \f$90^\circ\f$ is the opposite of itself.) We use the s
<em>polarization angle</em> \f$\psi\f$ to define the orientation of the * constant, one can redefine \f$\psi\f$ such that \f$\Phi=0\f$; however, w
\f$x\f$-axis of the polarization basis relative to an Earth-fixed hen
reference frame (see the coordinate conventions below). If \f$\Phi\f$ i * \f$\Phi\f$ changes with time, we would nonetheless like our polarization
s * basis to remain fixed. We therefore retain the constant \f$\psi\f$ and
constant, one can redefine \f$\psi\f$ such that \f$\Phi=0\f$; however, w * the function \f$\Phi(t)\f$ as distinct quantities.
hen *
\f$\Phi\f$ changes with time, we would nonetheless like our polarization * The advantage of this quasiperiodic representation of a gravitational
basis to remain fixed. We therefore retain the constant \f$\psi\f$ and * wave is that a physical sampling of the parameters \f$A_1\f$, \f$A_2\f$,
the function \f$\Phi(t)\f$ as distinct quantities. * \f$\phi\f$, and \f$\Phi\f$ need only be done on timescales \f$\Delta
* t\lesssim\tau\f$, whereas the actual wave functions \f$h_{+,\times}\f$ n
The advantage of this quasiperiodic representation of a gravitational eed
wave is that a physical sampling of the parameters \f$A_1\f$, \f$A_2\f$, * to be sampled on timescales \f$\Delta t\lesssim1/f\f$.
\f$\phi\f$, and \f$\Phi\f$ need only be done on timescales \f$\Delta *
t\lesssim\tau\f$, whereas the actual wave functions \f$h_{+,\times}\f$ n * The following coordinate conventions are assumed:
eed * <ol>
to be sampled on timescales \f$\Delta t\lesssim1/f\f$. * <li> Fig. 7 of \cite Will_C_1996 defines standard coordinate
* conventions for nonprecessing binaries, and by extension, for any
The following coordinate conventions are assumed: * fixed-axis rotating source: If \f$\mathbf{\hat{z}}\f$ points in the dire
<ol> ction
<li> Fig. 7 of [\ref Will_C_1996] defines standard coordinate * of wave propagation (away from the source), and \f$\mathbf{\hat{l}}\f$ p
conventions for nonprecessing binaries, and by extension, for any oints
fixed-axis rotating source: If \f$\mathbf{\hat{z}}\f$ points in the dire * in the (constant) direction of the source's angular momentum vector,
ction * then the \f$x\f$-\f$y\f$ coordinates used to define the + and \f$\times\
of wave propagation (away from the source), and \f$\mathbf{\hat{l}}\f$ p f$
oints * polarizations are given by \f$\mathbf{\hat{x}}=|\csc
in the (constant) direction of the source's angular momentum vector, * i|\mathbf{\hat{z}}\times\mathbf{\hat{l}}\f$ and
then the \f$x\f$-\f$y\f$ coordinates used to define the + and \f$\times\ * \f$\mathbf{\hat{y}}=\mathbf{\hat{z}}\times\mathbf{\hat{x}}\f$, where
f$ * \f$i=\arccos(\mathbf{\hat{z}}\cdot\mathbf{\hat{l}})\f$ is the inclinatio
polarizations are given by \f$\mathbf{\hat{x}}=|\csc n angle
i|\mathbf{\hat{z}}\times\mathbf{\hat{l}}\f$ and * between \f$\mathbf{\hat{l}}\f$ and \f$\mathbf{\hat{z}}\f$. Such a syste
\f$\mathbf{\hat{y}}=\mathbf{\hat{z}}\times\mathbf{\hat{x}}\f$, where m will
\f$i=\arccos(\mathbf{\hat{z}}\cdot\mathbf{\hat{l}})\f$ is the inclinatio * generically have \f$A_1(t)=A(t)(1+\cos^2i)\f$, \f$A_2(t)=2A(t)\cos i\f$,
n angle * \f$\Phi(t)=0\f$, and \f$f(t)>0\f$ (i.e.\ \f$\phi(t)\f$ increasing with t
between \f$\mathbf{\hat{l}}\f$ and \f$\mathbf{\hat{z}}\f$. Such a syste ime). For
m will * precessing systems, prescriptions for \f$\mathbf{\hat{x}}\f$ and
generically have \f$A_1(t)=A(t)(1+\cos^2i)\f$, \f$A_2(t)=2A(t)\cos i\f$, * \f$\mathbf{\hat{y}}\f$ become ambiguous, but they \e must be fixed; the
\f$\Phi(t)=0\f$, and \f$f(t)>0\f$ (i.e.\ \f$\phi(t)\f$ increasing with t * relations for \f$A_1\f$, \f$A_2\f$, and \f$\Phi\f$ will no longer be mai
ime). For ntained.</li>
precessing systems, prescriptions for \f$\mathbf{\hat{x}}\f$ and *
\f$\mathbf{\hat{y}}\f$ become ambiguous, but they \e must be fixed; the * <li> Appendix B of \cite ABCF2001 defines a convention for
relations for \f$A_1\f$, \f$A_2\f$, and \f$\Phi\f$ will no longer be mai * the overal polarization angle \f$\psi\f$: Let \f$\mathbf{\hat{N}}\f$ be
ntained.</li> the
* direction of the Earth's north celestial pole, and define the
<li> Appendix B of [\ref Anderson_W2000] defines a convention for * direction of the <em>ascending node</em>
the overal polarization angle \f$\psi\f$: Let \f$\mathbf{\hat{N}}\f$ be * \f$\mathbf{\hat{\Omega}}=|\csc\alpha|\mathbf{\hat{N}}\times\mathbf{\hat{
the z}}\f$, where
direction of the Earth's north celestial pole, and define the * \f$\alpha\f$ is the right ascension of the source. Then \f$\psi\f$ is t
direction of the <em>ascending node</em> he
\f$\mathbf{\hat{\Omega}}=|\csc\alpha|\mathbf{\hat{N}}\times\mathbf{\hat{ * angle, right-handed about \f$\mathbf{\hat{z}}\f$, from \f$\mathbf{\hat{\
z}}\f$, where Omega}}\f$ to
\f$\alpha\f$ is the right ascension of the source. Then \f$\psi\f$ is t * \f$\mathbf{\hat{x}}\f$.</li>
he *
angle, right-handed about \f$\mathbf{\hat{z}}\f$, from \f$\mathbf{\hat{\ * <li> The direction of propagation of the wave is defined by the right
Omega}}\f$ to * ascension \f$\alpha\f$ and declination \f$\delta\f$ of the \e source, as
\f$\mathbf{\hat{x}}\f$.</li> * seen from the point of measurement. See \ref SkyCoordinates_h for a
* definition of these quantities. We expect that these will be
<li> The direction of propagation of the wave is defined by the right * effectively constant for almost any gravitational wave source of
ascension \f$\alpha\f$ and declination \f$\delta\f$ of the \e source, as * interest.</li>
seen from the point of measurement. See \ref SkyCoordinates_h for a * </ol>
definition of these quantities. We expect that these will be *
effectively constant for almost any gravitational wave source of * \par The polarization response:
interest.</li> * The relative strain induced in
</ol> * the test masses of a detector by a passing gravitational wave depends
* not only on the amplitudes \f$h_{+,\times}\f$ of the gravitational wave,
\heading{The polarization response:} The relative strain induced in * but also on the design of the detector and its orientation with
the test masses of a detector by a passing gravitational wave depends * relative to the \f$x\f$-\f$y\f$ coordinate system used to define the + a
not only on the amplitudes \f$h_{+,\times}\f$ of the gravitational wave, nd
but also on the design of the detector and its orientation with * \f$\times\f$ polarizations. For a given detector, the response to each
relative to the \f$x\f$-\f$y\f$ coordinate system used to define the + a * polarization thus depends on the right ascension \f$\alpha\f$, declinati
nd on
\f$\times\f$ polarizations. For a given detector, the response to each * \f$\delta\f$, and polarization angle \f$\psi\f$ of the source (which def
polarization thus depends on the right ascension \f$\alpha\f$, declinati ine
on * the orientation of the + and \f$\times\f$ polarization axes relative to
\f$\delta\f$, and polarization angle \f$\psi\f$ of the source (which def * the Earth), and on the time \f$t\f$ (which determines the orientation of
ine * the detector as the Earth rotates). The strain \f$h(t)\f$ induced in th
the orientation of the + and \f$\times\f$ polarization axes relative to e
the Earth), and on the time \f$t\f$ (which determines the orientation of * detector is thus given by two polarization response functions
the detector as the Earth rotates). The strain \f$h(t)\f$ induced in th * \f$F_{+,\times}(\alpha,\delta,\psi;t)\f$ by:
e * \f[
detector is thus given by two polarization response functions * h(t) = h_+(t)F_+(\alpha,\delta,\psi;t) +
\f$F_{+,\times}(\alpha,\delta,\psi;t)\f$ by: * h_\times(t)F_\times(\alpha,\delta,\psi;t) \; .
\f[ * \f]
h(t) = h_+(t)F_+(\alpha,\delta,\psi;t) + * We will not discuss the computation of these functions \f$F_{+,\times}\f
h_\times(t)F_\times(\alpha,\delta,\psi;t) \; . $,
\f] * as these are covered under the header \ref DetResponse_h.
We will not discuss the computation of these functions \f$F_{+,\times}\f *
$, * \par The transfer function:
as these are covered under the header \ref DetResponse_h. * All gravitational wave detectors
* incorporate a set of analog and digital filters that convert a
\heading{The transfer function:} All gravitational wave detectors * gravitational excitation on the test masses into a measurable output
incorporate a set of analog and digital filters that convert a * time series. The effects of these functions are aggregated into a
gravitational excitation on the test masses into a measurable output * complex-valued <em>transfer function</em> \f${\cal T}(f)\f$, which gives
time series. The effects of these functions are aggregated into a the
complex-valued <em>transfer function</em> \f${\cal T}(f)\f$, which gives * instrumental response (in units of "counts" from an
the * analog\f$\rightarrow\f$digital converter) to gravitational waves of unit
instrumental response (in units of "counts" from an * amplitued at the frequency \f$f\f$. Specifically, if the strain exerted
analog\f$\rightarrow\f$digital converter) to gravitational waves of unit * on the antenna is given by \f$h(t)=\mathrm{Re}[{\cal H}e^{2\pi ift}]\f$
amplitued at the frequency \f$f\f$. Specifically, if the strain exerted * (where the complex amplitude \f$\cal H\f$ includes the phase of the wave
on the antenna is given by \f$h(t)=\mathrm{Re}[{\cal H}e^{2\pi ift}]\f$ ),
(where the complex amplitude \f$\cal H\f$ includes the phase of the wave * then the ADC output of the instrument is given by:
), * \f[
then the ADC output of the instrument is given by: * o(t) = \mathrm{Re}\left[ {\cal T}(f) {\cal H}e^{2\pi ift} \right] \; .
\f[ * \f]
o(t) = \mathrm{Re}\left[ {\cal T}(f) {\cal H}e^{2\pi ift} \right] \; . * The transfer function has a strong frequency dependence in order to
\f] * "whiten" the highly-coloured instrumental noise, and thus preserve
The transfer function has a strong frequency dependence in order to * instrumental sensitivity across a broad band of frequencies.
"whiten" the highly-coloured instrumental noise, and thus preserve *
instrumental sensitivity across a broad band of frequencies. * We note that although the transfer function measures the response of
* the instrument to a gravitational wave, the term <em>response
We note that although the transfer function measures the response of * function</em> refers to inverse transformation of taking an instrumental
the instrument to a gravitational wave, the term <em>response * response and computing a gravitational waveform; that is, \f${\cal
function</em> refers to inverse transformation of taking an instrumental * R}(f)=1/{\cal T}(f)\f$. This confusing bit of nomenclature arises from
response and computing a gravitational waveform; that is, \f${\cal * the fact that most data analysis deals with extracting gravitational
R}(f)=1/{\cal T}(f)\f$. This confusing bit of nomenclature arises from * waveforms from the instrumental output, rather than injecting
the fact that most data analysis deals with extracting gravitational * waveforms into the output.
waveforms from the instrumental output, rather than injecting *
waveforms into the output. * For quasiperiodic waveforms with a well-defined instantaneous
* frequency \f$f(t)\f$ and phase \f$\phi(t)\f$, we can compute the respons
For quasiperiodic waveforms with a well-defined instantaneous e of
frequency \f$f(t)\f$ and phase \f$\phi(t)\f$, we can compute the respons * the instrument entirely in the time domain in the adiabatic limit: if
e of * our instrumental excitation is a linear superposition of waveforms
the instrument entirely in the time domain in the adiabatic limit: if * \f$h(t)=\mathrm{Re}[{\cal H}(t)e^{i\phi(t)}]\f$, then the output is a
our instrumental excitation is a linear superposition of waveforms * superposition of waves of the form
\f$h(t)=\mathrm{Re}[{\cal H}(t)e^{i\phi(t)}]\f$, then the output is a * \f[
superposition of waves of the form * o(t) \approx \mathrm{Re}\left[ {\cal T}\{f(t)\}
\f[ * {\cal H}(t)e^{i\phi(t)} \right] \; .
o(t) \approx \mathrm{Re}\left[ {\cal T}\{f(t)\} * \f]
{\cal H}(t)e^{i\phi(t)} \right] \; . * This expression is approximate to the extent that \f${\cal T}(f)\f$ vari
\f] es
This expression is approximate to the extent that \f${\cal T}(f)\f$ vari * over the range \f$f\pm1/\tau\f$, where \f$\tau\f$ is the evolution times
es cale
over the range \f$f\pm1/\tau\f$, where \f$\tau\f$ is the evolution times * of \f${\cal H}(t)\f$ and \f$f(t)\f$. Since the transfer function and
cale * polarization response (above) are linear operators, we can apply them
of \f${\cal H}(t)\f$ and \f$f(t)\f$. Since the transfer function and * in either order.
polarization response (above) are linear operators, we can apply them *
in either order. * \par A note on terminology:
* We use the word "coherent" in the
\heading{A note on terminology:} We use the word "coherent" in the * name of this header in the loosest possible sense, refering to any
name of this header in the loosest possible sense, refering to any * wave with a well-defined direction of propagation, whose wave
wave with a well-defined direction of propagation, whose wave * amplitudes \f$h_{+,\times}\f$ are deterministic functions of retarded
amplitudes \f$h_{+,\times}\f$ are deterministic functions of retarded * time. Given a knowledge of these parameters, such a waveform is
time. Given a knowledge of these parameters, such a waveform is * amenable to "coherent" detection in a network of detectors, through
amenable to "coherent" detection in a network of detectors, through * time-shifted matched filtering.
time-shifted matched filtering. *
* However, coherence is often used to refer to a more restricted class
However, coherence is often used to refer to a more restricted class * of waveforms that are "effectively monochromatic" over some
of waveforms that are "effectively monochromatic" over some * coherence timescale \f$t_\mathrm{coh}\f$; i.e.\ in any timespan
coherence timescale \f$t_\mathrm{coh}\f$; i.e.\ in any timespan * \f$t_\mathrm{coh}\f$ there is a fixed-frequency sinusoid that is never
\f$t_\mathrm{coh}\f$ there is a fixed-frequency sinusoid that is never * more than \f$90^\circ\f$ out of phase with the waveform. This is more
more than \f$90^\circ\f$ out of phase with the waveform. This is more * retrictive even than our concept of quasiperiodic waves; for
retrictive even than our concept of quasiperiodic waves; for * smoothly-varying waveforms one has \f$t_\mathrm{coh}\sim\dot{f}^{-1/2}\f
smoothly-varying waveforms one has \f$t_\mathrm{coh}\sim\dot{f}^{-1/2}\f $,
$, * which is much shorter than the evolution timescale \f$\tau\sim
which is much shorter than the evolution timescale \f$\tau\sim * f/\dot{f}\f$ (provided \f$\tau\gg1/f\f$, as we have assumed).
f/\dot{f}\f$ (provided \f$\tau\gg1/f\f$, as we have assumed). *
*/
*/
/* This structure stores a representation of a plane /* This structure stores a representation of a plane
* gravitational wave propagating from a particular point on the sky. * gravitational wave propagating from a particular point on the sky.
* Several alternate representations are permitted to allow a more * Several alternate representations are permitted to allow a more
* natural characterization of quasiperiodic waveforms. * natural characterization of quasiperiodic waveforms.
* *
* \note It is permissible to set only some of the * \note It is permissible to set only some of the
* \c REAL4TimeSeries or \c REAL4TimeVectorSeries fields above, * \c REAL4TimeSeries or \c REAL4TimeVectorSeries fields above,
* but the waveform is treated as being zero except during those times * but the waveform is treated as being zero except during those times
* when either \c h, or both \c a and \c phi, are defined. * when either \c h, or both \c a and \c phi, are defined.
* Where \c shift is not specified, it is assumed that \f$\Phi\f$ is * Where \c shift is not specified, it is assumed that \f$\Phi\f$ is
* zero; where \c f is not specified but \c phi is, \f$f(t)\f$ can be * zero; where \c f is not specified but \c phi is, \f$f(t)\f$ can be
* computed as \f$\dot{\phi}(t)/2\pi\f$. Where \c f and \c phi * computed as \f$\dot{\phi}(t)/2\pi\f$. Where \c f and \c phi
* overlap, or where \c h and any other time series overlap, they * overlap, or where \c h and any other time series overlap, they
* must be defined consistently. * must be defined consistently.
* *
*/ */
typedef struct tagCoherentGW { typedef struct tagCoherentGW {
SkyPosition position; /*< The location of the source in the sky; this should be in equatorial celestial coordinates, but routines may be able to do the conversion */ SkyPosition position; /*< The location of the source in the sky; this should be in equatorial celestial coordinates, but routines may be able to do the conversion */
REAL4 psi; /*< The polarization angle \f$\psi\f$, in radia ns, as defined in Appendix B of [\ref Anderson_W2000] */ REAL4 psi; /*< The polarization angle \f$\psi\f$, in radia ns, as defined in Appendix B of \cite ABCF2001 */
REAL4TimeVectorSeries *h; /*< A time-sampled two-dimensional vector stori ng the waveforms \f$h_+(t)\f$ and \f$h_\times(t)\f$, in dimensionless strai n */ REAL4TimeVectorSeries *h; /*< A time-sampled two-dimensional vector stori ng the waveforms \f$h_+(t)\f$ and \f$h_\times(t)\f$, in dimensionless strai n */
REAL4TimeVectorSeries *a; /*< A time-sampled two-dimensional vector stori ng the amplitudes \f$A_1(t)\f$ and \f$A_2(t)\f$, in dimensionless strain */ REAL4TimeVectorSeries *a; /*< A time-sampled two-dimensional vector stori ng the amplitudes \f$A_1(t)\f$ and \f$A_2(t)\f$, in dimensionless strain */
REAL4TimeSeries *f; /*< A time-sampled sequence storing the instant aneous frequency \f$f(t)\f$, in Hz. */ REAL4TimeSeries *f; /*< A time-sampled sequence storing the instant aneous frequency \f$f(t)\f$, in Hz. */
REAL8TimeSeries *phi; /*< A time-sampled sequence storing the phase f unction \f$\phi(t)\f$, in radians */ REAL8TimeSeries *phi; /*< A time-sampled sequence storing the phase f unction \f$\phi(t)\f$, in radians */
REAL4TimeSeries *shift; /*< A time-sampled sequence storing the polariz ation shift \f$\Phi(t)\f$, in radians */ REAL4TimeSeries *shift; /*< A time-sampled sequence storing the polariz ation shift \f$\Phi(t)\f$, in radians */
UINT4 dtDelayBy2; /*< A user specified half-interval time step fo r the Doppler delay look-up table (will default to 400s if set to 0) */ UINT4 dtDelayBy2; /*< A user specified half-interval time step fo r the Doppler delay look-up table (will default to 400s if set to 0) */
UINT4 dtPolBy2; /*< A user defined half-interval time step for the polarisation response look-up table (will default to 300s if set to 0) */ UINT4 dtPolBy2; /*< A user defined half-interval time step for the polarisation response look-up table (will default to 300s if set to 0) */
} CoherentGW; } CoherentGW;
/* This structure contains information required to determine the response /* This structure contains information required to determine the response
 End of changes. 2 change blocks. 
264 lines changed or deleted 263 lines changed or added


 SkyCoordinates.h   SkyCoordinates.h 
skipping to change at line 29 skipping to change at line 29
#ifndef _SKYCOORDINATES_H #ifndef _SKYCOORDINATES_H
#define _SKYCOORDINATES_H #define _SKYCOORDINATES_H
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** \addtogroup SkyCoordinates_h /**
@{*/ * \addtogroup SkyCoordinates_h
* @{
*/
/** \name Error codes */ /** \name Error codes */
/*@{*/ /*@{*/
#define SKYCOORDINATESH_ENUL 1 /**< Unexpected null pointer in argu ments */ #define SKYCOORDINATESH_ENUL 1 /**< Unexpected null pointer in argu ments */
#define SKYCOORDINATESH_ESYS 2 /**< Wrong coordinate system in inpu t */ #define SKYCOORDINATESH_ESYS 2 /**< Wrong coordinate system in inpu t */
#define SKYCOORDINATESH_EZERO 3 /**< Angular coordinates undefined a t origin */ #define SKYCOORDINATESH_EZERO 3 /**< Angular coordinates undefined a t origin */
#define SKYCOORDINATESH_ESING 4 /**< Point is inside singular ellips oid */ #define SKYCOORDINATESH_ESING 4 /**< Point is inside singular ellips oid */
/*@}*/ /*@}*/
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
#define SKYCOORDINATESH_MSGENUL "Unexpected null pointer in arguments" #define SKYCOORDINATESH_MSGENUL "Unexpected null pointer in arguments"
#define SKYCOORDINATESH_MSGESYS "Wrong coordinate system in input" #define SKYCOORDINATESH_MSGESYS "Wrong coordinate system in input"
#define SKYCOORDINATESH_MSGEZERO "Angular coordinates undefined at origin" #define SKYCOORDINATESH_MSGEZERO "Angular coordinates undefined at origin"
#define SKYCOORDINATESH_MSGESING "Point is inside singular ellipsoid" #define SKYCOORDINATESH_MSGESING "Point is inside singular ellipsoid"
/** \endcond */ /** \endcond */
/*---------- exported types ---------- */ /*---------- exported types ---------- */
/** This enumerated type is used to identify data as being in one of the /**
* coordinate systems discussed in \ref SkyCoordinates_h. */ * This enumerated type is used to identify data as being in one of the
* coordinate systems discussed in \ref SkyCoordinates_h.
*/
typedef enum { typedef enum {
COORDINATESYSTEM_HORIZON, /**< A horizon coordinate system. */ COORDINATESYSTEM_HORIZON, /**< A horizon coordinate system. */
COORDINATESYSTEM_GEOGRAPHIC, /**< The Earth-fixed geographic coordinate s ystem. */ COORDINATESYSTEM_GEOGRAPHIC, /**< The Earth-fixed geographic coordinate s ystem. */
COORDINATESYSTEM_EQUATORIAL, /**< The sky-fixed equatorial coordinate sys tem. */ COORDINATESYSTEM_EQUATORIAL, /**< The sky-fixed equatorial coordinate sys tem. */
COORDINATESYSTEM_ECLIPTIC, /**< The ecliptic coordinate system. */ COORDINATESYSTEM_ECLIPTIC, /**< The ecliptic coordinate system. */
COORDINATESYSTEM_GALACTIC /**< The galactic coordinate system. */ COORDINATESYSTEM_GALACTIC /**< The galactic coordinate system. */
} CoordinateSystem; } CoordinateSystem;
/** This structure stores the two spherical coordinates of a sky position; /**
* This structure stores the two spherical coordinates of a sky position;
* ie a generic latitude and longitude; the structure is not defined * ie a generic latitude and longitude; the structure is not defined
* specific to a particular coordinate system, but maintains a tag * specific to a particular coordinate system, but maintains a tag
* indicating which coordinate system it is expressed in. * indicating which coordinate system it is expressed in.
*/ */
typedef struct tagSkyPosition { typedef struct tagSkyPosition {
REAL8 longitude; /**< The longitudinal coordinate (in radians ), as defined above.*/ REAL8 longitude; /**< The longitudinal coordinate (in radians ), as defined above.*/
REAL8 latitude; /**< The latitudinal coordinate (in radians) , as defined above. */ REAL8 latitude; /**< The latitudinal coordinate (in radians) , as defined above. */
CoordinateSystem system; /**< The coordinate system in which latitude /longitude are expressed. */ CoordinateSystem system; /**< The coordinate system in which latitude /longitude are expressed. */
} SkyPosition; } SkyPosition;
/** This structure stores the location of a point on (or near) the surface /**
* This structure stores the location of a point on (or near) the surface
* of the Earth in both geodetic and geocentric coordinates, as described * of the Earth in both geodetic and geocentric coordinates, as described
* in TerrestrialCoordinates.c . * in TerrestrialCoordinates.c .
*/ */
typedef struct tagEarthPosition { typedef struct tagEarthPosition {
SkyPosition geodetic; /**< The geographic coordinates of the SkyPosition geodetic; /**< The geographic coordinates of the
* upward vertical direction from the point; that is, the point's * upward vertical direction from the point; that is, the point's
* <em>geodetic</em> latitude and longitude. */ * <em>geodetic</em> latitude and longitude. */
REAL8 elevation; /**< The vertical distance of the point abov e the reference ellipsoid, REAL8 elevation; /**< The vertical distance of the point abov e the reference ellipsoid,
* in metres.*/ * in metres.*/
skipping to change at line 92 skipping to change at line 98
REAL8 x, y, z; /**< The Earth-fixed geocentric Cartesian co ordinates of the point, REAL8 x, y, z; /**< The Earth-fixed geocentric Cartesian co ordinates of the point,
*in metres.*/ *in metres.*/
REAL8 radius; /**< The distance of the point from the geocentre, in metres. */ REAL8 radius; /**< The distance of the point from the geocentre, in metres. */
SkyPosition geocentric; /**< The geographic coordinates of the dire ction from the centre SkyPosition geocentric; /**< The geographic coordinates of the dire ction from the centre
* of the Earth through the point; that is, the point's * of the Earth through the point; that is, the point's
* <em>geocentric</em> latitude and longitud e.*/ * <em>geocentric</em> latitude and longitud e.*/
} EarthPosition; } EarthPosition;
/** This structure stores parameters for the function <tt>LALConvertSkyPosi /**
tion()</tt>. * This structure stores parameters for the function <tt>LALConvertSkyPosit
ion()</tt>.
*/ */
typedef struct tagConvertSkyParams { typedef struct tagConvertSkyParams {
CoordinateSystem system; /**< The coordinate system to which one is transforming. */ CoordinateSystem system; /**< The coordinate system to which one is transforming. */
SkyPosition *zenith; /**< The position of the zenith of the horiz on coordinate system; SkyPosition *zenith; /**< The position of the zenith of the horiz on coordinate system;
* may be <tt>NULL</tt> if one is neither co nverting to nor from * may be <tt>NULL</tt> if one is neither co nverting to nor from
* a horizon system. */ * a horizon system. */
LIGOTimeGPS *gpsTime; /**< The GPS time for conversions be tween Earth-fixed and LIGOTimeGPS *gpsTime; /**< The GPS time for conversions be tween Earth-fixed and
* sky-fixed coordinates; may be <tt>NULL</t t> if no such conversion * sky-fixed coordinates; may be <tt>NULL</t t> if no such conversion
skipping to change at line 170 skipping to change at line 177
LALGeocentricToGeodetic( LALStatus *, EarthPosition *location ); LALGeocentricToGeodetic( LALStatus *, EarthPosition *location );
void void
LALConvertSkyCoordinates( LALStatus *, LALConvertSkyCoordinates( LALStatus *,
SkyPosition *output, SkyPosition *output,
SkyPosition *input, SkyPosition *input,
ConvertSkyParams *params ); ConvertSkyParams *params );
void LALNormalizeSkyPosition (LALStatus *status, SkyPosition *posOut, const SkyPosition *posIn); void LALNormalizeSkyPosition (LALStatus *status, SkyPosition *posOut, const SkyPosition *posIn);
#ifdef SWIG // SWIG interface directives #ifdef SWIG /* SWIG interface directives */
SWIGLAL(INOUT_SCALARS(double*, longitude, latitude)); SWIGLAL(INOUT_SCALARS(double*, longitude, latitude));
#endif #endif
void XLALNormalizeSkyPosition ( double *restrict longitude, double *restric t latitude ); void XLALNormalizeSkyPosition ( double *_LAL_RESTRICT_ longitude, double *_ LAL_RESTRICT_ latitude );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _SKYCOORDINATES_H */ #endif /* _SKYCOORDINATES_H */
 End of changes. 7 change blocks. 
10 lines changed or deleted 17 lines changed or added


 Skymap.h   Skymap.h 
skipping to change at line 29 skipping to change at line 29
#ifndef SKYMAP_H #ifndef SKYMAP_H
#define SKYMAP_H #define SKYMAP_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <lal/LALDetectors.h> #include <lal/LALDetectors.h>
// Manipulate log-represented values without overflowing /* Manipulate log-represented values without overflowing */
double XLALSkymapLogSumExp(double a, double b); double XLALSkymapLogSumExp(double a, double b);
double XLALSkymapLogTotalExp(double* begin, double* end); double XLALSkymapLogTotalExp(double* begin, double* end);
// Lightweight coordinate transformations /* Lightweight coordinate transformations */
void XLALSkymapCartesianFromSpherical(double a[3], double b[2]); void XLALSkymapCartesianFromSpherical(double a[3], double b[2]);
void XLALSkymapSphericalFromCartesian(double a[2], double b[3]); void XLALSkymapSphericalFromCartesian(double a[2], double b[3]);
// Cubic interpolation /* Cubic interpolation */
double XLALSkymapInterpolate(double t, double* x); double XLALSkymapInterpolate(double t, double* x);
// Largest network of interest (needed to allocate storage) /* Largest network of interest (needed to allocate storage) */
#define XLALSKYMAP_N 5 #define XLALSKYMAP_N 5
// Use detector names from lal/packages/tools/include/LALDetectors.h : /* Use detector names from lal/packages/tools/include/LALDetectors.h : */
// LAL_TAMA_300_DETECTOR = 0 /* LAL_TAMA_300_DETECTOR = 0 */
// LAL_VIRGO_DETECTOR = 1 /* LAL_VIRGO_DETECTOR = 1 */
// LAL_GEO_600_DETECTOR = 2 /* LAL_GEO_600_DETECTOR = 2 */
// LAL_LHO_2K_DETECTOR = 3 /* LAL_LHO_2K_DETECTOR = 3 */
// LAL_LHO_4K_DETECTOR = 4 /* LAL_LHO_4K_DETECTOR = 4 */
// LAL_LLO_4K_DETECTOR = 5 /* LAL_LLO_4K_DETECTOR = 5 */
// Struct to store basic properties of the analysis: the sample rate, and /* Struct to store basic properties of the analysis: the sample rate, and *
// the detectors involved (described by their LAL ID numbers) /
/* the detectors involved (described by their LAL ID numbers) */
typedef struct tagXLALSkymapPlanType typedef struct tagXLALSkymapPlanType
{ {
int sampleFrequency; int sampleFrequency;
int n; int n;
LALDetector site[XLALSKYMAP_N]; LALDetector site[XLALSKYMAP_N];
} XLALSkymapPlanType; } XLALSkymapPlanType;
void XLALSkymapPlanConstruct( void XLALSkymapPlanConstruct(
int sampleFrequency, int sampleFrequency,
int n, int n,
int* detectors, int* detectors,
XLALSkymapPlanType* plan XLALSkymapPlanType* plan
); );
// Struct to store reuseable pre-computed quantities for a specific /* Struct to store reuseable pre-computed quantities for a specific */
// direction, set of detectors, and sample rate /* direction, set of detectors, and sample rate */
typedef struct tagXLALSkymapDirectionPropertiesType typedef struct tagXLALSkymapDirectionPropertiesType
{ {
double f[XLALSKYMAP_N][2]; double f[XLALSKYMAP_N][2];
double delay[XLALSKYMAP_N]; double delay[XLALSKYMAP_N];
} XLALSkymapDirectionPropertiesType; } XLALSkymapDirectionPropertiesType;
void XLALSkymapDirectionPropertiesConstruct( void XLALSkymapDirectionPropertiesConstruct(
XLALSkymapPlanType* plan, XLALSkymapPlanType* plan,
double direction[2], double direction[2],
XLALSkymapDirectionPropertiesType* properties XLALSkymapDirectionPropertiesType* properties
); );
// Struct to store reuseable pre-computed kernel for a specific direction, /* Struct to store reuseable pre-computed kernel for a specific direction,
// power spectra, and sample rate */
/* power spectra, and sample rate */
typedef struct tagXLALSkymapKernelType typedef struct tagXLALSkymapKernelType
{ {
double k[XLALSKYMAP_N][XLALSKYMAP_N]; double k[XLALSKYMAP_N][XLALSKYMAP_N];
double logNormalization; double logNormalization;
} XLALSkymapKernelType; } XLALSkymapKernelType;
void XLALSkymapKernelConstruct( void XLALSkymapKernelConstruct(
XLALSkymapPlanType* plan, XLALSkymapPlanType* plan,
XLALSkymapDirectionPropertiesType* properties, XLALSkymapDirectionPropertiesType* properties,
skipping to change at line 111 skipping to change at line 111
); );
void XLALSkymapUncertainKernelConstruct( void XLALSkymapUncertainKernelConstruct(
XLALSkymapPlanType* plan, XLALSkymapPlanType* plan,
XLALSkymapDirectionPropertiesType* properties, XLALSkymapDirectionPropertiesType* properties,
double* wSw, double* wSw,
double* error, double* error,
XLALSkymapKernelType* kernel XLALSkymapKernelType* kernel
); );
// Compute the Bayesian marginalization integral for the specified system /* Compute the Bayesian marginalization integral for the specified system * /
void XLALSkymapApply( void XLALSkymapApply(
XLALSkymapPlanType* plan, XLALSkymapPlanType* plan,
XLALSkymapDirectionPropertiesType* properties, XLALSkymapDirectionPropertiesType* properties,
XLALSkymapKernelType* kernel, XLALSkymapKernelType* kernel,
double** xSw, double** xSw,
double tau, double tau,
double* logPosterior double* logPosterior
); );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif // SKYMAP_H #endif /* SKYMAP_H */
 End of changes. 10 change blocks. 
18 lines changed or deleted 20 lines changed or added


 Sort.h   Sort.h 
skipping to change at line 39 skipping to change at line 39
#ifndef _SORT_H #ifndef _SORT_H
#define _SORT_H #define _SORT_H
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup Sort_h * \addtogroup Sort_h
*
\brief Provides routines for sorting, indexing, and ranking real vector * \brief Provides routines for sorting, indexing, and ranking real vector
elements. elements.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/Sort.h> * \code
\endcode * #include <lal/Sort.h>
* \endcode
\heading{Description} *
* ### Description ###
These routines sort a vector <tt>*data</tt> (of type \c REAL4Vector *
or \c REAL8Vector) into ascending order using the in-place * These routines sort a vector <tt>*data</tt> (of type \c REAL4Vector
heapsort algorithm, or construct an index vector <tt>*index</tt> that * or \c REAL8Vector) into ascending order using the in-place
indexes <tt>*data</tt> in increasing order (leaving <tt>*data</tt> * heapsort algorithm, or construct an index vector <tt>*index</tt> that
unchanged), or construct a rank vector <tt>*rank</tt> that gives the * indexes <tt>*data</tt> in increasing order (leaving <tt>*data</tt>
rank order of the corresponding <tt>*data</tt> element. * unchanged), or construct a rank vector <tt>*rank</tt> that gives the
* rank order of the corresponding <tt>*data</tt> element.
The relationship between sorting, indexing, and ranking can be a bit *
confusing. One way of looking at it is that the original array is * The relationship between sorting, indexing, and ranking can be a bit
ordered by index, while the sorted array is ordered by rank. The * confusing. One way of looking at it is that the original array is
index array gives the index as a function of rank; i.e.\ if you're * ordered by index, while the sorted array is ordered by rank. The
looking for a given rank (say the 0th, or smallest element), the index * index array gives the index as a function of rank; i.e.\ if you're
array tells you where to look it up in the unsorted array: * looking for a given rank (say the 0th, or smallest element), the index
\code * array tells you where to look it up in the unsorted array:
unsorted_array[index[i]] = sorted_array[i] * \code
\endcode * unsorted_array[index[i]] = sorted_array[i]
The rank array gives the rank as a function of index; i.e.\ it tells * \endcode
you where a given element in the unsorted array will appear in the * The rank array gives the rank as a function of index; i.e.\ it tells
sorted array: * you where a given element in the unsorted array will appear in the
\code * sorted array:
unsorted_array[j] = sorted_array[rank[j]] * \code
\endcode * unsorted_array[j] = sorted_array[rank[j]]
Clearly these imply the following relationships, which can be used to * \endcode
construct the index array from the rank array or vice-versa: * Clearly these imply the following relationships, which can be used to
\code * construct the index array from the rank array or vice-versa:
index[rank[j]] = j * \code
rank[index[i]] = i * index[rank[j]] = j
\endcode * rank[index[i]] = i
* \endcode
The XLAL versions of these routines, \c XLALHeapSort(), \c XLALHeapIndex(), *
and \c XLALHeapRank(), perform the same operations but on arrays of * The XLAL versions of these routines, \c XLALHeapSort(), \c XLALHeapIndex
\c nobj generic objects of size \c size pointed to by \c base and (),
using the comparison function \c compar. The function \c compar() has * and \c XLALHeapRank(), perform the same operations but on arrays of
the prototype * \c nobj generic objects of size \c size pointed to by \c base and
\code * using the comparison function \c compar. The function \c compar() has
int compar( void *p, const void *x, const void *y ) * the prototype
\endcode * \code
and returns \f$-1\f$ if \f${\mathtt{x}}<{\mathtt{y}}\f$, * int compar( void *p, const void *x, const void *y )
\f$0\f$ if \f${\mathtt{x}}={\mathtt{y}}\f$, * \endcode
and \f$+1\f$ if \f${\mathtt{x}}>{\mathtt{y}}\f$. Here \c p (which may be N * and returns \f$-1\f$ if \f${\mathtt{x}}<{\mathtt{y}}\f$,
ULL) * \f$0\f$ if \f${\mathtt{x}}={\mathtt{y}}\f$,
is a pointer to additional data that may be used in the comparison function * and \f$+1\f$ if \f${\mathtt{x}}>{\mathtt{y}}\f$. Here \c p (which may b
. e NULL)
This pointer is passed to the comparison function unchanged from the argume * is a pointer to additional data that may be used in the comparison funct
nt ion.
\c params of \c XLALHeapSort(), \c XLALHeapIndex(), and * This pointer is passed to the comparison function unchanged from the arg
\c XLALHeapRank(). ument
* \c params of \c XLALHeapSort(), \c XLALHeapIndex(), and
\heading{Algorithm} * \c XLALHeapRank().
*
These routines use the standard heap sort algorithm described in * ### Algorithm ###
Sec. 8.3 of Ref. [\ref ptvf1992]. *
* These routines use the standard heap sort algorithm described in
The <tt>LALSHeapSort()</tt> and <tt>LALDHeapSort()</tt> routines are entire * Sec. 8.3 of Ref. \cite ptvf1992.
ly *
in-place, with no auxiliary storage vector. The <tt>LALSHeapIndex()</tt> * The <tt>LALSHeapSort()</tt> and <tt>LALDHeapSort()</tt> routines are ent
and <tt>LALDHeapIndex()</tt> routines are also technically in-place, but irely
they require two input vectors (the data vector and the index vector), * in-place, with no auxiliary storage vector. The <tt>LALSHeapIndex()</tt
and leave the data vector unchanged. The <tt>LALSHeapRank()</tt> and >
<tt>LALDHeapRank()</tt> routines require two input vectors (the data and * and <tt>LALDHeapIndex()</tt> routines are also technically in-place, but
rank vectors), and also allocate a temporary index vector internally; * they require two input vectors (the data vector and the index vector),
these routines are therefore the most memory-intensive. All of these * and leave the data vector unchanged. The <tt>LALSHeapRank()</tt> and
algorithms are \f$N\log_2(N)\f$ algorithms, regardless of the ordering of * <tt>LALDHeapRank()</tt> routines require two input vectors (the data and
the initial dataset. * rank vectors), and also allocate a temporary index vector internally;
* these routines are therefore the most memory-intensive. All of these
Note: if you can use \c qsort(), you should. * algorithms are \f$N\log_2(N)\f$ algorithms, regardless of the ordering o
f
*/ * the initial dataset.
*
* Note: if you can use \c qsort(), you should.
*
*/
/*@{*/ /*@{*/
/** \name Error Codes */ /** \name Error Codes */
/*@{*/ /*@{*/
#define SORTH_ENUL 1 /**< Null pointer */ #define SORTH_ENUL 1 /**< Null pointer */
#define SORTH_ELEN 2 /**< Length mismatch */ #define SORTH_ELEN 2 /**< Length mismatch */
#define SORTH_EMEM 3 /**< Memory allocation error */ #define SORTH_EMEM 3 /**< Memory allocation error */
/*@}*/ /*@}*/
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
 End of changes. 1 change blocks. 
80 lines changed or deleted 84 lines changed or added


 SphericalHarmonics.h   SphericalHarmonics.h 
skipping to change at line 43 skipping to change at line 43
extern "C" { extern "C" {
#endif #endif
/** /**
* \addtogroup SphericalHarmonics_h * \addtogroup SphericalHarmonics_h
* \author S.Fairhurst, B. Krishnan, L.Santamaria, C. Robinson, C. Pankow * \author S.Fairhurst, B. Krishnan, L.Santamaria, C. Robinson, C. Pankow
* *
* \brief Library of Spin-weighted Spherical Harmonic functions and an * \brief Library of Spin-weighted Spherical Harmonic functions and an
* implementation of the Wigner-D matrices * implementation of the Wigner-D matrices
* *
*
*/ */
/*@{*/ /*@{*/
COMPLEX16 XLALSpinWeightedSphericalHarmonic( REAL8 theta, REAL8 phi, int s, int l, int m ); COMPLEX16 XLALSpinWeightedSphericalHarmonic( REAL8 theta, REAL8 phi, int s, int l, int m );
int XLALScalarSphericalHarmonic( COMPLEX16 *y, UINT4 l, INT4 m, REAL8 thet a, REAL8 phi ); int XLALScalarSphericalHarmonic( COMPLEX16 *y, UINT4 l, INT4 m, REAL8 thet a, REAL8 phi );
INT4 XLALSphHarm ( COMPLEX16 *out, UINT4 L, INT4 M, REAL4 theta, REAL4 phi ); INT4 XLALSphHarm ( COMPLEX16 *out, UINT4 L, INT4 M, REAL4 theta, REAL4 phi );
double XLALJacobiPolynomial( int n, int alpha, int beta, double x ); double XLALJacobiPolynomial( int n, int alpha, int beta, double x );
double XLALWignerdMatrix( int l, int mp, int m, double beta ); double XLALWignerdMatrix( int l, int mp, int m, double beta );
COMPLEX16 XLALWignerDMatrix( int l, int mp, int m, double alpha, double bet a, double gam ); COMPLEX16 XLALWignerDMatrix( int l, int mp, int m, double alpha, double bet a, double gam );
/*@}*/ /*@}*/
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 StreamInput.h   StreamInput.h 
skipping to change at line 31 skipping to change at line 31
#define _STREAMINPUT_H #define _STREAMINPUT_H
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#include <lal/Grid.h> #include <lal/Grid.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup StreamInput_h * \addtogroup StreamInput_h
\author Creighton, T. D. * \author Creighton, T. D.
*
\brief Provides routines to read data from an open stream and store it i * \brief Provides routines to read data from an open stream and store it i
n LAL data structures. n LAL data structures.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include "StreamInput.h" * \code
\endcode * #include "StreamInput.h"
* \endcode
This header provides prototypes for routines that construct *
LAL data structures using the data from a file (or other I/O) stream. * This header provides prototypes for routines that construct
The routines do not provide a system-level interface to create files * LAL data structures using the data from a file (or other I/O) stream.
and open or close file streams; they simply assume that they have been * The routines do not provide a system-level interface to create files
passed an open, readable stream. Nonetheless, because they involve * and open or close file streams; they simply assume that they have been
I/O stream manipulation, these routines are placed in the * passed an open, readable stream. Nonetheless, because they involve
\c lalsupport library rather than in \c lal proper. * I/O stream manipulation, these routines are placed in the
* \c lalsupport library rather than in \c lal proper.
The routines in \ref StreamVectorInput_c and *
\ref StreamVectorSequenceInput_c are compartmentalized in such a way * The routines in \ref StreamVectorInput_c and
that they can easily be converted if the LAL specification later * \ref StreamVectorSequenceInput_c are compartmentalized in such a way
changes the way in which I/O streams are handled. In partucular, the * that they can easily be converted if the LAL specification later
only file I/O commands used are <tt>fgets()</tt> and <tt>feof()</tt>. * changes the way in which I/O streams are handled. In partucular, the
Thus the upgrade would involve only the following global changes: * only file I/O commands used are <tt>fgets()</tt> and <tt>feof()</tt>.
<ol> * Thus the upgrade would involve only the following global changes:
<li> Replace all occurrences of <tt>FILE *</tt> with the name of the * <ol>
LAL I/O stream pointer type.</li> * <li> Replace all occurrences of <tt>FILE *</tt> with the name of the
<li> Replace all occurrences of <tt>fgets()</tt> and <tt>feof()</tt> with * LAL I/O stream pointer type.</li>
equivalent LAL functions.</li> * <li> Replace all occurrences of <tt>fgets()</tt> and <tt>feof()</tt> wit
</ol> h
In particular, there is no need to translate routines such as * equivalent LAL functions.</li>
<tt>fscanf()</tt>; one should simply read data into a LAL * </ol>
\c CHARVector and then use <tt>sscanf()</tt> to format the input. * In particular, there is no need to translate routines such as
This is the approach used in the numerical input routines in * <tt>fscanf()</tt>; one should simply read data into a LAL
\ref StreamVectorInput_c and \ref StreamVectorSequenceInput_c. * \c CHARVector and then use <tt>sscanf()</tt> to format the input.
* This is the approach used in the numerical input routines in
The routines in \ref StreamSequenceInput_c are less robust but much * \ref StreamVectorInput_c and \ref StreamVectorSequenceInput_c.
more efficient: they use <tt>fscanf()</tt> to parse the input stream *
directly. They are intended primarily for test programs that may need * The routines in \ref StreamSequenceInput_c are less robust but much
to read large datafiles of undetermined length. The routines in * more efficient: they use <tt>fscanf()</tt> to parse the input stream
\ref StreamSeriesInput_c and \ref StreamGridInput_c also parse the * directly. They are intended primarily for test programs that may need
input stream directly using <tt>fscanf()</tt>, to avoid potentially * to read large datafiles of undetermined length. The routines in
crippling computational overhead. * \ref StreamSeriesInput_c and \ref StreamGridInput_c also parse the
* input stream directly using <tt>fscanf()</tt>, to avoid potentially
*/ /*@{*/ * crippling computational overhead.
*
*/
/*@{*/
/** \name Error Codes */ /*@{*/ /** \name Error Codes */ /*@{*/
#define STREAMINPUTH_ENUL 1 /**< Unexpected null pointer in arguments * / #define STREAMINPUTH_ENUL 1 /**< Unexpected null pointer in arguments * /
#define STREAMINPUTH_EOUT 2 /**< Output handle points to a non-null poi nter */ #define STREAMINPUTH_EOUT 2 /**< Output handle points to a non-null poi nter */
#define STREAMINPUTH_EMEM 3 /**< Memory allocation error */ #define STREAMINPUTH_EMEM 3 /**< Memory allocation error */
#define STREAMINPUTH_ELEN 4 /**< No numbers were read */ #define STREAMINPUTH_ELEN 4 /**< No numbers were read */
#define STREAMINPUTH_ESLEN 5 /**< Not enough numbers read to fill sequen ce */ #define STREAMINPUTH_ESLEN 5 /**< Not enough numbers read to fill sequen ce */
#define STREAMINPUTH_EVLEN 6 /**< Could not determine complex vectorLeng th */ #define STREAMINPUTH_EVLEN 6 /**< Could not determine complex vectorLeng th */
#define STREAMINPUTH_EDLEN 7 /**< Dimension lengths inconsistent or not given */ #define STREAMINPUTH_EDLEN 7 /**< Dimension lengths inconsistent or not given */
#define STREAMINPUTH_EDIM 8 /**< Inconsistent or non-positive arrayDim value */ #define STREAMINPUTH_EDIM 8 /**< Inconsistent or non-positive arrayDim value */
skipping to change at line 105 skipping to change at line 107
#define STREAMINPUTH_MSGESLEN "Not enough numbers read to fill sequence" #define STREAMINPUTH_MSGESLEN "Not enough numbers read to fill sequence"
#define STREAMINPUTH_MSGEVLEN "Could not determine complex vectorLength" #define STREAMINPUTH_MSGEVLEN "Could not determine complex vectorLength"
#define STREAMINPUTH_MSGEDLEN "Dimension lengths inconsistent or not given" #define STREAMINPUTH_MSGEDLEN "Dimension lengths inconsistent or not given"
#define STREAMINPUTH_MSGEDIM "Inconsistent or non-positive arrayDim value" #define STREAMINPUTH_MSGEDIM "Inconsistent or non-positive arrayDim value"
#define STREAMINPUTH_MSGEFMT "Badly formatted number" #define STREAMINPUTH_MSGEFMT "Badly formatted number"
#define STREAMINPUTH_MSGEBUF "BUFFSIZE not a multiple of largest complex t ype size" #define STREAMINPUTH_MSGEBUF "BUFFSIZE not a multiple of largest complex t ype size"
/* Function prototypes. */ /* Function prototypes. */
/** /**
\defgroup StreamVectorInput_c Module StreamVectorInput.c * \defgroup StreamVectorInput_c Module StreamVectorInput.c
\ingroup StreamInput_h * \ingroup StreamInput_h
\author Creighton, T. D. * \author Creighton, T. D.
*
\brief Reads data from a single line in an input stream. * \brief Reads data from a single line in an input stream.
*
\heading{Description} * ### Description ###
*
These routines read ASCII data from the I/O stream <tt>*stream</tt> * These routines read ASCII data from the I/O stream <tt>*stream</tt>
until a newline or the end-of-input is reached. (The line can be of * until a newline or the end-of-input is reached. (The line can be of
arbitrary length; the data is temporarily stored in a linked list of * arbitrary length; the data is temporarily stored in a linked list of
buffers.) Once read, a LAL vector structure <tt>**vector</tt> is * buffers.) Once read, a LAL vector structure <tt>**vector</tt> is
created and the data stored in it. The routine passes back a pointer * created and the data stored in it. The routine passes back a pointer
to the new structure. For the numerical routines, the \c strict * to the new structure. For the numerical routines, the \c strict
parameter determines whether the routine will do strict error checking * parameter determines whether the routine will do strict error checking
based on the contents of the input stream (see below). * based on the contents of the input stream (see below).
*
The basic routine in this module is <tt>LALCHARReadVector()</tt>, which * The basic routine in this module is <tt>LALCHARReadVector()</tt>, which
simply stores bytes read from <tt>*stream</tt> until the next newline * simply stores bytes read from <tt>*stream</tt> until the next newline
character <tt>'\n'</tt>, null character <tt>'\0'</tt>, or the end of the * character <tt>'\n'</tt>, null character <tt>'\0'</tt>, or the end of the
input as determined by the <tt>feof()</tt> function. The vector * input as determined by the <tt>feof()</tt> function. The vector
includes the newline (if present), and also an explicit <tt>'\0'</tt> at * includes the newline (if present), and also an explicit <tt>'\0'</tt> at
the end, if one was not already present. This routine should * the end, if one was not already present. This routine should
\e not be used to read a binary data stream, which are not * \e not be used to read a binary data stream, which are not
logically divided into ``lines''. Unless it aborts due to invalid * logically divided into ``lines''. Unless it aborts due to invalid
arguments or failed memory allocation, <tt>LALCHARReadVector()</tt> will * arguments or failed memory allocation, <tt>LALCHARReadVector()</tt> will
always return successfully regardless of the contents of the input * always return successfully regardless of the contents of the input
stream; <tt>*vector</tt> will created containing at least a single * stream; <tt>*vector</tt> will created containing at least a single
<tt>'\0'</tt> terminator, if nothing else. * <tt>'\0'</tt> terminator, if nothing else.
*
The other routines in this module use <tt>LALCHARReadVector()</tt> to * The other routines in this module use <tt>LALCHARReadVector()</tt> to
read a line, and then parse it into numerical datatypes using the * read a line, and then parse it into numerical datatypes using the
corresponding routine in the \ref StringConvert.c. * corresponding routine in the \ref StringConvert.c.
Conversion stops when the routine encounters a character that cannot * Conversion stops when the routine encounters a character that cannot
be parsed as part of a number. If \c strict is 0, the routine * be parsed as part of a number. If \c strict is 0, the routine
will fail only due to invalid arguments or memory allocation failure, * will fail only due to invalid arguments or memory allocation failure,
not from a poorly-formatted input stream; if no numbers are read, * not from a poorly-formatted input stream; if no numbers are read,
<tt>*vector</tt> will remain \c NULL, but no error will be reported. * <tt>*vector</tt> will remain \c NULL, but no error will be reported.
(In this mode, the calling routine should always test the output * (In this mode, the calling routine should always test the output
before trying to dereference it, in order to avoid segmentation * before trying to dereference it, in order to avoid segmentation
violations.) If \c strict is nonzero, the routine will report an * violations.) If \c strict is nonzero, the routine will report an
error if the input stream was poorly formatted, either an \c ELEN * error if the input stream was poorly formatted, either an \c ELEN
error if no numbers were read, or \c EFMT if a character was * error if no numbers were read, or \c EFMT if a character was
encountered that was neither part of a parseable number nor * encountered that was neither part of a parseable number nor
whitespace. * whitespace.
*
Note that \c strict=0 allows an input stream to contain blank * Note that \c strict=0 allows an input stream to contain blank
lines or comments. A comment begins with any character that cannot * lines or comments. A comment begins with any character that cannot
occur in a valid number, which will cause the numerical parser to skip * occur in a valid number, which will cause the numerical parser to skip
the rest of the line. The usual comment delimiters are <tt>'#'</tt> and * the rest of the line. The usual comment delimiters are <tt>'#'</tt> and
<tt>'%'</tt>, but any character except <tt>'+'</tt> <tt>'-'</tt>, * <tt>'%'</tt>, but any character except <tt>'+'</tt> <tt>'-'</tt>,
<tt>'e'</tt>, <tt>'E'</tt>, <tt>'.'</tt>, digits, and whitespace will work. * <tt>'e'</tt>, <tt>'E'</tt>, <tt>'.'</tt>, digits, and whitespace will wo
rk.
*/ *
*/
/*@{*/ /*@{*/
void LALCHARReadVector( LALStatus *status, CHARVector **vector, FILE *stre am ); void LALCHARReadVector( LALStatus *status, CHARVector **vector, FILE *stre am );
void LALI2ReadVector( LALStatus *status, INT2Vector **vector, FILE *stream , BOOLEAN strict ); void LALI2ReadVector( LALStatus *status, INT2Vector **vector, FILE *stream , BOOLEAN strict );
void LALI4ReadVector( LALStatus *status, INT4Vector **vector, FILE *stream , BOOLEAN strict ); void LALI4ReadVector( LALStatus *status, INT4Vector **vector, FILE *stream , BOOLEAN strict );
void LALI8ReadVector( LALStatus *status, INT8Vector **vector, FILE *stream , BOOLEAN strict ); void LALI8ReadVector( LALStatus *status, INT8Vector **vector, FILE *stream , BOOLEAN strict );
void LALU2ReadVector( LALStatus *status, UINT2Vector **vector, FILE *strea m, BOOLEAN strict ); void LALU2ReadVector( LALStatus *status, UINT2Vector **vector, FILE *strea m, BOOLEAN strict );
void LALU4ReadVector( LALStatus *status, UINT4Vector **vector, FILE *strea m, BOOLEAN strict ); void LALU4ReadVector( LALStatus *status, UINT4Vector **vector, FILE *strea m, BOOLEAN strict );
void LALU8ReadVector( LALStatus *status, UINT8Vector **vector, FILE *strea m, BOOLEAN strict ); void LALU8ReadVector( LALStatus *status, UINT8Vector **vector, FILE *strea m, BOOLEAN strict );
void LALSReadVector( LALStatus *status, REAL4Vector **vector, FILE *stream , BOOLEAN strict ); void LALSReadVector( LALStatus *status, REAL4Vector **vector, FILE *stream , BOOLEAN strict );
void LALDReadVector( LALStatus *status, REAL8Vector **vector, FILE *stream , BOOLEAN strict ); void LALDReadVector( LALStatus *status, REAL8Vector **vector, FILE *stream , BOOLEAN strict );
/*@}*/ /*@}*/
/** /**
\defgroup StreamVectorSequenceInput_c Module StreamVectorSequenceInput.c * \defgroup StreamVectorSequenceInput_c Module StreamVectorSequenceInput.c
\ingroup StreamInput_h * \ingroup StreamInput_h
\author Creighton, T. D. * \author Creighton, T. D.
*
\brief Reads the entire contents of an input stream into a vector sequen * \brief Reads the entire contents of an input stream into a vector sequen
ce. ce.
*
\heading{Description} * ### Description ###
*
These routines read data from the I/O stream <tt>*stream</tt> until the * These routines read data from the I/O stream <tt>*stream</tt> until the
end-of-input is reached. Each line is stored as a data vector, and * end-of-input is reached. Each line is stored as a data vector, and
the vectors are combined into a LAL vector sequence structure * the vectors are combined into a LAL vector sequence structure
<tt>**sequence</tt>. Each line vector is padded with zeros to match the * <tt>**sequence</tt>. Each line vector is padded with zeros to match the
length of the longest line. The routine passes back a pointer to the * length of the longest line. The routine passes back a pointer to the
new structure. * new structure.
*
The routine <tt>LALCHARReadVectorSequence()</tt> essentially stores an * The routine <tt>LALCHARReadVectorSequence()</tt> essentially stores an
image of the I/O stream as a sequence of lines padded with <tt>'\0'</tt> * image of the I/O stream as a sequence of lines padded with <tt>'\0'</tt>
characters. However, it will skip over any empty lines, which occur, * characters. However, it will skip over any empty lines, which occur,
for instance, when the end-of-input or a null character <tt>'\0'</tt> * for instance, when the end-of-input or a null character <tt>'\0'</tt>
occurs immediately following a newline character <tt>'\n'</tt>. The * occurs immediately following a newline character <tt>'\n'</tt>. The
numeric routines will additionally skip blank lines, comment lines, or * numeric routines will additionally skip blank lines, comment lines, or
other input lines that have no parseable numbers in them. (As with * other input lines that have no parseable numbers in them. (As with
the routines in \ref StreamVectorInput.c, comment in sindicated by a * the routines in \ref StreamVectorInput.c, comment in sindicated by a
<tt>#</tt> sign at the beginning of a line or a <tt>%</tt> sign anywhere * <tt>#</tt> sign at the beginning of a line or a <tt>%</tt> sign anywhere
in the line, signifying that the remainder of the line is to be * in the line, signifying that the remainder of the line is to be
ignored.) However, if an input line contains \e any parseable * ignored.) However, if an input line contains \e any parseable
data, then the corresponding vector in the vector sequence will be * data, then the corresponding vector in the vector sequence will be
allocated (and padded with zeros, if it is shorter than the longest * allocated (and padded with zeros, if it is shorter than the longest
line). * line).
*
\heading{Algorithm} * ### Algorithm ###
*
These functions first create a linked list of vectors, using the * These functions first create a linked list of vectors, using the
routines in \ref StreamVectorInput.c to read them in. Once the list * routines in \ref StreamVectorInput.c to read them in. Once the list
is complete, the longest vector length is determined, and the vector * is complete, the longest vector length is determined, and the vector
sequence is created and filled. * sequence is created and filled.
*
The numeric routines skip over blank, comment, or otherwise * The numeric routines skip over blank, comment, or otherwise
unparseable lines by catching and handling the \c LEN error code * unparseable lines by catching and handling the \c LEN error code
generated by the vector input routine. However, it is worth pointing * generated by the vector input routine. However, it is worth pointing
out that the vector input routine will have generated an error message * out that the vector input routine will have generated an error message
if the error reporting bit in \c lalDebugLevel was set. The * if the error reporting bit in \c lalDebugLevel was set. The
vector sequence input routines will therefore generate a followup * vector sequence input routines will therefore generate a followup
messages indicating that the preceding error was successfully dealt * messages indicating that the preceding error was successfully dealt
with. So you may see pairs of \c ABORT: and \c CONTINUE: * with. So you may see pairs of \c ABORT: and \c CONTINUE:
error messages when reading files containing blank or comment lines. * error messages when reading files containing blank or comment lines.
*
*/ */
/*@{*/ /*@{*/
void LALCHARReadVectorSequence( LALStatus *status, CHARVectorSequence **se quence, FILE *stream ); void LALCHARReadVectorSequence( LALStatus *status, CHARVectorSequence **se quence, FILE *stream );
void LALI2ReadVectorSequence( LALStatus *status, INT2VectorSequence **sequ ence, FILE *stream ); void LALI2ReadVectorSequence( LALStatus *status, INT2VectorSequence **sequ ence, FILE *stream );
void LALI4ReadVectorSequence( LALStatus *status, INT4VectorSequence **sequ ence, FILE *stream ); void LALI4ReadVectorSequence( LALStatus *status, INT4VectorSequence **sequ ence, FILE *stream );
void LALI8ReadVectorSequence( LALStatus *status, INT8VectorSequence **sequ ence, FILE *stream ); void LALI8ReadVectorSequence( LALStatus *status, INT8VectorSequence **sequ ence, FILE *stream );
void LALU2ReadVectorSequence( LALStatus *status, UINT2VectorSequence **seq uence, FILE *stream ); void LALU2ReadVectorSequence( LALStatus *status, UINT2VectorSequence **seq uence, FILE *stream );
void LALU4ReadVectorSequence( LALStatus *status, UINT4VectorSequence **seq uence, FILE *stream ); void LALU4ReadVectorSequence( LALStatus *status, UINT4VectorSequence **seq uence, FILE *stream );
void LALU8ReadVectorSequence( LALStatus *status, UINT8VectorSequence **seq uence, FILE *stream ); void LALU8ReadVectorSequence( LALStatus *status, UINT8VectorSequence **seq uence, FILE *stream );
void LALSReadVectorSequence( LALStatus *status, REAL4VectorSequence **sequ ence, FILE *stream ); void LALSReadVectorSequence( LALStatus *status, REAL4VectorSequence **sequ ence, FILE *stream );
void LALDReadVectorSequence( LALStatus *status, REAL8VectorSequence **sequ ence, FILE *stream ); void LALDReadVectorSequence( LALStatus *status, REAL8VectorSequence **sequ ence, FILE *stream );
/*@}*/ /*@}*/
/** /**
\defgroup StreamSequenceInput_c Module StreamSequenceInput.c * \defgroup StreamSequenceInput_c Module StreamSequenceInput.c
\ingroup StreamInput_h * \ingroup StreamInput_h
\author Creighton, T. D. * \author Creighton, T. D.
*
\brief Converts an input stream into a data sequence. * \brief Converts an input stream into a data sequence.
*
\heading{Description} * ### Description ###
*
These routines read data from the I/O stream <tt>*stream</tt> until the * These routines read data from the I/O stream <tt>*stream</tt> until the
end-of-input is reached. (The input can be of arbitrary length; the * end-of-input is reached. (The input can be of arbitrary length; the
data is temporarily stored in a linked list of buffers.) Once read, a * data is temporarily stored in a linked list of buffers.) Once read, a
LAL sequence structure <tt>**sequence</tt> is created and the data * LAL sequence structure <tt>**sequence</tt> is created and the data
stored in it. The routine passes back a pointer to the new structure. * stored in it. The routine passes back a pointer to the new structure.
*
The routine <tt>LALCHARReadSequence()</tt> simply stores the entire * The routine <tt>LALCHARReadSequence()</tt> simply stores the entire
remaining contents of the I/O stream in a \c CHARSequence, * remaining contents of the I/O stream in a \c CHARSequence,
including whitespace, newline <tt>'\n'</tt>, null <tt>'\0'</tt>, or other * including whitespace, newline <tt>'\n'</tt>, null <tt>'\0'</tt>, or othe
special characters. (It can in principle be used to read and store r
binary data as a sequence of bytes. Note that the end-of-transmission * special characters. (It can in principle be used to read and store
byte <tt>'\004'</tt> does \e not necessarily mark the end-of-input, * binary data as a sequence of bytes. Note that the end-of-transmission
which is instead determined using the <tt>feof()</tt> function.) * byte <tt>'\004'</tt> does \e not necessarily mark the end-of-input,
* which is instead determined using the <tt>feof()</tt> function.)
The other routines in this module interpret the input as a sequence of *
whitespace-separated numbers, which are parsed directly from the I/O * The other routines in this module interpret the input as a sequence of
stream using <tt>fscanf()</tt>. The sequence is terminated at the * whitespace-separated numbers, which are parsed directly from the I/O
end-of-input or at any point where <tt>fscanf()</tt> is unable to parse * stream using <tt>fscanf()</tt>. The sequence is terminated at the
the input. * end-of-input or at any point where <tt>fscanf()</tt> is unable to parse
* the input.
For the complex input routines <tt>LALCReadSequence()</tt> and *
<tt>LALZReadSequence()</tt>, each pair of numbers read are interpreted * For the complex input routines <tt>LALCReadSequence()</tt> and
as the real and imaginary parts of a complex number. The usual input * <tt>LALZReadSequence()</tt>, each pair of numbers read are interpreted
format is for each line to contain a pair of numbers, but * as the real and imaginary parts of a complex number. The usual input
<tt>fscanf()</tt> does not distinguish between newline and other * format is for each line to contain a pair of numbers, but
whitespace characters, so neither do these routines. * <tt>fscanf()</tt> does not distinguish between newline and other
* whitespace characters, so neither do these routines.
Unlike the numerical routines in other \ref StreamInput.h modules, *
these routines have no mechanism to deal with comments; every * Unlike the numerical routines in other \ref StreamInput.h modules,
whitespace-delimited substring will be treated as a number. * these routines have no mechanism to deal with comments; every
* whitespace-delimited substring will be treated as a number.
\heading{Algorithm} *
* ### Algorithm ###
These routines read data into a linked list of buffers, to allow *
memory allocation to occur in batches for improved efficiency. The * These routines read data into a linked list of buffers, to allow
numerical routines also use <tt>fscanf()</tt> directly on the I/O stream * memory allocation to occur in batches for improved efficiency. The
to avoid the inefficiency of storing and parsing intermediate * numerical routines also use <tt>fscanf()</tt> directly on the I/O stream
character strings, as is done by the corresponding vector sequence * to avoid the inefficiency of storing and parsing intermediate
input routines. This reduces robustness and versatility (as * character strings, as is done by the corresponding vector sequence
indicated, for instance, by the inability of dealing with comments), * input routines. This reduces robustness and versatility (as
and increases the number of potential points-of-failure (by requiring * indicated, for instance, by the inability of dealing with comments),
a consistent implementation across platforms of <tt>getc()</tt> and * and increases the number of potential points-of-failure (by requiring
<tt>fscanf()</tt>, rather than the single function <tt>fgets()</tt> used * a consistent implementation across platforms of <tt>getc()</tt> and
by other stream input routines). However, these sacrifices are * <tt>fscanf()</tt>, rather than the single function <tt>fgets()</tt> used
necessary to allow LAL applications to ingest large quantities of * by other stream input routines). However, these sacrifices are
numerical data efficiently. * necessary to allow LAL applications to ingest large quantities of
* numerical data efficiently.
*/ *
*/
/*@{*/ /*@{*/
int XLALCHARReadSequence( CHARSequence **sequence, FILE *stream ); int XLALCHARReadSequence( CHARSequence **sequence, FILE *stream );
void LALCHARReadSequence( LALStatus *status, CHARSequence **sequence, FILE *stream ); void LALCHARReadSequence( LALStatus *status, CHARSequence **sequence, FILE *stream );
void LALI2ReadSequence( LALStatus *status, INT2Sequence **sequence, FILE *s tream ); void LALI2ReadSequence( LALStatus *status, INT2Sequence **sequence, FILE *s tream );
void LALI4ReadSequence( LALStatus *status, INT4Sequence **sequence, FILE *s tream ); void LALI4ReadSequence( LALStatus *status, INT4Sequence **sequence, FILE *s tream );
void LALI8ReadSequence( LALStatus *status, INT8Sequence **sequence, FILE *s tream ); void LALI8ReadSequence( LALStatus *status, INT8Sequence **sequence, FILE *s tream );
void LALU2ReadSequence( LALStatus *status, UINT2Sequence **sequence, FILE * stream ); void LALU2ReadSequence( LALStatus *status, UINT2Sequence **sequence, FILE * stream );
void LALU4ReadSequence( LALStatus *status, UINT4Sequence **sequence, FILE * stream ); void LALU4ReadSequence( LALStatus *status, UINT4Sequence **sequence, FILE * stream );
void LALU8ReadSequence( LALStatus *status, UINT8Sequence **sequence, FILE * stream ); void LALU8ReadSequence( LALStatus *status, UINT8Sequence **sequence, FILE * stream );
void LALSReadSequence( LALStatus *status, REAL4Sequence **sequence, FILE *s tream ); void LALSReadSequence( LALStatus *status, REAL4Sequence **sequence, FILE *s tream );
 End of changes. 4 change blocks. 
205 lines changed or deleted 210 lines changed or added


 StreamOutput.h   StreamOutput.h 
skipping to change at line 31 skipping to change at line 31
#define _STREAMOUTPUT_H #define _STREAMOUTPUT_H
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#include <lal/Grid.h> #include <lal/Grid.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
\addtogroup StreamOutput_h * \addtogroup StreamOutput_h
\author Creighton, T. D. * \author Creighton, T. D.
*
\brief Provides routines to write data from LAL data structures to an op * \brief Provides routines to write data from LAL data structures to an op
en stream. en stream.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include "StreamOutput.h" * \code
\endcode * #include "StreamOutput.h"
* \endcode
This header provides prototypes for routines that write the *
contents of LAL time/frequency series structures or grid structures to * This header provides prototypes for routines that write the
a file (or other I/O) stream, in a standard format. The routines do * contents of LAL time/frequency series structures or grid structures to
not provide a system-level interface to create files and open or close * a file (or other I/O) stream, in a standard format. The routines do
file streams; they simply assume that they have been passed an open, * not provide a system-level interface to create files and open or close
writeable stream. Nonetheless, because they involve I/O stream * file streams; they simply assume that they have been passed an open,
manipulation, these routines are placed in the \c lalsupport * writeable stream. Nonetheless, because they involve I/O stream
library rather than in \c lal proper. * manipulation, these routines are placed in the \c lalsupport
* library rather than in \c lal proper.
*/ /*@{*/ *
*/
/*@{*/
/** \name Error Codes */ /*@{*/ /** \name Error Codes */ /*@{*/
#define STREAMOUTPUTH_ENUL 1 /**< Unexpected null pointer in arguments * / #define STREAMOUTPUTH_ENUL 1 /**< Unexpected null pointer in arguments * /
#define STREAMOUTPUTH_EPRN 2 /**< Print statement failed */ #define STREAMOUTPUTH_EPRN 2 /**< Print statement failed */
/*@}*/ /*@}*/
/*@}*/ /*@}*/
#define STREAMOUTPUTH_MSGENUL "Unexpected null pointer in arguments" #define STREAMOUTPUTH_MSGENUL "Unexpected null pointer in arguments"
#define STREAMOUTPUTH_MSGEPRN "Print statement failed" #define STREAMOUTPUTH_MSGEPRN "Print statement failed"
 End of changes. 1 change blocks. 
21 lines changed or deleted 23 lines changed or added


 StringInput.h   StringInput.h 
skipping to change at line 33 skipping to change at line 33
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#include <lal/LALStdio.h> #include <lal/LALStdio.h>
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
\addtogroup StringInput_h * \addtogroup StringInput_h
\author Creighton, T. D. * \author Creighton, T. D.
*
\brief Provides routines to parse \c CHARVectors into other LAL datatype * \brief Provides routines to parse \c CHARVectors into other LAL datatype
s. s.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include "StringInput.h" * \code
\endcode * #include "StringInput.h"
* \endcode
This header provides prototypes for routines that construct *
LAL data structures using the data from a character string. As in * This header provides prototypes for routines that construct
standard C, a \e string is a block of non-null bytes of arbitrary * LAL data structures using the data from a character string. As in
length, terminated by a null byte <tt>'\0'</tt>, and referred to by a * standard C, a \e string is a block of non-null bytes of arbitrary
value of type <tt>CHAR *</tt> pointing to the first byte in the string. * length, terminated by a null byte <tt>'\0'</tt>, and referred to by a
It is not to be confused with a \c CHARVector, a LAL structure * value of type <tt>CHAR *</tt> pointing to the first byte in the string.
referring to a block of data of a specified length, which may or may * It is not to be confused with a \c CHARVector, a LAL structure
not contain one or more instances of <tt>'\0'</tt>. * referring to a block of data of a specified length, which may or may
* not contain one or more instances of <tt>'\0'</tt>.
In general, the routines under this header will have string inputs of *
type <tt>const CHAR *</tt> (in order to allow, for instance, string * In general, the routines under this header will have string inputs of
literals to be used as inputs), but will allocate \c CHARVector * type <tt>const CHAR *</tt> (in order to allow, for instance, string
structures to store string outputs. Unless otherwise specified, these * literals to be used as inputs), but will allocate \c CHARVector
outputs are guaranteed to contain at least one <tt>'\0'</tt> character, * structures to store string outputs. Unless otherwise specified, these
so their \c data fields are valid strings. It is the * outputs are guaranteed to contain at least one <tt>'\0'</tt> character,
responsibility of the calling routine to ensure that the string input * so their \c data fields are valid strings. It is the
contains a terminating <tt>'\0'</tt> within the memory segment pointed * responsibility of the calling routine to ensure that the string input
to by the <tt>CHAR *</tt> input, in order to avoid segmentation * contains a terminating <tt>'\0'</tt> within the memory segment pointed
violation. * to by the <tt>CHAR *</tt> input, in order to avoid segmentation
* violation.
These routines are intended to work in conjunction with the functions *
in <tt>StreamInput.h</tt> to add LAL robustness to otherwise ad-hoc data * These routines are intended to work in conjunction with the functions
input routines. However, the functions in \ref StringInput.h are * in <tt>StreamInput.h</tt> to add LAL robustness to otherwise ad-hoc data
fully LAL-compliant and use only LAL types, so they are included in * input routines. However, the functions in \ref StringInput.h are
\c liblal proper. * fully LAL-compliant and use only LAL types, so they are included in
* \c liblal proper.
\heading{Constants} *
* ### Constants ###
The following constants are format strings that can be used by the *
various C <tt>scanf()</tt> or <tt>printf()</tt> functions to parse or * The following constants are format strings that can be used by the
write sequences of characters corresponding to base LAL datatypes. * various C <tt>scanf()</tt> or <tt>printf()</tt> functions to parse or
Since the C datatypes (\c short, \c int, \c long, * write sequences of characters corresponding to base LAL datatypes.
<tt>long long</tt>, \c float, \c double, etc.) do not have fixed * Since the C datatypes (\c short, \c int, \c long,
mappings to LAL base datatypes (\c INT2, \c INT4, \c INT8, * <tt>long long</tt>, \c float, \c double, etc.) do not have fixed
\c REAL4, \c REAL8, etc.), the appropriate format strings for * mappings to LAL base datatypes (\c INT2, \c INT4, \c INT8,
each LAL datatype must be determined at configuration time and set at * \c REAL4, \c REAL8, etc.), the appropriate format strings for
compile time. * each LAL datatype must be determined at configuration time and set at
* compile time.
These format strings give only the conversion character preceded by *
any length modifier according to the type (\c short, \c long, * These format strings give only the conversion character preceded by
etc.). In particular they do \e not contain the initial * any length modifier according to the type (\c short, \c long,
<tt>'%'</tt> character that initiates the conversion specification. * etc.). In particular they do \e not contain the initial
However, being <tt>\#define</tt>d string literals, they can be combined * <tt>'%'</tt> character that initiates the conversion specification.
with <tt>"%"</tt> string literals or more complicated format strings * However, being <tt>\#define</tt>d string literals, they can be combined
through implicit concatenation. Thus to scan \c string for a * with <tt>"%"</tt> string literals or more complicated format strings
\c UINT4 number \c n one would write: * through implicit concatenation. Thus to scan \c string for a
\code * \c UINT4 number \c n one would write:
sscanf( string, "%" LAL_UINT4_FORMAT, &n ); * \code
\endcode * sscanf( string, "%" LAL_UINT4_FORMAT, &n );
Similarly, to print a \c REAL8 number \c x with 12 digits * \endcode
following the decimal place, one could use the following: * Similarly, to print a \c REAL8 number \c x with 12 digits
\code * following the decimal place, one could use the following:
printf( "%.12" LAL_REAL8_FORMAT, x ); * \code
\endcode * printf( "%.12" LAL_REAL8_FORMAT, x );
Of course, floating-point numbers are more commonly printed using the * \endcode
<tt>"%e"</tt> conversion specifier, which does not generally require * Of course, floating-point numbers are more commonly printed using the
type-dependent length modifiers. * <tt>"%e"</tt> conversion specifier, which does not generally require
* type-dependent length modifiers.
<table> *
<tr><th>Name</th><th>Usual value</th></tr> * <table>
<tr><td>#LAL_INT2_FORMAT</td><td><tt>"hd"</tt></td></tr> * <tr><th>Name</th><th>Usual value</th></tr>
<tr><td>#LAL_INT4_FORMAT</td><td><tt>"d"</tt> or <tt>"ld"</tt></td></tr> * <tr><td>#LAL_INT2_FORMAT</td><td><tt>"hd"</tt></td></tr>
<tr><td>#LAL_INT8_FORMAT</td><td><tt>"ld"</tt> or <tt>"lld"</tt></td></tr> * <tr><td>#LAL_INT4_FORMAT</td><td><tt>"d"</tt> or <tt>"ld"</tt></td></tr
<tr><td>#LAL_UINT2_FORMAT</td><td><tt>"hu"</tt></td></tr> >
<tr><td>#LAL_UINT4_FORMAT</td><td><tt>"u"</tt> or <tt>"lu"</tt></td></tr> * <tr><td>#LAL_INT8_FORMAT</td><td><tt>"ld"</tt> or <tt>"lld"</tt></td></t
<tr><td>#LAL_UINT8_FORMAT</td><td><tt>"lu"</tt> or <tt>"llu"</tt></td></tr> r>
<tr><td>#LAL_REAL4_FORMAT</td><td><tt>"f"</tt></td></tr> * <tr><td>#LAL_UINT2_FORMAT</td><td><tt>"hu"</tt></td></tr>
<tr><td>#LAL_REAL8_FORMAT</td><td><tt>"lf"</tt></td></tr> * <tr><td>#LAL_UINT4_FORMAT</td><td><tt>"u"</tt> or <tt>"lu"</tt></td></t
</table> r>
* <tr><td>#LAL_UINT8_FORMAT</td><td><tt>"lu"</tt> or <tt>"llu"</tt></td></
*/ tr>
* <tr><td>#LAL_REAL4_FORMAT</td><td><tt>"f"</tt></td></tr>
* <tr><td>#LAL_REAL8_FORMAT</td><td><tt>"lf"</tt></td></tr>
* </table>
*
*/
/*@{*/ /*@{*/
/** \name Error Codes *//*@{ */ /** \name Error Codes */ /*@{ */
#define STRINGINPUTH_ENUL 1 /**< Unexpected null pointer in arguments * / #define STRINGINPUTH_ENUL 1 /**< Unexpected null pointer in arguments * /
#define STRINGINPUTH_EOUT 2 /**< Output handle points to a non-null poi nter */ #define STRINGINPUTH_EOUT 2 /**< Output handle points to a non-null poi nter */
#define STRINGINPUTH_EMEM 3 /**< Memory allocation error */ #define STRINGINPUTH_EMEM 3 /**< Memory allocation error */
/*@}*/ /*@}*/
/** \cond DONT_DOXYGEN */ /** \cond DONT_DOXYGEN */
#define STRINGINPUTH_MSGENUL "Unexpected null pointer in arguments" #define STRINGINPUTH_MSGENUL "Unexpected null pointer in arguments"
#define STRINGINPUTH_MSGEOUT "Output handle points to a non-null pointer" #define STRINGINPUTH_MSGEOUT "Output handle points to a non-null pointer"
#define STRINGINPUTH_MSGEMEM "Memory allocation error" #define STRINGINPUTH_MSGEMEM "Memory allocation error"
/** \endcond */ /** \endcond */
 End of changes. 2 change blocks. 
83 lines changed or deleted 88 lines changed or added


 StringVector.h   StringVector.h 
skipping to change at line 39 skipping to change at line 39
#include <stdarg.h> #include <stdarg.h>
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
/** /**
* \author Reinhard Prix * \author Reinhard Prix
* \date 2008 * \date 2008
* \addtogroup StringVector_h * \addtogroup StringVector_h
* *
* \brief Creation/destruction/manipulation API for ::LALStringVector objec ts, * \brief Creation/destruction/manipulation API for ::LALStringVector objec ts,
* which are just LAL-type vectors of CHAR * pointers. * which are just LAL-type vectors of CHAR * pointers.
*
* ### Synopsis ###
* *
* \heading{Synopsis}
* \code * \code
* #include <lal/StringVector.h> * #include <lal/StringVector.h>
* \endcode * \endcode
* *
*/ */
/*@{*/ /*@{*/
/*---------- DEFINES ----------*/ /*---------- DEFINES ----------*/
/*----- Error-codes -----*/ /*----- Error-codes -----*/
skipping to change at line 68 skipping to change at line 69
#endif /* SWIG */ #endif /* SWIG */
LALStringVector *XLALCreateStringVector ( const CHAR *str1, ... ); LALStringVector *XLALCreateStringVector ( const CHAR *str1, ... );
LALStringVector *XLALAppendString2Vector (LALStringVector *vect, const CHAR *string ); LALStringVector *XLALAppendString2Vector (LALStringVector *vect, const CHAR *string );
void XLALDestroyStringVector ( LALStringVector *vect ); void XLALDestroyStringVector ( LALStringVector *vect );
int XLALSortStringVector (LALStringVector *strings); int XLALSortStringVector (LALStringVector *strings);
LALStringVector *XLALParseCSV2StringVector ( const CHAR *CSVlist ); LALStringVector *XLALParseCSV2StringVector ( const CHAR *CSVlist );
INT4 XLALFindStringInVector ( const char *needle, const LALStringVector *ha ystack ); INT4 XLALFindStringInVector ( const char *needle, const LALStringVector *ha ystack );
char *XLALDeblankString ( const char *start, UINT4 len );
/*@}*/ /*@}*/
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/* C++ protection. */ /* C++ protection. */
#endif /* Double-include protection. */ #endif /* Double-include protection. */
 End of changes. 3 change blocks. 
2 lines changed or deleted 5 lines changed or added


 TimeDelay.h   TimeDelay.h 
skipping to change at line 37 skipping to change at line 37
extern "C" extern "C"
{ {
#endif #endif
/** /**
* \addtogroup TimeDelay_h * \addtogroup TimeDelay_h
* \author David Chin, Kipp Cannon * \author David Chin, Kipp Cannon
* *
* \brief Provides routines to compute time delay between two detectors * \brief Provides routines to compute time delay between two detectors
* *
* \heading{Synopsis} * ### Synopsis ###
*
* \code * \code
* #include <lal/TimeDelay.h> * #include <lal/TimeDelay.h>
* \endcode * \endcode
*
\heading{Description} * ### Description ###
*
The function XLALTimeDelayFromEarthCenter() Computes difference in arrival * The function XLALTimeDelayFromEarthCenter() Computes difference in arriv
time of the same signal at detector and at center of Earth-fixed frame. al
* time of the same signal at detector and at center of Earth-fixed frame.
The function XLALLightTravelTime() computes the light travel time between t *
wo detectors and returns the answer in \c INT8 nanoseconds. * The function XLALLightTravelTime() computes the light travel time betwee
n two detectors and returns the answer in \c INT8 nanoseconds.
The function XLALPopulateAccuracyParams() creates an instance of ::Inspiral *
AccuracyList populated with * The function XLALPopulateAccuracyParams() creates an instance of ::Inspi
the light-travel times between the detectors, using just the previous funct ralAccuracyList populated with
ion. * the light-travel times between the detectors, using just the previous fu
The function XLALPopulateAccuracyParamsExt(), however, creates an instance nction.
of ::InspiralAccuracyList * The function XLALPopulateAccuracyParamsExt(), however, creates an instan
populated with the \c real travel time of a putative signal for the given t ce of ::InspiralAccuracyList
ime and the given sky * populated with the \c real travel time of a putative signal for the give
location (in right ascension and declination, both given in degrees). n time and the given sky
* location (in right ascension and declination, both given in degrees).
\heading{Algorithm} *
* ### Algorithm ###
TBA. See Anderson, <em>et al.</em> [\ref ABCF2000] in the mean time. *
* TBA. See Anderson, <em>et al.</em> \cite ABCCRW_2001 in the mean time.
Note that GPS time is passed with both the detectors. The GPS time of the *
second detector is \e ignored, and the GPS time for the first detector * Note that GPS time is passed with both the detectors. The GPS time of t
is taken to be the time when the signal arrives at the center of the he
Earth. In practice, this time will be the time of detection of a signal at * second detector is \e ignored, and the GPS time for the first detector
the first detector, but, as in Anderson, <em>et al.</em>, we make this * is taken to be the time when the signal arrives at the center of the
approximation as it makes little difference. This time is used to compute * Earth. In practice, this time will be the time of detection of a signal
a GMST which gives us the orientation of the Earth. at
* the first detector, but, as in Anderson, <em>et al.</em>, we make this
*/ * approximation as it makes little difference. This time is used to compu
te
* a GMST which gives us the orientation of the Earth.
*
*/
/*@{*/ /*@{*/
/* /*
* Function prototypes * Function prototypes
*/ */
double double
XLALArrivalTimeDiff( XLALArrivalTimeDiff(
const double detector1_earthfixed_xyz_metres[3], const double detector1_earthfixed_xyz_metres[3],
const double detector2_earthfixed_xyz_metres[3], const double detector2_earthfixed_xyz_metres[3],
 End of changes. 2 change blocks. 
33 lines changed or deleted 38 lines changed or added


 TimeFreqFFT.h   TimeFreqFFT.h 
skipping to change at line 39 skipping to change at line 39
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
* \addtogroup TimeFreqFFT_h * \addtogroup TimeFreqFFT_h
* *
* \brief Performs real-to-complex, complex-to-real FFTs and average power spectrum estimation. * \brief Performs real-to-complex, complex-to-real FFTs and average power spectrum estimation.
* *
* \heading{Synopsis} * ### Synopsis ###
*
* \code * \code
* #include <lal/TimeFreqFFT.h> * #include <lal/TimeFreqFFT.h>
* \endcode * \endcode
* *
* Perform time-to-frequency and frequency-to-time fast Fourier * Perform time-to-frequency and frequency-to-time fast Fourier
* transforms. Also provides a function to compute mean and median power * transforms. Also provides a function to compute mean and median power
* spectra with user specified windowning. * spectra with user specified windowning.
* *
* The definition of the Fourier transform is \f$ e^{2 \pi i f t} \f$ * The definition of the Fourier transform is \f$ e^{2 \pi i f t} \f$
* and the inline equation version of that is * and the inline equation version of that is
* \f[ * \f[
* \tilde{h}_k = \sum * \tilde{h}_k = \sum
* \f] * \f]
* *
* * ### Description ###
* \heading{Description}
* *
* The routines LALTimeFreqRealFFT() and LALTimeFreqComplexFFT() * The routines LALTimeFreqRealFFT() and LALTimeFreqComplexFFT()
* transform time series \f$h_j\f$, \f$0\le j<n\f$, into a frequency series * transform time series \f$h_j\f$, \f$0\le j<n\f$, into a frequency series
* \f$\tilde{h}_k\f$. For LALTimeFreqRealFFT(), * \f$\tilde{h}_k\f$. For LALTimeFreqRealFFT(),
* \f[ * \f[
* \tilde{h}_k = \Delta t \times H_k \; * \tilde{h}_k = \Delta t \times H_k \;
* \mbox{for } 0\le k\le\lfloor n/2\rfloor * \mbox{for } 0\le k\le\lfloor n/2\rfloor
* \f] * \f]
* The packing covers the range from dc (inclusive) to Nyquist (inclusive i f * The packing covers the range from dc (inclusive) to Nyquist (inclusive i f
* \f$n\f$ is even). * \f$n\f$ is even).
* For LALTimeFreqComplexFFT(), * For LALTimeFreqComplexFFT(),
* \f[ * \f[
* \tilde{h}_k = \Delta t \left\{ * \tilde{h}_k = \Delta t \left\{
* \begin{array}{ll} * \begin{array}{ll}
* H_{k+\lfloor(n+1)/2\rfloor} & * H_{k+\lfloor(n+1)/2\rfloor} &
* \mbox{for } 0\le k<\lfloor n/2\rfloor, \\ * \mbox{for } 0\le k<\lfloor n/2\rfloor, \\
* H_{k-\lfloor n/2\rfloor} & * H_{k-\lfloor n/2\rfloor} &
* \mbox{for } \lfloor n/2\rfloor\le k<n. \\ * \mbox{for } \lfloor n/2\rfloor\le k<n. \\
* \end{array} * \end{array}
* \right. * \right.
* \f] * \f]
* The packing covers the range from negative Nyquist (inclusive if \f$n\f$ is * The packing covers the range from negative Nyquist (inclusive if \f$n\f$ is
* even) up to (but not including) positive Nyquist. * even) up to (but not including) positive Nyquist.
* Here \f$H_k\f$ is the DFT of \f$h_j\f$: * Here \f$H_k\f$ is the DFT of \f$h_j\f$:
* \f[ * \f[
* H_k = \sum_{j=0}^{n-1} h_j e^{-2\pi ijk/n}. * H_k = \sum_{j=0}^{n-1} h_j e^{-2\pi ijk/n}.
* \f] * \f]
* The units of \f$\tilde{h}_k\f$ are equal to the units of \f$h_j\f$ times seconds. * The units of \f$\tilde{h}_k\f$ are equal to the units of \f$h_j\f$ times seconds.
* *
* The routines LALFreqTimeRealFFT() and LALFreqTimeComplexFFT() * The routines LALFreqTimeRealFFT() and LALFreqTimeComplexFFT()
* perform the inverse transforms from \f$\tilde{h}_k\f$ back to \f$h_j\f$. This is * perform the inverse transforms from \f$\tilde{h}_k\f$ back to \f$h_j\f$. This is
* done by shuffling the data, performing the reverse DFT, and multiplying by * done by shuffling the data, performing the reverse DFT, and multiplying by
* \f$\Delta f\f$. * \f$\Delta f\f$.
* *
* The routine LALREAL4AverageSpectrum() uses Welch's method to compute * The routine LALREAL4AverageSpectrum() uses Welch's method to compute
* the average power spectrum of the time series stored in the input struct ure * the average power spectrum of the time series stored in the input struct ure
skipping to change at line 121 skipping to change at line 121
* The PSD of each segment is obtained. The Welch PSD estimate is the avera ge * The PSD of each segment is obtained. The Welch PSD estimate is the avera ge
* of these \f$i\f$ sub-estimates. The average is computed using the mean or * of these \f$i\f$ sub-estimates. The average is computed using the mean or
* median method, as specified in the parameter structure. * median method, as specified in the parameter structure.
* *
* Note: the return PSD estimate is a one-sided power spectral density * Note: the return PSD estimate is a one-sided power spectral density
* normalized as defined in the conventions document. When the averaging * normalized as defined in the conventions document. When the averaging
* method is choosen to be mean and the window type Hann, the result is the * method is choosen to be mean and the window type Hann, the result is the
* same as returned by the LDAS datacondAPI <tt>psd()</tt> action for a rea l * same as returned by the LDAS datacondAPI <tt>psd()</tt> action for a rea l
* sequence without detrending. * sequence without detrending.
* *
* \heading{Operating Instructions} * ### Operating Instructions ###
* *
* \code * \code
* const UINT4 n = 65536; * const UINT4 n = 65536;
* const REAL4 dt = 1.0 / 16384.0; * const REAL4 dt = 1.0 / 16384.0;
* static LALStatus status; compute average power spectrum * static LALStatus status; compute average power spectrum
* static REAL4TimeSeries x; * static REAL4TimeSeries x;
* static COMPLEX8FrequencySeries X; * static COMPLEX8FrequencySeries X;
* static COMPLEX8TimeSeries z; * static COMPLEX8TimeSeries z;
* static COMPLEX8FrequencySeries Z; * static COMPLEX8FrequencySeries Z;
* RealFFTPlan *fwdRealPlan = NULL; * RealFFTPlan *fwdRealPlan = NULL;
skipping to change at line 172 skipping to change at line 172
* LALDestroyRealFFTPlan( &status, &fwdRealPlan ); * LALDestroyRealFFTPlan( &status, &fwdRealPlan );
* LALDestroyRealFFTPlan( &status, &revRealPlan ); * LALDestroyRealFFTPlan( &status, &revRealPlan );
* LALDestroyComplexFFTPlan( &status, &fwdComplexPlan ); * LALDestroyComplexFFTPlan( &status, &fwdComplexPlan );
* LALDestroyComplexFFTPlan( &status, &revComplexPlan ); * LALDestroyComplexFFTPlan( &status, &revComplexPlan );
* LALCDestroyVector( &status, &Z.data ); * LALCDestroyVector( &status, &Z.data );
* LALCDestroyVector( &status, &z.data ); * LALCDestroyVector( &status, &z.data );
* LALCDestroyVector( &status, &X.data ); * LALCDestroyVector( &status, &X.data );
* LALSDestroyVector( &status, &x.data ); * LALSDestroyVector( &status, &x.data );
* \endcode * \endcode
* *
* \heading{Notes} * ### Notes ###
* *
* <ol> * <ol>
* <li> The routines do not presently work properly with heterodyned data, * <li> The routines do not presently work properly with heterodyned data,
* i.e., the original time series data should have \c f0 equal to zero. * i.e., the original time series data should have \c f0 equal to zero.
* </li></ol> * </li></ol>
* *
* */
*
*/
/*@{*/ /*@{*/
/**\name Error Codes */ /**\name Error Codes */
/*@{*/ /*@{*/
#define TIMEFREQFFTH_ENULL 1 /**< Null pointer */ #define TIMEFREQFFTH_ENULL 1 /**< Null pointer */
#define TIMEFREQFFTH_ESIZE 2 /**< Invalid size */ #define TIMEFREQFFTH_ESIZE 2 /**< Invalid size */
#define TIMEFREQFFTH_ERATE 4 /**< Invalid rate */ #define TIMEFREQFFTH_ERATE 4 /**< Invalid rate */
#define TIMEFREQFFTH_ESIGN 4 /**< Incorrect plan sign */ #define TIMEFREQFFTH_ESIGN 4 /**< Incorrect plan sign */
#define TIMEFREQFFTH_EALLOC 16 /**< Pointer has already been allocated, sho uld be null */ #define TIMEFREQFFTH_EALLOC 16 /**< Pointer has already been allocated, sho uld be null */
#define TIMEFREQFFTH_EPOSARG 32 /**< Argument must be positive */ #define TIMEFREQFFTH_EPOSARG 32 /**< Argument must be positive */
skipping to change at line 217 skipping to change at line 215
#define TIMEFREQFFTH_MSGEPOSARG "Argument must be positive" #define TIMEFREQFFTH_MSGEPOSARG "Argument must be positive"
#define TIMEFREQFFTH_MSGEMALLOC "Malloc failure" #define TIMEFREQFFTH_MSGEMALLOC "Malloc failure"
#define TIMEFREQFFTH_MSGEINCOMP "Incompatible arguments" #define TIMEFREQFFTH_MSGEINCOMP "Incompatible arguments"
#define TIMEFREQFFTH_MSGENNUL "Non-null pointer" #define TIMEFREQFFTH_MSGENNUL "Non-null pointer"
#define TIMEFREQFFTH_MSGEZSEG "Segment length is zero" #define TIMEFREQFFTH_MSGEZSEG "Segment length is zero"
#define TIMEFREQFFTH_MSGEZOVR "Overlap length is zero" #define TIMEFREQFFTH_MSGEZOVR "Overlap length is zero"
#define TIMEFREQFFTH_MSGEMISM "Mismatch beteen segment, overlap and data le ngth" #define TIMEFREQFFTH_MSGEMISM "Mismatch beteen segment, overlap and data le ngth"
#define TIMEFREQFFTH_MSGEUAVG "Unknown average power spectum method" #define TIMEFREQFFTH_MSGEUAVG "Unknown average power spectum method"
/** \endcond */ /** \endcond */
/** This type determines the method the type of average that will be used t /**
o * This type determines the method the type of average that will be used to
* compute the power sperum estimate by the LALREAL4AverageSpectrum() * compute the power sperum estimate by the LALREAL4AverageSpectrum()
* function. The function computes a series of (possibly overlapping) power * function. The function computes a series of (possibly overlapping) power
* spectra and computes the average using one of the following methods. * spectra and computes the average using one of the following methods.
*/ */
typedef enum typedef enum
{ {
useUnity, /**< A constant PSD of value unity will be returned independ ent of the input data given; this is used for testing purposes */ useUnity, /**< A constant PSD of value unity will be returned independ ent of the input data given; this is used for testing purposes */
useMean, /**< The arithmetic mean of the individual power spectra com puted will be used to compute the output power spectrum */ useMean, /**< The arithmetic mean of the individual power spectra com puted will be used to compute the output power spectrum */
useMedian, /**< The median value of the individual power spectra comput ed will be used to compute the output power spectrum */ useMedian, /**< The median value of the individual power spectra comput ed will be used to compute the output power spectrum */
NumberAvgSpecMethods /**< gives the number of defined methods */ NumberAvgSpecMethods /**< gives the number of defined methods */
} }
AvgSpecMethod; AvgSpecMethod;
/** This structure controls the behaviour of the LALREAL4AverageSpectrum() /**
function. * This structure controls the behaviour of the LALREAL4AverageSpectrum() f
unction.
*/ */
typedef struct typedef struct
tagAverageSpectrumParams tagAverageSpectrumParams
{ {
REAL4Window *window; /**< The windowing function to use w hen computing the individual power spectra from the input time series. REAL4Window *window; /**< The windowing function to use w hen computing the individual power spectra from the input time series.
* The input time series is broken into sma ller time series to compute power spectra * The input time series is broken into sma ller time series to compute power spectra
* for the estimate. The length of these ti me series is determined by the \c length parameter of the window vector. * for the estimate. The length of these ti me series is determined by the \c length parameter of the window vector.
*/ */
UINT4 overlap; /**< The overlap between sucessive time se ries used to compute the power spectra. */ UINT4 overlap; /**< The overlap between sucessive time se ries used to compute the power spectra. */
AvgSpecMethod method; /**< The method of computing the ave rage as describe under ::AvgSpecMethod */ AvgSpecMethod method; /**< The method of computing the ave rage as describe under ::AvgSpecMethod */
 End of changes. 11 change blocks. 
24 lines changed or deleted 23 lines changed or added


 TimeSeries.h   TimeSeries.h 
skipping to change at line 32 skipping to change at line 32
#include <stddef.h> #include <stddef.h>
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** \addtogroup TimeSeriesManipulation /**
\author Kipp Cannon <kipp@gravity.phys.uwm.edu> * \addtogroup TimeSeriesManipulation
* \author Kipp Cannon <kipp@gravity.phys.uwm.edu>
\brief This is a suite of functions for creating, destroying, and manipulat *
ing LAL * \brief This is a suite of functions for creating, destroying, and manipu
time series. One pair of functions (the XLAL version and its LAL lating LAL
counterpart) is available for each method and series type. For example * time series. One pair of functions (the XLAL version and its LAL
<tt>XLALCreateREAL4TimeSeries()</tt> is available for creating time series * counterpart) is available for each method and series type. For example
of \c REAL4 data, and the LAL-stype wrapper * <tt>XLALCreateREAL4TimeSeries()</tt> is available for creating time seri
<tt>LALCreateREAL4TimeSeries()</tt> is provided which is equivalent to the es
XLAL version in all respects except that it adheres to the LAL calling * of \c REAL4 data, and the LAL-stype wrapper
conventions (eg.\ it takes a \c LALStatus pointer as its first * <tt>LALCreateREAL4TimeSeries()</tt> is provided which is equivalent to t
argument, its return type is \c void, etc.). he
* XLAL version in all respects except that it adheres to the LAL calling
*/ * conventions (eg.\ it takes a \c LALStatus pointer as its first
/*@{*/ * argument, its return type is \c void, etc.).
*
/** \name Creation Functions */
/*@{*/
\heading{Synopsis}
/**
\code * \name Creation Functions
#include <lal/TimeSeries.h> *
* ### Synopsis ###
XLALCreate<timeseriestype>() *
LALCreate<timeseriestype>() * \code
\endcode * #include <lal/TimeSeries.h>
*
\heading{Description} * XLALCreate<timeseriestype>()
* LALCreate<timeseriestype>()
These functions create LAL frequency series. An XLAL function returns a * \endcode
pointer to the newly created series or \c NULL on failure. The LAL *
counterpart accepts the address of a pointer which it fills with the * ### Description ###
address of the newly created series or \c NULL on failure. *
Additionally, the LAL wrapper provides standard LAL-style error checking * These functions create LAL frequency series. An XLAL function returns a
via a \c LALStatus pointer. * pointer to the newly created series or \c NULL on failure. The LAL
*/ * counterpart accepts the address of a pointer which it fills with the
* address of the newly created series or \c NULL on failure.
* Additionally, the LAL wrapper provides standard LAL-style error checking
* via a \c LALStatus pointer.
*/
/*@{*/ /*@{*/
COMPLEX8TimeSeries *XLALCreateCOMPLEX8TimeSeries ( const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, siz e_t length ); COMPLEX8TimeSeries *XLALCreateCOMPLEX8TimeSeries ( const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, siz e_t length );
COMPLEX16TimeSeries *XLALCreateCOMPLEX16TimeSeries ( const CHAR *name, cons t LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, s ize_t length ); COMPLEX16TimeSeries *XLALCreateCOMPLEX16TimeSeries ( const CHAR *name, cons t LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, s ize_t length );
REAL4TimeSeries *XLALCreateREAL4TimeSeries ( const CHAR *name, const LIGOTi meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le ngth ); REAL4TimeSeries *XLALCreateREAL4TimeSeries ( const CHAR *name, const LIGOTi meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le ngth );
REAL8TimeSeries *XLALCreateREAL8TimeSeries ( const CHAR *name, const LIGOTi meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le ngth ); REAL8TimeSeries *XLALCreateREAL8TimeSeries ( const CHAR *name, const LIGOTi meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le ngth );
INT2TimeSeries *XLALCreateINT2TimeSeries ( const CHAR *name, const LIGOTime GPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t leng th ); INT2TimeSeries *XLALCreateINT2TimeSeries ( const CHAR *name, const LIGOTime GPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t leng th );
INT4TimeSeries *XLALCreateINT4TimeSeries ( const CHAR *name, const LIGOTime GPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t leng th ); INT4TimeSeries *XLALCreateINT4TimeSeries ( const CHAR *name, const LIGOTime GPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t leng th );
INT8TimeSeries *XLALCreateINT8TimeSeries ( const CHAR *name, const LIGOTime GPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t leng th ); INT8TimeSeries *XLALCreateINT8TimeSeries ( const CHAR *name, const LIGOTime GPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t leng th );
UINT2TimeSeries *XLALCreateUINT2TimeSeries ( const CHAR *name, const LIGOTi meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le ngth ); UINT2TimeSeries *XLALCreateUINT2TimeSeries ( const CHAR *name, const LIGOTi meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le ngth );
UINT4TimeSeries *XLALCreateUINT4TimeSeries ( const CHAR *name, const LIGOTi meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le ngth ); UINT4TimeSeries *XLALCreateUINT4TimeSeries ( const CHAR *name, const LIGOTi meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le ngth );
UINT8TimeSeries *XLALCreateUINT8TimeSeries ( const CHAR *name, const LIGOTi meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le ngth ); UINT8TimeSeries *XLALCreateUINT8TimeSeries ( const CHAR *name, const LIGOTi meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le ngth );
/*@}*/ /*@}*/
/** \name Destruction Functions /**
* \name Destruction Functions
\heading{Synopsis} *
\code * ### Synopsis ###
#include <lal/TimeSeries.h> *
* \code
XLALDestroy<timeseriestype>() * #include <lal/TimeSeries.h>
LALDestroy<timeseriestype>() *
\endcode * XLALDestroy<timeseriestype>()
* LALDestroy<timeseriestype>()
\heading{Description} * \endcode
*
These functions free all memory associated with a LAL time series. It is * ### Description ###
safe to pass \c NULL to these functions. *
* These functions free all memory associated with a LAL time series. It i
*/ s
* safe to pass \c NULL to these functions.
*
*/
/*@{*/ /*@{*/
void XLALDestroyCOMPLEX8TimeSeries ( COMPLEX8TimeSeries *series ); void XLALDestroyCOMPLEX8TimeSeries ( COMPLEX8TimeSeries *series );
void XLALDestroyCOMPLEX16TimeSeries ( COMPLEX16TimeSeries *series ); void XLALDestroyCOMPLEX16TimeSeries ( COMPLEX16TimeSeries *series );
void XLALDestroyREAL4TimeSeries ( REAL4TimeSeries *series ); void XLALDestroyREAL4TimeSeries ( REAL4TimeSeries *series );
void XLALDestroyREAL8TimeSeries ( REAL8TimeSeries *series ); void XLALDestroyREAL8TimeSeries ( REAL8TimeSeries *series );
void XLALDestroyINT2TimeSeries ( INT2TimeSeries *series ); void XLALDestroyINT2TimeSeries ( INT2TimeSeries *series );
void XLALDestroyINT4TimeSeries ( INT4TimeSeries *series ); void XLALDestroyINT4TimeSeries ( INT4TimeSeries *series );
void XLALDestroyINT8TimeSeries ( INT8TimeSeries *series ); void XLALDestroyINT8TimeSeries ( INT8TimeSeries *series );
void XLALDestroyUINT2TimeSeries ( UINT2TimeSeries *series ); void XLALDestroyUINT2TimeSeries ( UINT2TimeSeries *series );
void XLALDestroyUINT4TimeSeries ( UINT4TimeSeries *series ); void XLALDestroyUINT4TimeSeries ( UINT4TimeSeries *series );
void XLALDestroyUINT8TimeSeries ( UINT8TimeSeries *series ); void XLALDestroyUINT8TimeSeries ( UINT8TimeSeries *series );
/*@}*/ /*@}*/
/** \name Cutting Functions /**
* \name Cutting Functions
\heading{Synopsis} *
* ### Synopsis ###
\code *
#include <lal/TimeSeries.h> * \code
* #include <lal/TimeSeries.h>
XLALCut<timeseriestype>() *
LALCut<timeseriestype>() * XLALCut<timeseriestype>()
\endcode * LALCut<timeseriestype>()
* \endcode
\heading{Description} *
* ### Description ###
These functions create a new time series by extracting a section of an *
existing time series. * These functions create a new time series by extracting a section of an
*/ * existing time series.
*/
/*@{*/ /*@{*/
COMPLEX8TimeSeries *XLALCutCOMPLEX8TimeSeries ( const COMPLEX8TimeSeries *s eries, size_t first, size_t length ); COMPLEX8TimeSeries *XLALCutCOMPLEX8TimeSeries ( const COMPLEX8TimeSeries *s eries, size_t first, size_t length );
COMPLEX16TimeSeries *XLALCutCOMPLEX16TimeSeries ( const COMPLEX16TimeSeries *series, size_t first, size_t length ); COMPLEX16TimeSeries *XLALCutCOMPLEX16TimeSeries ( const COMPLEX16TimeSeries *series, size_t first, size_t length );
REAL4TimeSeries *XLALCutREAL4TimeSeries ( const REAL4TimeSeries *series, si ze_t first, size_t length ); REAL4TimeSeries *XLALCutREAL4TimeSeries ( const REAL4TimeSeries *series, si ze_t first, size_t length );
REAL8TimeSeries *XLALCutREAL8TimeSeries ( const REAL8TimeSeries *series, si ze_t first, size_t length ); REAL8TimeSeries *XLALCutREAL8TimeSeries ( const REAL8TimeSeries *series, si ze_t first, size_t length );
INT2TimeSeries *XLALCutINT2TimeSeries ( const INT2TimeSeries *series, size_ t first, size_t length ); INT2TimeSeries *XLALCutINT2TimeSeries ( const INT2TimeSeries *series, size_ t first, size_t length );
INT4TimeSeries *XLALCutINT4TimeSeries ( const INT4TimeSeries *series, size_ t first, size_t length ); INT4TimeSeries *XLALCutINT4TimeSeries ( const INT4TimeSeries *series, size_ t first, size_t length );
INT8TimeSeries *XLALCutINT8TimeSeries ( const INT8TimeSeries *series, size_ t first, size_t length ); INT8TimeSeries *XLALCutINT8TimeSeries ( const INT8TimeSeries *series, size_ t first, size_t length );
UINT2TimeSeries *XLALCutUINT2TimeSeries ( const UINT2TimeSeries *series, si ze_t first, size_t length ); UINT2TimeSeries *XLALCutUINT2TimeSeries ( const UINT2TimeSeries *series, si ze_t first, size_t length );
UINT4TimeSeries *XLALCutUINT4TimeSeries ( const UINT4TimeSeries *series, si ze_t first, size_t length ); UINT4TimeSeries *XLALCutUINT4TimeSeries ( const UINT4TimeSeries *series, si ze_t first, size_t length );
UINT8TimeSeries *XLALCutUINT8TimeSeries ( const UINT8TimeSeries *series, si ze_t first, size_t length ); UINT8TimeSeries *XLALCutUINT8TimeSeries ( const UINT8TimeSeries *series, si ze_t first, size_t length );
/*@}*/ /*@}*/
/** \name Resizing Functions /**
* \name Resizing Functions
\heading{Synopsis} *
* ### Synopsis ###
\code *
#include <lal/TimeSeries.h> * \code
* #include <lal/TimeSeries.h>
XLALResize<timeseriestype>() *
LALResize<timeseriestype>() * XLALResize<timeseriestype>()
XLALShrink<timeseriestype>() * LALResize<timeseriestype>()
LALShrink<timeseriestype>() * XLALShrink<timeseriestype>()
\endcode * LALShrink<timeseriestype>()
* \endcode
\heading{Description} *
* ### Description ###
These functions resize an existing time series. The new time series will *
have the given length, and its contents will consist of that part of the * These functions resize an existing time series. The new time series wil
original time series that started at sample first. If first is negative, l
then the new time series is padded at the start by that many samples. The * have the given length, and its contents will consist of that part of the
time series' epoch is adjusted appropriately. * original time series that started at sample first. If first is negative
*/ ,
* then the new time series is padded at the start by that many samples. T
he
* time series' epoch is adjusted appropriately.
*/
/*@{*/ /*@{*/
COMPLEX8TimeSeries *XLALResizeCOMPLEX8TimeSeries ( COMPLEX8TimeSeries *seri es, int first, size_t length ); COMPLEX8TimeSeries *XLALResizeCOMPLEX8TimeSeries ( COMPLEX8TimeSeries *seri es, int first, size_t length );
COMPLEX16TimeSeries *XLALResizeCOMPLEX16TimeSeries ( COMPLEX16TimeSeries *s eries, int first, size_t length ); COMPLEX16TimeSeries *XLALResizeCOMPLEX16TimeSeries ( COMPLEX16TimeSeries *s eries, int first, size_t length );
REAL4TimeSeries *XLALResizeREAL4TimeSeries ( REAL4TimeSeries *series, int f irst, size_t length ); REAL4TimeSeries *XLALResizeREAL4TimeSeries ( REAL4TimeSeries *series, int f irst, size_t length );
REAL8TimeSeries *XLALResizeREAL8TimeSeries ( REAL8TimeSeries *series, int f irst, size_t length ); REAL8TimeSeries *XLALResizeREAL8TimeSeries ( REAL8TimeSeries *series, int f irst, size_t length );
INT2TimeSeries *XLALResizeINT2TimeSeries ( INT2TimeSeries *series, int firs t, size_t length ); INT2TimeSeries *XLALResizeINT2TimeSeries ( INT2TimeSeries *series, int firs t, size_t length );
INT4TimeSeries *XLALResizeINT4TimeSeries ( INT4TimeSeries *series, int firs t, size_t length ); INT4TimeSeries *XLALResizeINT4TimeSeries ( INT4TimeSeries *series, int firs t, size_t length );
INT8TimeSeries *XLALResizeINT8TimeSeries ( INT8TimeSeries *series, int firs t, size_t length ); INT8TimeSeries *XLALResizeINT8TimeSeries ( INT8TimeSeries *series, int firs t, size_t length );
UINT2TimeSeries *XLALResizeUINT2TimeSeries ( UINT2TimeSeries *series, int f irst, size_t length ); UINT2TimeSeries *XLALResizeUINT2TimeSeries ( UINT2TimeSeries *series, int f irst, size_t length );
UINT4TimeSeries *XLALResizeUINT4TimeSeries ( UINT4TimeSeries *series, int f irst, size_t length ); UINT4TimeSeries *XLALResizeUINT4TimeSeries ( UINT4TimeSeries *series, int f irst, size_t length );
skipping to change at line 184 skipping to change at line 190
REAL4TimeSeries *XLALShrinkREAL4TimeSeries ( REAL4TimeSeries *series, size_ t first, size_t length ); REAL4TimeSeries *XLALShrinkREAL4TimeSeries ( REAL4TimeSeries *series, size_ t first, size_t length );
REAL8TimeSeries *XLALShrinkREAL8TimeSeries ( REAL8TimeSeries *series, size_ t first, size_t length ); REAL8TimeSeries *XLALShrinkREAL8TimeSeries ( REAL8TimeSeries *series, size_ t first, size_t length );
INT2TimeSeries *XLALShrinkINT2TimeSeries ( INT2TimeSeries *series, size_t f irst, size_t length ); INT2TimeSeries *XLALShrinkINT2TimeSeries ( INT2TimeSeries *series, size_t f irst, size_t length );
INT4TimeSeries *XLALShrinkINT4TimeSeries ( INT4TimeSeries *series, size_t f irst, size_t length ); INT4TimeSeries *XLALShrinkINT4TimeSeries ( INT4TimeSeries *series, size_t f irst, size_t length );
INT8TimeSeries *XLALShrinkINT8TimeSeries ( INT8TimeSeries *series, size_t f irst, size_t length ); INT8TimeSeries *XLALShrinkINT8TimeSeries ( INT8TimeSeries *series, size_t f irst, size_t length );
UINT2TimeSeries *XLALShrinkUINT2TimeSeries ( UINT2TimeSeries *series, size_ t first, size_t length ); UINT2TimeSeries *XLALShrinkUINT2TimeSeries ( UINT2TimeSeries *series, size_ t first, size_t length );
UINT4TimeSeries *XLALShrinkUINT4TimeSeries ( UINT4TimeSeries *series, size_ t first, size_t length ); UINT4TimeSeries *XLALShrinkUINT4TimeSeries ( UINT4TimeSeries *series, size_ t first, size_t length );
UINT8TimeSeries *XLALShrinkUINT8TimeSeries ( UINT8TimeSeries *series, size_ t first, size_t length ); UINT8TimeSeries *XLALShrinkUINT8TimeSeries ( UINT8TimeSeries *series, size_ t first, size_t length );
/*@}*/ /*@}*/
/** \name Addition Functions /**
* \name Addition Functions
\heading{Synopsis} *
\code * ### Synopsis ###
#include <lal/TimeSeries.h> *
* \code
XLALAdd<timeseriestype>() * #include <lal/TimeSeries.h>
\endcode *
* XLALAdd<timeseriestype>()
\heading{Description} * \endcode
*
These functions add the second argument to the first argument, returning a * ### Description ###
pointer to the first argument on success or NULL on failure. The two *
series must have the same heterodyne frequency and time resolution, and * These functions add the second argument to the first argument, returning
have units that differ only by a dimensionless factor. a
* pointer to the first argument on success or NULL on failure. The two
*/ * series must have the same heterodyne frequency and time resolution, and
* have units that differ only by a dimensionless factor.
*
*/
/*@{*/ /*@{*/
COMPLEX8TimeSeries *XLALAddCOMPLEX8TimeSeries ( COMPLEX8TimeSeries *arg1, c onst COMPLEX8TimeSeries *arg2 ); COMPLEX8TimeSeries *XLALAddCOMPLEX8TimeSeries ( COMPLEX8TimeSeries *arg1, c onst COMPLEX8TimeSeries *arg2 );
COMPLEX16TimeSeries *XLALAddCOMPLEX16TimeSeries ( COMPLEX16TimeSeries *arg1 , const COMPLEX16TimeSeries *arg2 ); COMPLEX16TimeSeries *XLALAddCOMPLEX16TimeSeries ( COMPLEX16TimeSeries *arg1 , const COMPLEX16TimeSeries *arg2 );
REAL4TimeSeries *XLALAddREAL4TimeSeries ( REAL4TimeSeries *arg1, const REAL 4TimeSeries *arg2 ); REAL4TimeSeries *XLALAddREAL4TimeSeries ( REAL4TimeSeries *arg1, const REAL 4TimeSeries *arg2 );
REAL8TimeSeries *XLALAddREAL8TimeSeries ( REAL8TimeSeries *arg1, const REAL 8TimeSeries *arg2 ); REAL8TimeSeries *XLALAddREAL8TimeSeries ( REAL8TimeSeries *arg1, const REAL 8TimeSeries *arg2 );
INT2TimeSeries *XLALAddINT2TimeSeries ( INT2TimeSeries *arg1, const INT2Tim eSeries *arg2 ); INT2TimeSeries *XLALAddINT2TimeSeries ( INT2TimeSeries *arg1, const INT2Tim eSeries *arg2 );
INT4TimeSeries *XLALAddINT4TimeSeries ( INT4TimeSeries *arg1, const INT4Tim eSeries *arg2 ); INT4TimeSeries *XLALAddINT4TimeSeries ( INT4TimeSeries *arg1, const INT4Tim eSeries *arg2 );
INT8TimeSeries *XLALAddINT8TimeSeries ( INT8TimeSeries *arg1, const INT8Tim eSeries *arg2 ); INT8TimeSeries *XLALAddINT8TimeSeries ( INT8TimeSeries *arg1, const INT8Tim eSeries *arg2 );
UINT2TimeSeries *XLALAddUINT2TimeSeries ( UINT2TimeSeries *arg1, const UINT 2TimeSeries *arg2 ); UINT2TimeSeries *XLALAddUINT2TimeSeries ( UINT2TimeSeries *arg1, const UINT 2TimeSeries *arg2 );
UINT4TimeSeries *XLALAddUINT4TimeSeries ( UINT4TimeSeries *arg1, const UINT 4TimeSeries *arg2 ); UINT4TimeSeries *XLALAddUINT4TimeSeries ( UINT4TimeSeries *arg1, const UINT 4TimeSeries *arg2 );
 End of changes. 5 change blocks. 
107 lines changed or deleted 122 lines changed or added


 TriggerInterpolation.h   TriggerInterpolation.h 
skipping to change at line 22 skipping to change at line 22
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with with program; see the file COPYING. If not, write to the * along with with program; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA * MA 02111-1307 USA
* *
* Copyright (C) 2012 Leo Singer * Copyright (C) 2012 Leo Singer
*/ */
#include <complex.h>
#include <lal/LALAtomicDatatypes.h> #include <lal/LALAtomicDatatypes.h>
#ifndef _TRIGGERINTERPOLATION_H #ifndef _TRIGGERINTERPOLATION_H
#define _TRIGGERINTERPOLATION_H #define _TRIGGERINTERPOLATION_H
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
skipping to change at line 45 skipping to change at line 44
* This module implements several algorithms for performing sub-sample * This module implements several algorithms for performing sub-sample
* interpolation of peaks in the output of a matched filter. The interface for * interpolation of peaks in the output of a matched filter. The interface for
* each algorithm is the same. To illustrate, here is a description of the * each algorithm is the same. To illustrate, here is a description of the
* interface for the 'Lanczos' algorithm. * interface for the 'Lanczos' algorithm.
* *
* There is an opaque data type called \c LanczosTriggerInterpolant that ho lds * There is an opaque data type called \c LanczosTriggerInterpolant that ho lds
* workspaces for performing the interpolation. To create one, call the * workspaces for performing the interpolation. To create one, call the
* function \c XLALCreateLanczosTriggerInterpolant as follows: * function \c XLALCreateLanczosTriggerInterpolant as follows:
* *
* \code{.c} * \code{.c}
* LanczosTriggerInterpolant *interp = XLALCreateLanczosTriggerInterpola nt(5); * LanczosTriggerInterpolant *interp = XLALCreateLanczosTriggerInterpolant( 5);
* \endcode * \endcode
* *
* The '5' is the interpolation window. In this example, the interpolation will * The '5' is the interpolation window. In this example, the interpolation will
* take into account a given sample, the 5 samples before, and the 5 sample s * take into account a given sample, the 5 samples before, and the 5 sample s
* after, for a total of 11 samples. * after, for a total of 11 samples.
* *
* To apply the interpolant to a time series, call * To apply the interpolant to a time series, call
* \c XLALApplyLanczosTriggerInterpolant. It is requried that |y[0]| >= |y[ i]| * \c XLALApplyLanczosTriggerInterpolant. It is requried that |y[0]| >= |y[ i]|
* for all i from -\c window to +\c window. Suppose that you have a complex * for all i from -\c window to +\c window. Suppose that you have a complex
* array \c y: * array \c y:
* *
* \code{.c} * \code{.c}
* COMPLEX16 y[] = {...}; * COMPLEX16 y[] = {...};
* \endcode * \endcode
* *
* and suppose that the maximum of |y[i]| occurs at i = 8. * and suppose that the maximum of |y[i]| occurs at i = 8.
* To interpolate the time and complex value at which the maximum occurs, d o * To interpolate the time and complex value at which the maximum occurs, d o
* the following: * the following:
* *
* \code{.c} * \code{.c}
* double tmax; * double tmax;
* COMPLEX16 ymax; * COMPLEX16 ymax;
* int result = XLALApplyLanczosTriggerInterpolant(interp, &tmax, &ymax, * int result = XLALApplyLanczosTriggerInterpolant(interp, &tmax, &ymax, &y
&y[8]); [8]);
* \endcode * \endcode
* *
* Upon success, the return value of \c XLALApplyLanczosTriggerInterpolant is * Upon success, the return value of \c XLALApplyLanczosTriggerInterpolant is
* zero, the interpolated index of the maximum sample is 8 + \c *tmax, and the * zero, the interpolated index of the maximum sample is 8 + \c *tmax, and the
* interpolated value is in \c ymax. Upon failure, the return value is nonz ero * interpolated value is in \c ymax. Upon failure, the return value is nonz ero
* and neither \c *tmax nor \c *ymax are modified. * and neither \c *tmax nor \c *ymax are modified.
* *
* When you are done, release all of the workspace resources associated wit h * When you are done, release all of the workspace resources associated wit h
* the interpolant with: * the interpolant with:
* *
* \code{.c} * \code{.c}
* XLALDestroyLanczosTriggerInterpolant(interp); * XLALDestroyLanczosTriggerInterpolant(interp);
* \endcode * \endcode
* *
*
* \addtogroup TriggerInterpolation * \addtogroup TriggerInterpolation
* \{ * \{
*/ */
/** /**
* Catmull-Rom cubic spline interpolation * Catmull-Rom cubic spline interpolation
* *
* Find the Catmull-Rom cubic spline interpolants that pass through the rea l and * Find the Catmull-Rom cubic spline interpolants that pass through the rea l and
* imaginary parts of the data. Find the interpolated time by solving for t he * imaginary parts of the data. Find the interpolated time by solving for t he
* maximum of the sum of the squares of the two spline interpolants. * maximum of the sum of the squares of the two spline interpolants.
 End of changes. 6 change blocks. 
9 lines changed or deleted 7 lines changed or added


 Units.h   Units.h 
skipping to change at line 29 skipping to change at line 29
#ifndef _UNITS_H #ifndef _UNITS_H
#define _UNITS_H #define _UNITS_H
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** \addtogroup Units_h /**
\author J. T. Whelan <john.whelan@ligo.org> * \addtogroup Units_h
* \author J. T. Whelan <john.whelan@ligo.org>
\brief Provides prototypes for manipulation of units and declares *
\c extern constants for the basic and derived SI units. * \brief Provides prototypes for manipulation of units and declares
* \c extern constants for the basic and derived SI units.
\heading{Synopsis} *
\code * ### Synopsis ###
#include <lal/Units.h> *
\endcode * \code
* #include <lal/Units.h>
This header provides prototypes for functions to manipulate * \endcode
the \c LALUnit structure. It also defines \c extern *
constants for a set of predefined units, which are designed to make * This header provides prototypes for functions to manipulate
the structure easier to use. For instance, to determine whether a * the \c LALUnit structure. It also defines \c extern
quantity has units of strain per root hertz, one constructs the unit * constants for a set of predefined units, which are designed to make
&quot;strain per root hertz&quot; from the predefined \c lalStrainUnit and * the structure easier to use. For instance, to determine whether a
\c lalHertzUnit constant structures using the * quantity has units of strain per root hertz, one constructs the unit
LALUnitRaise() and LALUnitMultiply() functions, then * &quot;strain per root hertz&quot; from the predefined \c lalStrainUnit a
compares that to the unit structure in question using the nd
LALUnitCompare() function. * \c lalHertzUnit constant structures using the
* LALUnitRaise() and LALUnitMultiply() functions, then
The LALUnit datatype itself is included in the header * compares that to the unit structure in question using the
\ref LALDatatypes.h, and defines a unit in terms of an integer * LALUnitCompare() function.
power of ten multiplier along with rational powers of the basic SI *
units (meters, kilograms, seconds, Amperes, and Kelvins) and two * The LALUnit datatype itself is included in the header
custom units (strain and ADC counts). * \ref LALDatatypes.h, and defines a unit in terms of an integer
* power of ten multiplier along with rational powers of the basic SI
\heading{XLAL interface to Units.h functions} * units (meters, kilograms, seconds, Amperes, and Kelvins) and two
* custom units (strain and ADC counts).
XLALUnitAsString() converts a ::LALUnit structure into a character *
string of maximum length \c length (including NUL termination) * ### XLAL interface to Units.h functions ###
representation of the units. The inverse function, XLALParseUnitString() *
parses a character string to produce a \c LALUnit structure; if * XLALUnitAsString() converts a ::LALUnit structure into a character
\c output is \c NULL, memory for the output is allocated. If the input * string of maximum length \c length (including NUL termination)
\c string is \c NULL or is empty then the output units are * representation of the units. The inverse function, XLALParseUnitString(
dimensionless: lalDimensionlessUnit. )
* parses a character string to produce a \c LALUnit structure; if
XLALUnitNormalize() puts a ::LALUnit structure into normal form * \c output is \c NULL, memory for the output is allocated. If the input
by simplifying all unit exponent fractions to their simplest form. * \c string is \c NULL or is empty then the output units are
* dimensionless: lalDimensionlessUnit.
XLALUnitCompare() compares two ::LALUnit structures: they are the *
same if their normal forms are identical. * XLALUnitNormalize() puts a ::LALUnit structure into normal form
* by simplifying all unit exponent fractions to their simplest form.
XLALUnitMultiply() multiplies two ::LALUnit structures. The result *
is put into normal form. * XLALUnitCompare() compares two ::LALUnit structures: they are the
* same if their normal forms are identical.
XLALUnitRaiseRAT4() raises a ::LALUnit structure to a rational *
power given by the ::RAT4 structure \c power. * XLALUnitMultiply() multiplies two ::LALUnit structures. The result
XLALUnitRaiseINT2() raises a ::LALUnit structure to an integer * is put into normal form.
power \c power. *
XLALUnitSquare() produces the square of a ::LALUnit structure. * XLALUnitRaiseRAT4() raises a ::LALUnit structure to a rational
XLALUnitSqrt() produces the square-root of a ::LALUnit structure. * power given by the ::RAT4 structure \c power.
* XLALUnitRaiseINT2() raises a ::LALUnit structure to an integer
\heading{Return Values} * power \c power.
* XLALUnitSquare() produces the square of a ::LALUnit structure.
XLALUnitAsString() returns the pointer to the input \c string, which * XLALUnitSqrt() produces the square-root of a ::LALUnit structure.
is populated with the unit string if successful. If there is a failure, *
XLALUnitAsString() returns a \c NULL pointer and \c ::xlalErrno * ### Return Values ###
is set to one of the following values: \c #XLAL_EFAULT if one of the *
input pointers is \c NULL or \c #XLAL_EBADLEN if the length of the * XLALUnitAsString() returns the pointer to the input \c string, which
string is insufficent for the unit string. * is populated with the unit string if successful. If there is a failure,
* XLALUnitAsString() returns a \c NULL pointer and \c ::xlalErrno
XLALParseUnitString() returns the pointer \c output upon return * is set to one of the following values: \c #XLAL_EFAULT if one of the
or a pointer to newly allocated memory if \c output was \c NULL; * input pointers is \c NULL or \c #XLAL_EBADLEN if the length of the
on failure, \c XLALParseUnitString returns \c NULL and sets * string is insufficent for the unit string.
\c ::xlalErrno to one of the following values: \c #XLAL_ENOMEM *
if the routine was unable to allocate memory for the output or * XLALParseUnitString() returns the pointer \c output upon return
\c #XLAL_EFAILED if the routine was unable to parse the unit string. * or a pointer to newly allocated memory if \c output was \c NULL;
* on failure, \c XLALParseUnitString returns \c NULL and sets
XLALUnitNormalize() returns 0 upon success or \c #XLAL_FAILURE * \c ::xlalErrno to one of the following values: \c #XLAL_ENOMEM
if the input pointer is \c NULL, in which case \c xlalErrno * if the routine was unable to allocate memory for the output or
is set to \c #XLAL_EFAULT * \c #XLAL_EFAILED if the routine was unable to parse the unit string.
*
XLALUnitCompare() returns 0 if the the normal form of the two unit * XLALUnitNormalize() returns 0 upon success or \c #XLAL_FAILURE
structures are the same or \> 0 if they are different. It returns * if the input pointer is \c NULL, in which case \c xlalErrno
\c #XLAL_FAILURE and \c ::xlalErrno is set to \c #XLAL_EFAULT if * is set to \c #XLAL_EFAULT
one of the input pointers is \c NULL. *
* XLALUnitCompare() returns 0 if the the normal form of the two unit
XLALUnitMultiply(), XLALUnitRaiseRAT4(), XLALUnitRaiseINT2(), XLALUnitSquar * structures are the same or \> 0 if they are different. It returns
e() and * \c #XLAL_FAILURE and \c ::xlalErrno is set to \c #XLAL_EFAULT if
XLALUnitSqrt() all return a pointer to the output unit structure * one of the input pointers is \c NULL.
\c output upon success or \c NULL upon failure. If there is *
a failure, \c ::xlalErrno is set to one of the following values: * XLALUnitMultiply(), XLALUnitRaiseRAT4(), XLALUnitRaiseINT2(), XLALUnitSq
\c #XLAL_EFAULT if one of the input pointers is \c NULL, uare() and
\c #XLAL_ERANGE if one of the unit powers exceeds the allowed range, * XLALUnitSqrt() all return a pointer to the output unit structure
or \c #XLAL_EINVAL (for the raise functions only) if the unit power * \c output upon success or \c NULL upon failure. If there is
would not be an integer. * a failure, \c ::xlalErrno is set to one of the following values:
* \c #XLAL_EFAULT if one of the input pointers is \c NULL,
@{ * \c #XLAL_ERANGE if one of the unit powers exceeds the allowed range,
\defgroup UnitDefs_c Module UnitDefs.c * or \c #XLAL_EINVAL (for the raise functions only) if the unit power
\defgroup UnitNormalize_c Module UnitNormalize.c * would not be an integer.
\defgroup UnitRaise_c Module UnitRaise.c *
\defgroup UnitMultiply_c Module UnitMultiply.c * @{
\defgroup UnitCompare_c Module UnitCompare.c * \defgroup UnitDefs_c Module UnitDefs.c
@} * \defgroup UnitNormalize_c Module UnitNormalize.c
*/ * \defgroup UnitRaise_c Module UnitRaise.c
* \defgroup UnitMultiply_c Module UnitMultiply.c
* \defgroup UnitCompare_c Module UnitCompare.c
* @}
*/
/*@{*/ /*@{*/
/** \name Error Codes */ /** \name Error Codes */
/*@{*/ /*@{*/
#define UNITSH_ENULLPIN 1 /**< Null pointer to input */ #define UNITSH_ENULLPIN 1 /**< Null pointer to input */
#define UNITSH_ENULLPOUT 2 /**< Null pointer to output */ #define UNITSH_ENULLPOUT 2 /**< Null pointer to output */
#define UNITSH_ENULLPD 3 /**< Null pointer to data member of vector */ #define UNITSH_ENULLPD 3 /**< Null pointer to data member of vector */
#define UNITSH_ENULLPPARAM 4 /**< Null pointer to parameters */ #define UNITSH_ENULLPPARAM 4 /**< Null pointer to parameters */
#define UNITSH_ESTRINGSIZE 5 /**< Output string too short */ #define UNITSH_ESTRINGSIZE 5 /**< Output string too short */
#define UNITSH_EOVERFLOW 6 /**< Exponent outside of (U)INT2 bou nds */ #define UNITSH_EOVERFLOW 6 /**< Exponent outside of (U)INT2 bou nds */
skipping to change at line 150 skipping to change at line 152
#define UNITSH_MSGENULLPIN "Null pointer to input" #define UNITSH_MSGENULLPIN "Null pointer to input"
#define UNITSH_MSGENULLPOUT "Null pointer to output" #define UNITSH_MSGENULLPOUT "Null pointer to output"
#define UNITSH_MSGENULLPD "Null pointer to data member of vector" #define UNITSH_MSGENULLPD "Null pointer to data member of vector"
#define UNITSH_MSGENULLPPARAM "Null pointer to parameters" #define UNITSH_MSGENULLPPARAM "Null pointer to parameters"
#define UNITSH_MSGESTRINGSIZE "Output string too short" #define UNITSH_MSGESTRINGSIZE "Output string too short"
#define UNITSH_MSGEOVERFLOW "Exponent outside of (U)INT2 bounds" #define UNITSH_MSGEOVERFLOW "Exponent outside of (U)INT2 bounds"
#define UNITSH_MSGENONINT "Non-integer power of ten" #define UNITSH_MSGENONINT "Non-integer power of ten"
#define UNITSH_MSGEPARSE "Error parsing unit string" #define UNITSH_MSGEPARSE "Error parsing unit string"
/** \endcond */ /** \endcond */
/** A four-byte rational number, used as a parameter structure for /**
* A four-byte rational number, used as a parameter structure for
* LALUnitRaise(). * LALUnitRaise().
*/ */
typedef struct typedef struct
tagRAT4 tagRAT4
{ {
INT2 numerator; /**< The numerator */ INT2 numerator; /**< The numerator */
UINT2 denominatorMinusOne; /**< One less than the denominator */ UINT2 denominatorMinusOne; /**< One less than the denominator */
} RAT4; } RAT4;
/** Consists of a pair of unit structures; used as an input structure for /**
* Consists of a pair of unit structures; used as an input structure for
* the LALUnitCompare() and LALUnitMultiply() functions. * the LALUnitCompare() and LALUnitMultiply() functions.
*/ */
typedef struct typedef struct
tagLALUnitPair tagLALUnitPair
{ {
const LALUnit *unitOne; /**< The first unit */ const LALUnit *unitOne; /**< The first unit */
const LALUnit *unitTwo; /**< The second unit */ const LALUnit *unitTwo; /**< The second unit */
} }
LALUnitPair; LALUnitPair;
 End of changes. 3 change blocks. 
99 lines changed or deleted 105 lines changed or added


 UserInput.h   UserInput.h 
skipping to change at line 33 skipping to change at line 33
#ifdef __cplusplus /* C++ protection. */ #ifdef __cplusplus /* C++ protection. */
extern "C" { extern "C" {
#endif #endif
#include <lal/ConfigFile.h> #include <lal/ConfigFile.h>
#if 0 #if 0
#include <lal/LIGOMetadataTables.h> #include <lal/LIGOMetadataTables.h>
#endif #endif
/** \addtogroup UserInput_h /**
* \addtogroup UserInput_h
* \author Reinhard Prix * \author Reinhard Prix
* \brief Module for simple unified handling of user-input from config-file and/or command-line. * \brief Module for simple unified handling of user-input from config-file and/or command-line.
*
\heading{Description} * ### Description ###
*
This module provides simple function and macros to 'register' a set of C-v * This module provides simple function and macros to 'register' a set of C
ariables as 'User Variables', -variables as 'User Variables',
which can then be read in from the commandline and/or an input config file * which can then be read in from the commandline and/or an input config fi
, as parsed by \ref ConfigFile_h. le, as parsed by \ref ConfigFile_h.
*
The module handles generating and outputting a help-string on the availabl * The module handles generating and outputting a help-string on the availa
e inputs when requested, and ble inputs when requested, and
can deal with required inputs and providing defaults. * can deal with required inputs and providing defaults.
*
\heading{Usage} * ### Usage ###
*
The general approach consists of these steps * The general approach consists of these steps
<ol> * <ol>
<li> set default-value for optional user-variables</li> * <li> set default-value for optional user-variables</li>
<li> \c register all user-variables using calls to \c XLALRegister<TYPE>Us * <li> \c register all user-variables using calls to \c XLALRegister<TYPE>
erVar(), or more conveniently, using the shortcut-macros UserVar(), or more conveniently, using the shortcut-macros
XLALreg<TYPE>UserStruct() that assume a struct-pointer named 'uvar' c * XLALreg<TYPE>UserStruct() that assume a struct-pointer named 'uvar' cont
ontaining all user-variables as 'uvar->UserVariable'.</li> aining all user-variables as 'uvar->UserVariable'.</li>
<li> parse all user-input using XLALUserVarReadAllInput()</li> * <li> parse all user-input using XLALUserVarReadAllInput()</li>
<li> At the end, free user-input structure</li> * <li> At the end, free user-input structure</li>
</ol> * </ol>
*
One can use XLALUserVarWasSet() to determine wheter the user specified inp * One can use XLALUserVarWasSet() to determine wheter the user specified i
ut for a given (optional) variable, or if it still has just its default val nput for a given (optional) variable, or if it still has just its default v
ue. alue.
*
The function XLALUserVarGetLog() can be used to obtain a log-string contai * The function XLALUserVarGetLog() can be used to obtain a log-string cont
ning the full user-input, either in \c commandline- or \c ConfigFile format aining the full user-input, either in \c commandline- or \c ConfigFile form
. at.
*
Here is a worked simple example of its recommended use: * Here is a worked simple example of its recommended use:
\code * \code
#include <stdio.h> * #include <stdio.h>
#include <lal/UserInput.h> * #include <lal/UserInput.h>
*
// these are the C-variables we want to read in from user-input * // these are the C-variables we want to read in from user-input
typedef struct { * typedef struct {
BOOLEAN help; // did user request help-output? * BOOLEAN help; // did user request help-output?
INT4 anInteger; * INT4 anInteger;
REAL8 aDoubleVar; * REAL8 aDoubleVar;
CHAR *andAString; * CHAR *andAString;
REAL8 specialGeekSwitch; * REAL8 specialGeekSwitch;
} UserInput_t; * } UserInput_t;
*
UserInput_t empty_UserInput; // this is zero-intialized! * UserInput_t empty_UserInput; // this is zero-intialized!
*
int main(int argc,char *argv[]) * int main(int argc,char *argv[])
{ * {
UserInput_t UserVariables = empty_UserInput; // initializes this struct * UserInput_t UserVariables = empty_UserInput; // initializes this struc
to {0} t to {0}
UserInput_t *uvar = &UserVariables; // struct-pointer allows us * UserInput_t *uvar = &UserVariables; // struct-pointer allows
to use the XLALreg<TYPE>UserStruct() macros... us to use the XLALreg<TYPE>UserStruct() macros...
*
// 1. step: set default-values for optional user-input variables * // 1. step: set default-values for optional user-input variables
uvar->anInteger = 0; * uvar->anInteger = 0;
uvar->andAString = NULL; // Note: need to assign allocated strings h * uvar->andAString = NULL; // Note: need to assign allocated strings
ere as default!! here as default!!
*
// 2. step: Register all user-variables using the shortcut macros: * // 2. step: Register all user-variables using the shortcut macros:
XLALregBOOLUserStruct ( help, 'h', UVAR_HELP, "Outpu * XLALregBOOLUserStruct ( help, 'h', UVAR_HELP, "Out
t this help-message"); put this help-message");
XLALregINTUserStruct ( anInteger, 'i', UVAR_OPTIONAL, "An ex * XLALregINTUserStruct ( anInteger, 'i', UVAR_OPTIONAL, "An
ample user-variable of an optional integer"); example user-variable of an optional integer");
XLALregREALUserStruct ( aDoubleVar, 'r', UVAR_REQUIRED, "This * XLALregREALUserStruct ( aDoubleVar, 'r', UVAR_REQUIRED, "Thi
REAL8 user-variable is required"); s REAL8 user-variable is required");
XLALregSTRINGUserStruct( andAString, 0, UVAR_OPTIONAL, "Optio * XLALregSTRINGUserStruct( andAString, 0, UVAR_OPTIONAL, "Opt
nal string-input, has no short-option"); ional string-input, has no short-option");
* XLALregREALUserStruct ( specialGeekSwitch, 'g', UVAR_DEVELOPER, "T
XLALregREALUserStruct ( specialGeekSwitch, 'g', UVAR_DEVELOPER, "Thi his REAL8 user-variable is required");
s REAL8 user-variable is required"); *
* // 3. step: parse all user-input, from either config-file if given, or
// 3. step: parse all user-input, from either config-file if given, or c commandline (overloads config-file values)
ommandline (overloads config-file values) * if ( XLALUserVarReadAllInput ( argc, argv ) != XLAL_SUCCESS )
if ( XLALUserVarReadAllInput ( argc, argv ) != XLAL_SUCCESS ) * XLAL_ERROR ( XLAL_EFUNC );
XLAL_ERROR ( XLAL_EFUNC ); *
* if (uvar->help) // if user had requested help, then we're already
if (uvar->help) // if user had requested help, then we're already d done here
one here * return 0;
return 0; *
* printf ("User-input was: anInteger = %d, aDoubleVar = %f, andAString =
printf ("User-input was: anInteger = %d, aDoubleVar = %f, andAString = % %s\n", uvar->anInteger, uvar->aDoubleVar, uvar->andAString );
s\n", uvar->anInteger, uvar->aDoubleVar, uvar->andAString ); *
* // 4. step: free user-input module memory
// 4. step: free user-input module memory * XLALDestroyUserVars();
XLALDestroyUserVars(); *
* LALCheckMemoryLeaks();
LALCheckMemoryLeaks(); * return 0;
return 0; * } // main()
} // main() * \endcode
\endcode *
* \note This code can be compiled <b>as is</b> within lalapps, and yields
\note This code can be compiled <b>as is</b> within lalapps, and yields *
* \code
\code * $ ./testUserInput -v1 --help
$ ./testUserInput -v1 --help *
* Usage: testUserInput [@ConfigFile] [options], where options are:
Usage: testUserInput [@ConfigFile] [options], where options are: *
* -v INT set lalDebugLevel [0]
-v INT set lalDebugLevel [0] * -h, --help BOOL Output this help-message []
-h, --help BOOL Output this help-message [] * -i, --anInteger INT An example user-variable of an option
-i, --anInteger INT An example user-variable of an optiona al integer [0]
l integer [0] * -r, --aDoubleVar REAL This REAL8 user-variable is required
-r, --aDoubleVar REAL This REAL8 user-variable is required [ [REQUIRED]
REQUIRED] * --andAString STRING Optional string-input, has no short-optio
--andAString STRING Optional string-input, has no short-op n [NULL]
tion [NULL] *
* ---------- The following are 'Developer'-options not useful for most use
---------- The following are 'Developer'-options not useful for most use rs:----------
rs:---------- *
* -g, --specialGeekSwitch REAL This REAL8 user-variable is required
-g, --specialGeekSwitch REAL This REAL8 user-variable is required [ [0.0]
0.0] * \endcode
\endcode *
* And if called correctly:
And if called correctly: * \code
\code * $ ./testUserInput -r 3.1415 --andAString="stupid example"
$ ./testUserInput -r 3.1415 --andAString="stupid example" * User-input was: anInteger = 0, aDoubleVar = 3.141500, andAString = stupi
User-input was: anInteger = 0, aDoubleVar = 3.141500, andAString = stupid e d example
xample * \endcode
\endcode *
* \note For a real-world example of usage, see various codes in lalapps/sr
\note For a real-world example of usage, see various codes in lalapps/src/p c/pulsar, notably synthesizeLVStats.c
ulsar, notably synthesizeLVStats.c *
*/
*/
/*@{*/ /*@{*/
/** \name Shortcut Macros /**
* \name Shortcut Macros
* With this family of short-cut macros one can conveniently register User- variables * With this family of short-cut macros one can conveniently register User- variables
* that are accessible via a \e struct-pointer &quot;uvar->&quot; * that are accessible via a \e struct-pointer &quot;uvar->&quot;
*/ */
/*@{*/ /*@{*/
#define XLALregREALUserStruct(name,option,flag,help) \ #define XLALregREALUserStruct(name,option,flag,help) \
XLALRegisterREALUserVar(#name, option, flag, help, &(uvar-> name)) XLALRegisterREALUserVar(#name, option, flag, help, &(uvar-> name))
#define XLALregINTUserStruct(name,option,flag,help) \ #define XLALregINTUserStruct(name,option,flag,help) \
XLALRegisterINTUserVar(#name, option,flag, help, &(uvar-> name)) XLALRegisterINTUserVar(#name, option,flag, help, &(uvar-> name))
skipping to change at line 170 skipping to change at line 171
/** State-flags: variable is optional, required, help, developer or was_set */ /** State-flags: variable is optional, required, help, developer or was_set */
typedef enum { typedef enum {
UVAR_OPTIONAL = 0, /**< not required, and hasn't been s et */ UVAR_OPTIONAL = 0, /**< not required, and hasn't been s et */
UVAR_REQUIRED = 1<<0, /**< we require the user to set this variabl e */ UVAR_REQUIRED = 1<<0, /**< we require the user to set this variabl e */
UVAR_HELP = 1<<1, /**< special variable: trigger output of hel p-string */ UVAR_HELP = 1<<1, /**< special variable: trigger output of hel p-string */
UVAR_DEVELOPER = 1<<2, /**< OPTIONAL and hidden in help-output at l alDebugLevel==0 */ UVAR_DEVELOPER = 1<<2, /**< OPTIONAL and hidden in help-output at l alDebugLevel==0 */
UVAR_SPECIAL = 1<<3, /**< OPTIONAL and *turns off* checking of re quired variables (LALUserVarCheckRequired) */ UVAR_SPECIAL = 1<<3, /**< OPTIONAL and *turns off* checking of re quired variables (LALUserVarCheckRequired) */
UVAR_WAS_SET = 1<<7 /**< flag that this user-var has bee n set by user */ UVAR_WAS_SET = 1<<7 /**< flag that this user-var has bee n set by user */
} UserVarState; } UserVarState;
/** Format for logging User-input: configFile- or cmdLine-style. /**
* Format for logging User-input: configFile- or cmdLine-style.
* This determines the format of the string returned from LALLogUserInput() . * This determines the format of the string returned from LALLogUserInput() .
*/ */
typedef enum { typedef enum {
UVAR_LOGFMT_CFGFILE, /**< return UserVars as a config-file */ UVAR_LOGFMT_CFGFILE, /**< return UserVars as a config-file */
UVAR_LOGFMT_CMDLINE, /**< return UserVars as a command-line */ UVAR_LOGFMT_CMDLINE, /**< return UserVars as a command-line */
UVAR_LOGFMT_PROCPARAMS, /**< return UserVars suitable for filling in proc ess-params struct */ UVAR_LOGFMT_PROCPARAMS, /**< return UserVars suitable for filling in proc ess-params struct */
UVAR_LOGFMT_LAST UVAR_LOGFMT_LAST
} UserVarLogFormat; } UserVarLogFormat;
/* Function prototypes */ /* Function prototypes */
skipping to change at line 232 skipping to change at line 234
#define USERINPUTH_MSGECMDLARG "Illegal command-line argument" #define USERINPUTH_MSGECMDLARG "Illegal command-line argument"
#define USERINPUTH_MSGEUNKNOWN "Unknown user-variable" #define USERINPUTH_MSGEUNKNOWN "Unknown user-variable"
#define USERINPUTH_MSGENOTSET "Required user-variable was not set" #define USERINPUTH_MSGENOTSET "Required user-variable was not set"
#define USERINPUTH_MSGEDEBUG "lalDebugLevel can only be read before ANY m allocs(), even hidden.." #define USERINPUTH_MSGEDEBUG "lalDebugLevel can only be read before ANY m allocs(), even hidden.."
#define USERINPUTH_MSGEONECONFIG "Currently one ONE config-file can be spec ified using '@'" #define USERINPUTH_MSGEONECONFIG "Currently one ONE config-file can be spec ified using '@'"
#define USERINPUTH_MSGERECFORMAT "Unknown format for recording user-input " #define USERINPUTH_MSGERECFORMAT "Unknown format for recording user-input "
#define USERINPUTH_MSGEXLAL "Failure in XLAL function" #define USERINPUTH_MSGEXLAL "Failure in XLAL function"
#define USERINPUTH_MSGENAMECOLL "Commandline option assigned more than once " #define USERINPUTH_MSGENAMECOLL "Commandline option assigned more than once "
/** \endcond */ /** \endcond */
/** \name Deprecated LAL-interface /**
* \name Deprecated LAL-interface
* These functions and macros are deprecated, and you should user their XLA L-equivalents instead. * These functions and macros are deprecated, and you should user their XLA L-equivalents instead.
*/ /*@{*/ */
/*@{*/
/*----- short-cut macros to register global "uvar_" User-Variables ----- */ /*----- short-cut macros to register global "uvar_" User-Variables ----- */
#define LALregREALUserVar(status,name,option,flag,help) \ #define LALregREALUserVar(status,name,option,flag,help) \
TRY(LALRegisterREALUserVar((status)->statusPtr, #name, option, flag, help,& (uvar_ ## name)), status) TRY(LALRegisterREALUserVar((status)->statusPtr, #name, option, flag, help,& (uvar_ ## name)), status)
#define LALregINTUserVar(status,name,option,flag,help) \ #define LALregINTUserVar(status,name,option,flag,help) \
TRY(LALRegisterINTUserVar((status)->statusPtr, #name, option,flag, help,&(u var_ ## name)), status) TRY(LALRegisterINTUserVar((status)->statusPtr, #name, option,flag, help,&(u var_ ## name)), status)
#define LALregBOOLUserVar(status,name,option,flag,help) \ #define LALregBOOLUserVar(status,name,option,flag,help) \
TRY(LALRegisterBOOLUserVar((status)->statusPtr, #name, option, flag, help, &(uvar_ ## name)),status) TRY(LALRegisterBOOLUserVar((status)->statusPtr, #name, option, flag, help, &(uvar_ ## name)),status)
 End of changes. 6 change blocks. 
133 lines changed or deleted 137 lines changed or added


 VectorIndexRange.h   VectorIndexRange.h 
skipping to change at line 23 skipping to change at line 23
/** /**
* \addtogroup VectorIndexRange_h * \addtogroup VectorIndexRange_h
* \author David Chin <dwchin@umich.edu> +1-734-709-9119 * \author David Chin <dwchin@umich.edu> +1-734-709-9119
* *
* \brief Routines to slice up vectors/sequences by specifying starting and ending indices, inclusive. * \brief Routines to slice up vectors/sequences by specifying starting and ending indices, inclusive.
* *
* VectorIndexHole() is "complementary" to VectorIndexRange(), in the sense that * VectorIndexHole() is "complementary" to VectorIndexRange(), in the sense that
* it returns the two segments of the vector that would remain after Vector IndexRange() acts. * it returns the two segments of the vector that would remain after Vector IndexRange() acts.
* *
* \heading{Synopsis} * ### Synopsis ###
*
* \code * \code
* #include <lal/VectorIndexRange.h> * #include <lal/VectorIndexRange.h>
* \endcode * \endcode
*/ */
/*@{*/ /*@{*/
/**\name Error Codes */ /**\name Error Codes */
/*@{*/ /*@{*/
#define VECTORINDEXRANGEH_EARG 1 /**< Error parsing command-line argu ments */ #define VECTORINDEXRANGEH_EARG 1 /**< Error parsing command-line argu ments */
#define VECTORINDEXRANGEH_ECHK 2 /**< Error checking failed to catch bad data */ #define VECTORINDEXRANGEH_ECHK 2 /**< Error checking failed to catch bad data */
 End of changes. 1 change blocks. 
1 lines changed or deleted 2 lines changed or added


 VectorOps.h   VectorOps.h 
skipping to change at line 37 skipping to change at line 37
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
* \addtogroup VectorOps_h * \addtogroup VectorOps_h
* \author J. D. E. Creighton, T. D. Creighton, A. M. Sintes * \author J. D. E. Creighton, T. D. Creighton, A. M. Sintes
* *
* \brief Basic vector manipulation operations. * \brief Basic vector manipulation operations.
* *
* \heading{Synopsis} * ### Synopsis ###
*
* \code * \code
* #include <lal/VectorOps.h> * #include <lal/VectorOps.h>
* \endcode * \endcode
* *
* @{ * @{
* \defgroup VectorMultiply_c Module VectorMultiply.c * \defgroup VectorMultiply_c Module VectorMultiply.c
* \defgroup VectorPolar_c Module VectorPolar.c * \defgroup VectorPolar_c Module VectorPolar.c
*/ */
/** \name Error Codes */ /** \name Error Codes */
 End of changes. 1 change blocks. 
1 lines changed or deleted 2 lines changed or added


 Window.h   Window.h 
skipping to change at line 35 skipping to change at line 35
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* \defgroup Window_h Header Window.h * \defgroup Window_h Header Window.h
* \ingroup pkg_window * \ingroup pkg_window
* \brief This header file provides routines and structures to create and s tore window functions (also called a taper, * \brief This header file provides routines and structures to create and s tore window functions (also called a taper,
* lag window, or apodization function). * lag window, or apodization function).
*
\heading{Synopsis} * ### Synopsis ###
*
\code * \code
#include <lal/Window.h> * #include <lal/Window.h>
\endcode * \endcode
*
\heading{Description} * ### Description ###
*
These functions create or destroy a time-domain window function in a vector * These functions create or destroy a time-domain window function in a vec
of specified length. If you wish to construct a custom window, call tor
<tt>XLALCreateRectangularREAL8Window()</tt> (or the \c REAL4 * of specified length. If you wish to construct a custom window, call
version), then replace the samples inside it with your own, and update the * <tt>XLALCreateRectangularREAL8Window()</tt> (or the \c REAL4
\c sumofsquares and \c sum elements. If the window function * version), then replace the samples inside it with your own, and update t
proves useful, consider adding it here so that others can benefit. he
* \c sumofsquares and \c sum elements. If the window function
It is convenient to describe the windows as functions on the normalized * proves useful, consider adding it here so that others can benefit.
domain \f$y \in [-1, 1]\f$. The window is zero outside this domain. The *
window functions defined in this package are as follows. * It is convenient to describe the windows as functions on the normalized
* domain \f$y \in [-1, 1]\f$. The window is zero outside this domain. Th
\heading{Rectangle} e
\f{equation}{ * window functions defined in this package are as follows.
w(y) *
= 1. * ### Rectangle ###
\f}</dd> *
* \f{equation}{
\heading{Hann} * w(y)
\f{equation}{ * = 1.
w(y) * \f}</dd>
= \cos^2 \frac{\pi}{2} y. *
\f}</dd> * ### Hann ###
*
\heading{Welch} * \f{equation}{
\f{equation}{ * w(y)
w(y) * = \cos^2 \frac{\pi}{2} y.
= 1 - y^2. * \f}</dd>
\f}</dd> *
* ### Welch ###
\heading{Bartlett} *
\f{equation}{ * \f{equation}{
w(y) * w(y)
= 1 - |y|. * = 1 - y^2.
\f}</dd> * \f}</dd>
*
\heading{Parzen} * ### Bartlett ###
\f{equation}{ *
w(y) * \f{equation}{
= \left\{ \begin{array}{ll} * w(y)
1 - 6 y^2 (1 - |y|) & |y| \leq 1 / 2, \\ * = 1 - |y|.
2 (1 - |y|)^3 & |y| > 1 / 2. * \f}</dd>
\end{array}\right. *
\f}</dd> * ### Parzen ###
*
\heading{Papoulis} * \f{equation}{
\f{equation}{ * w(y)
w(y) * = \left\{ \begin{array}{ll}
= \frac{1}{\pi} \sin \pi |y| + (1 - |y|) \cos \pi |y|. * 1 - 6 y^2 (1 - |y|) & |y| \leq 1 / 2, \\
\f}</dd> * 2 (1 - |y|)^3 & |y| > 1 / 2.
* \end{array}\right.
\heading{Hamming} * \f}</dd>
\f{equation}{ *
w(y) * ### Papoulis ###
= 0.08 + 0.92 \cos^{2} \frac{\pi}{2} y. *
\f} * \f{equation}{
This is the same as the Hann window, but with an additional DC bias, or * w(y)
&quot;foot,&quot; of 0.08.</dd> * = \frac{1}{\pi} \sin \pi |y| + (1 - |y|) \cos \pi |y|.
* \f}</dd>
\heading{Kaiser} *
\f{equation}{ * ### Hamming ###
w(y) *
= I_0 \left( \beta \sqrt{1-y^2} \right) / I_0(\beta), * \f{equation}{
\f} * w(y)
where \f$I_0(x)\f$ is the \f$0\f$th order, modified Bessel function of the * = 0.08 + 0.92 \cos^{2} \frac{\pi}{2} y.
first * \f}
kind. The shape parameter \f$\beta \in [0, \infty]\f$ sets the sharpness o * This is the same as the Hann window, but with an additional DC bias, or
f * &quot;foot,&quot; of 0.08.</dd>
the central peak. \f$\beta = 0\f$ yields the rectangle window, \f$\beta *
\rightarrow \infty\f$ yields a \f$\delta\f$ function with a single non-zero * ### Kaiser ###
sample in the middle. This window is difficult to compute for large *
\f$\beta\f$, and an asymptotic approximation is used for \f$\beta \ge 705\f * \f{equation}{
$. A * w(y)
linearly-interpolated transition occurs between \f$\beta = 695\f$ and \f$\b * = I_0 \left( \beta \sqrt{1-y^2} \right) / I_0(\beta),
eta = * \f}
705\f$. Finite-difference derivatives of the window with respect to \f$\be * where \f$I_0(x)\f$ is the \f$0\f$th order, modified Bessel function of t
ta\f$ he first
are unlikely to work well in this regime.</dd> * kind. The shape parameter \f$\beta \in [0, \infty]\f$ sets the sharpnes
s of
\heading{Creighton} * the central peak. \f$\beta = 0\f$ yields the rectangle window, \f$\beta
\f{equation}{ * \rightarrow \infty\f$ yields a \f$\delta\f$ function with a single non-z
w(y) ero
= \exp \left( -\beta \frac{y^2}{1 - y^2} \right). * sample in the middle. This window is difficult to compute for large
\f} * \f$\beta\f$, and an asymptotic approximation is used for \f$\beta \ge 70
This window function is based on a fairly standard \f$C_{\infty}\f$ test 5\f$. A
function used in distribution theory, e.g.\ <em>Green's Functions and * linearly-interpolated transition occurs between \f$\beta = 695\f$ and \f
Boundary Value Problems</em> [\ref stakgold79], by Stakgold. The shape par $\beta =
ameter * 705\f$. Finite-difference derivatives of the window with respect to \f$
\f$\beta \in [0, \infty]\f$ sets the sharpness of the central peak. \f$\be \beta\f$
ta = * are unlikely to work well in this regime.</dd>
0\f$ yields the rectangle window, \f$\beta \rightarrow \infty\f$ yields a *
\f$\delta\f$ function with a single non-zero sample in the middle.</dd> * ### Creighton ###
*
\heading{Tukey} * \f{equation}{
\f{equation}{ * w(y)
w(y) * = \exp \left( -\beta \frac{y^2}{1 - y^2} \right).
= \left\{ \begin{array}{ll} * \f}
\sin^2 \left[ \frac{\pi}{2} (|y| - 1) / \beta \right] & |y| \geq 1 - * This window function is based on a fairly standard \f$C_{\infty}\f$ test
\beta, * function used in distribution theory, e.g.\ <em>Green's Functions and
\\ * Boundary Value Problems</em> \cite stakgold79, by Stakgold. The shape p
1 & |y| < 1 - \beta. arameter
\end{array} \right. * \f$\beta \in [0, \infty]\f$ sets the sharpness of the central peak. \f$
\f} \beta =
The shape parameter \f$\beta \in [0, 1]\f$ sets what fraction of the window * 0\f$ yields the rectangle window, \f$\beta \rightarrow \infty\f$ yields
is a
spanned by the tapers. \f$\beta = 0\f$ yields the rectangle window, \f$\be * \f$\delta\f$ function with a single non-zero sample in the middle.</dd>
ta = *
1\f$ yields the Hann window.</dd> * ### Tukey ###
*
\heading{Gauss} * \f{equation}{
\f{equation}{ * w(y)
w(y) * = \left\{ \begin{array}{ll}
= \exp \left( -\frac{1}{2} \beta^{2} y^{2} \right). * \sin^2 \left[ \frac{\pi}{2} (|y| - 1) / \beta \right] & |y| \geq 1 -
\f} * \beta, \\
The shape parameter \f$\beta \in [0, \infty]\f$ sets the sharpness of the * 1 & |y| < 1 - \beta.
central peak. \f$\beta = 0\f$ yields the rectangle window, \f$\beta \right * \end{array} \right.
arrow \infty\f$ yields a \f$\delta\f$ function with a single non-zero sampl * \f}
e in the * The shape parameter \f$\beta \in [0, 1]\f$ sets what fraction of the win
middle. dow is
* spanned by the tapers. \f$\beta = 0\f$ yields the rectangle window, \f$
These window functions are shown in Fig.\figref{f_window_t}, showing variou \beta =
s windows as functions of the normalized * 1\f$ yields the Hann window.</dd>
independend variable \f$y\f$, choosing \f$\beta = 6\f$ for the Kaiser windo *
w, \f$\beta = 2\f$ for the Creighton window, * ### Gauss ###
\f$\beta = 0.5\f$ for the Tukey window, and \f$\beta = 3\f$ for the Gauss w *
indow. * \f{equation}{
* w(y)
\floatfig{htbp,f_window_t} * = \exp \left( -\frac{1}{2} \beta^{2} y^{2} \right).
\image html window_t.png "Fig. [f_window_t]: Various windows as functions * \f}
of the normalized independend variable y" * The shape parameter \f$\beta \in [0, \infty]\f$ sets the sharpness of th
\image latex window_t.pdf "Various windows as functions of the normalized i e
ndependend variable y" * central peak. \f$\beta = 0\f$ yields the rectangle window, \f$\beta \ri
ghtarrow \infty\f$ yields a \f$\delta\f$ function with a single non-zero sa
For a vector of length \f$L\f$ (an integer), the mapping from integer array mple in the
index \f$i\f$ to normalized co-ordinate \f$y\f$ is * middle.
\f{equation}{ *
y(i) * These window functions are shown in \figref{window_t}, showing various w
= \left\{ \begin{array}{ll} indows as functions of the normalized
0 & L \le 1, \\ * independend variable \f$y\f$, choosing \f$\beta = 6\f$ for the Kaiser wi
2 i / (L - 1) - 1 & L > 1, ndow, \f$\beta = 2\f$ for the Creighton window,
\end{array} \right. * \f$\beta = 0.5\f$ for the Tukey window, and \f$\beta = 3\f$ for the Gaus
\f} s window.
where \f$0 \le i < L\f$, and floating-point division is used. This agrees *
with * \figure{window_t,pdf,0.6,Various windows as functions of the normalized
J. G. Proakis and D. G. Manolakis, <em>Digital Signal Processing</em> independend variable y}
[\ref pm95], and \c MatLab. The first sample is \f$y = -1\f$, the last *
sample is \f$y = +1\f$. For odd-lengthed vectors, the middle sample is \f$ * For a vector of length \f$L\f$ (an integer), the mapping from integer ar
y = ray
0\f$, while for even-lengthed vectors \f$y = 0\f$ occurs half-way between t * index \f$i\f$ to normalized co-ordinate \f$y\f$ is
he two * \f{equation}{
middle samples. Substituting \f$y(i)\f$ into the definitions of the window * y(i)
functions above yields \f$w(i)\f$, the value of the window function at the * = \left\{ \begin{array}{ll}
integer sample \f$i\f$. * 0 & L \le 1, \\
* 2 i / (L - 1) - 1 & L > 1,
The Fourier transforms of the windows are shown as functions of \f$1 / y\f$ * \end{array} \right.
in * \f}
Fig.\figref{f_window_f}, showing frequency behaviour of various windows as * where \f$0 \le i < L\f$, and floating-point division is used. This agre
functions es with
of the inverse of the normalized independend variable \f$y\f$, choosing \f$ * J. G. Proakis and D. G. Manolakis, <em>Digital Signal Processing</em>
\beta = 6\f$ * \cite pm95, and \c MatLab. The first sample is \f$y = -1\f$, the last
for the Kaiser window, \f$\beta = 2\f$ for the Creighton window, \f$\beta = * sample is \f$y = +1\f$. For odd-lengthed vectors, the middle sample is
0.5\f$ for \f$y =
the Tukey window, and \f$\beta = 3\f$ for the Gauss window. * 0\f$, while for even-lengthed vectors \f$y = 0\f$ occurs half-way betwee
n the two
\floatfig{htbp,f_window_f} * middle samples. Substituting \f$y(i)\f$ into the definitions of the win
\image html window_f.png "Fig. [f_window_f]: Frequency behaviour of variou dow
s windows as functions of the inverse of the normalized independend variabl * functions above yields \f$w(i)\f$, the value of the window function at t
e y" he
\image latex window_f.pdf "Frequency behaviour of various windows as functi * integer sample \f$i\f$.
ons of the inverse of the normalized independend variable y" *
* The Fourier transforms of the windows are shown as functions of \f$1 / y
Since the Fourier transform of windowed data is the Fourier transform of \f$ in
the data convolved with the Fourier transform of the window, * \figref{window_f}, showing frequency behaviour of various windows as fun
Fig.\figref{f_window_f} is the major guideline for selecting a window. One ctions
can see that windows with a narrow central lobe tend to have higher * of the inverse of the normalized independend variable \f$y\f$, choosing
sidelobes, and windows which suppress their low-order sidelobes tend to \f$\beta = 6\f$
have more power in the high-order sidelobes. The choice of window thus * for the Kaiser window, \f$\beta = 2\f$ for the Creighton window, \f$\bet
depends on whether one is trying to resolve nearby spectral features of a = 0.5\f$ for
comparable magnitude (suggesting a rectangular or a Welch window), to * the Tukey window, and \f$\beta = 3\f$ for the Gauss window.
reduce spectral bias and low-order sidelobes (a Hamming or Kaiser window), *
or to measure a broad spectrum with a large dynamical range (a Creighton or * \figure{window_f,pdf,0.6,Frequency behaviour of various windows as funct
a Papoulis window). ions of the inverse of the normalized independend variable y}
*
*/ * Since the Fourier transform of windowed data is the Fourier transform of
* the data convolved with the Fourier transform of the window,
* \figref{window_f} is the major guideline for selecting a window. One
* can see that windows with a narrow central lobe tend to have higher
* sidelobes, and windows which suppress their low-order sidelobes tend to
* have more power in the high-order sidelobes. The choice of window thus
* depends on whether one is trying to resolve nearby spectral features of
* comparable magnitude (suggesting a rectangular or a Welch window), to
* reduce spectral bias and low-order sidelobes (a Hamming or Kaiser window
),
* or to measure a broad spectrum with a large dynamical range (a Creighton
or
* a Papoulis window).
*
*/
/*@{*/ /*@{*/
/** Structure for storing REAL4 window function data, providing storage for /**
a sequence of samples * Structure for storing REAL4 window function data, providing storage for
a sequence of samples
* as well as metadata about the window such as the sum-of-squarse of the s amples * as well as metadata about the window such as the sum-of-squarse of the s amples
*/ */
typedef struct tagREAL4Window { typedef struct tagREAL4Window {
REAL4Sequence *data; /**< The window function samples */ REAL4Sequence *data; /**< The window function samples */
REAL8 sumofsquares; /**< The sum of the squares of the w indow function samples */ REAL8 sumofsquares; /**< The sum of the squares of the w indow function samples */
REAL8 sum; /**< The sum of the window function samples */ REAL8 sum; /**< The sum of the window function samples */
} REAL4Window; } REAL4Window;
/** Structure for storing REAL8 window function data, providing storage for /**
a sequence of samples * Structure for storing REAL8 window function data, providing storage for
a sequence of samples
* as well as metadata about the window such as the sum-of-squarse of the s amples * as well as metadata about the window such as the sum-of-squarse of the s amples
*/ */
typedef struct tagREAL8Window { typedef struct tagREAL8Window {
REAL8Sequence *data; /**< The window function samples */ REAL8Sequence *data; /**< The window function samples */
REAL8 sumofsquares; /**< The sum of the squares of the w indow function samples */ REAL8 sumofsquares; /**< The sum of the squares of the w indow function samples */
REAL8 sum; /**< The sum of the window function samples */ REAL8 sum; /**< The sum of the window function samples */
} REAL8Window; } REAL8Window;
#ifdef SWIG /* SWIG interface directives */
SWIGLAL(ACQUIRES_OWNERSHIP(REAL4Sequence*, sequence));
SWIGLAL(ACQUIRES_OWNERSHIP(REAL8Sequence*, sequence));
#endif
REAL4Window *XLALCreateREAL4WindowFromSequence(REAL4Sequence *sequence); REAL4Window *XLALCreateREAL4WindowFromSequence(REAL4Sequence *sequence);
REAL8Window *XLALCreateREAL8WindowFromSequence(REAL8Sequence *sequence); REAL8Window *XLALCreateREAL8WindowFromSequence(REAL8Sequence *sequence);
#ifdef SWIG /* SWIG interface directives */
SWIGLAL_CLEAR(ACQUIRES_OWNERSHIP(REAL4Sequence*, sequence));
SWIGLAL_CLEAR(ACQUIRES_OWNERSHIP(REAL8Sequence*, sequence));
#endif
REAL4Window *XLALCreateRectangularREAL4Window(UINT4 length); REAL4Window *XLALCreateRectangularREAL4Window(UINT4 length);
REAL4Window *XLALCreateHannREAL4Window(UINT4 length); REAL4Window *XLALCreateHannREAL4Window(UINT4 length);
REAL4Window *XLALCreateWelchREAL4Window(UINT4 length); REAL4Window *XLALCreateWelchREAL4Window(UINT4 length);
REAL4Window *XLALCreateBartlettREAL4Window(UINT4 length); REAL4Window *XLALCreateBartlettREAL4Window(UINT4 length);
REAL4Window *XLALCreateParzenREAL4Window(UINT4 length); REAL4Window *XLALCreateParzenREAL4Window(UINT4 length);
REAL4Window *XLALCreatePapoulisREAL4Window(UINT4 length); REAL4Window *XLALCreatePapoulisREAL4Window(UINT4 length);
REAL4Window *XLALCreateHammingREAL4Window(UINT4 length); REAL4Window *XLALCreateHammingREAL4Window(UINT4 length);
REAL4Window *XLALCreateKaiserREAL4Window(UINT4 length, REAL4 beta); REAL4Window *XLALCreateKaiserREAL4Window(UINT4 length, REAL4 beta);
REAL4Window *XLALCreateCreightonREAL4Window(UINT4 length, REAL4 beta); REAL4Window *XLALCreateCreightonREAL4Window(UINT4 length, REAL4 beta);
 End of changes. 5 change blocks. 
196 lines changed or deleted 220 lines changed or added


 XLALError.h   XLALError.h 
skipping to change at line 40 skipping to change at line 40
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
* \addtogroup XLALError_h * \addtogroup XLALError_h
* \author Creighton, J. D. E. * \author Creighton, J. D. E.
* \date 2005 * \date 2005
* \brief This header covers routines to provide the XLAL interface error * \brief This header covers routines to provide the XLAL interface error
* handling. * handling.
* *
* \heading{XLAL Errors} * ### XLAL Errors ###
* *
* When an XLAL routine fails, the routine should set the <tt>xlalErrno</tt > to * When an XLAL routine fails, the routine should set the <tt>xlalErrno</tt > to
* an appropriate error number and return with the appropriate error code. The * an appropriate error number and return with the appropriate error code. The
* return value depends on the return type of the XLAL function. Furthermo re, * return value depends on the return type of the XLAL function. Furthermo re,
* the XLAL error handler should be invoked. * the XLAL error handler should be invoked.
* *
* Whenever possible (i.e., always), standard XLAL error macros should be u sed * Whenever possible (i.e., always), standard XLAL error macros should be u sed
* when generating an error. These macros (i) invoke the current error han dler, * when generating an error. These macros (i) invoke the current error han dler,
* (ii) set the error code to the specified value, and (iii) return with th e * (ii) set the error code to the specified value, and (iii) return with th e
* correct return value. In addition, these macros may take an optional * correct return value. In addition, these macros may take an optional
skipping to change at line 110 skipping to change at line 110
* y += 0.5 * log(2.0 * LAL_PI * n); * y += 0.5 * log(2.0 * LAL_PI * n);
* return y; * return y;
* default: * default:
* XLALSetErrno(errnum); * XLALSetErrno(errnum);
* XLAL_ERROR_REAL8(XLAL_EFUNC); * XLAL_ERROR_REAL8(XLAL_EFUNC);
* } * }
* return log(y); * return log(y);
* } * }
* \endcode * \endcode
* *
* \heading{XLAL Function Return Codes} * ### XLAL Function Return Codes ###
* *
* XLAL functions that return an integer-type will return <tt>#XLAL_FAILURE </tt> * XLAL functions that return an integer-type will return <tt>#XLAL_FAILURE </tt>
* on failure. XLAL functions that return a pointer will return <tt>NULL</ tt> * on failure. XLAL functions that return a pointer will return <tt>NULL</ tt>
* on failure. * on failure.
* *
* The LAL specification requires that XLAL functions that return a * The LAL specification requires that XLAL functions that return a
* floating-point type (either <tt>::REAL4</tt> or <tt>::REAL8</tt>) should return * floating-point type (either <tt>::REAL4</tt> or <tt>::REAL8</tt>) should return
* a particular value to indicate an error. These values are given by the * a particular value to indicate an error. These values are given by the
* macros <tt>#XLAL_REAL4_FAIL_NAN</tt> and <tt>#XLAL_REAL8_FAIL_NAN</tt> ( they * macros <tt>#XLAL_REAL4_FAIL_NAN</tt> and <tt>#XLAL_REAL8_FAIL_NAN</tt> ( they
* are Not a Number or NaN values). To implement these we choose hexadecim al * are Not a Number or NaN values). To implement these we choose hexadecim al
skipping to change at line 135 skipping to change at line 135
* hexadecimal representation to the floating-point representation is done * hexadecimal representation to the floating-point representation is done
* using a union. * using a union.
* *
* The LAL specification also requires that there be two macros, * The LAL specification also requires that there be two macros,
* <tt>#XLAL_IS_REAL4_FAIL_NAN(val)</tt> and * <tt>#XLAL_IS_REAL4_FAIL_NAN(val)</tt> and
* <tt>#XLAL_IS_REAL8_FAIL_NAN(val)</tt> that will test if val is one of th ese * <tt>#XLAL_IS_REAL8_FAIL_NAN(val)</tt> that will test if val is one of th ese
* XLAL-specific fail NaNs. Again these macros invoke static functions tha t * XLAL-specific fail NaNs. Again these macros invoke static functions tha t
* return the result of the comparison. The cmparison itself is done with the * return the result of the comparison. The cmparison itself is done with the
* hexadecimal representation. * hexadecimal representation.
* *
* \heading{XLAL Error Codes} * ### XLAL Error Codes ###
* *
* The LAL specification requires particular return code and error values. * The LAL specification requires particular return code and error values.
* These are implemented here as enumeration constants in the * These are implemented here as enumeration constants in the
* <tt>::XLALErrorValue</tt> enumeration. * <tt>::XLALErrorValue</tt> enumeration.
*/ */
/*@{*/ /*@{*/
/* /*
* *
* Use these functions to print arbitrary messages as errors or warnings. * Use these functions to print arbitrary messages as errors or warnings.
skipping to change at line 177 skipping to change at line 177
int XLALVPrintInfo(const char *fmt, va_list ap); int XLALVPrintInfo(const char *fmt, va_list ap);
#endif /* SWIG */ #endif /* SWIG */
/* /*
* *
* Miscelaneous routines to print information with standard formatting. * Miscelaneous routines to print information with standard formatting.
* *
*/ */
/** Print an error message with standard XLAL formatting (if error messages /**
* are enabled by lalDebugLevel). */ * Print an error message with standard XLAL formatting (if error messages
* are enabled by lalDebugLevel).
*/
void XLALPrintErrorMessage(const char *func, const char *file, int line, void XLALPrintErrorMessage(const char *func, const char *file, int line,
const char *fmt, ...); const char *fmt, ...);
/** Print an warning message with standard XLAL formatting (if warning mess /**
ages * Print an warning message with standard XLAL formatting (if warning messa
* are enabled by lalDebugLevel). */ ges
* are enabled by lalDebugLevel).
*/
void XLALPrintWarningMessage(const char *func, const char *file, int line, void XLALPrintWarningMessage(const char *func, const char *file, int line,
const char *fmt, ...); const char *fmt, ...);
/** Print an info message with standard XLAL formatting (if info messages /**
* are enabled by lalDebugLevel). */ * Print an info message with standard XLAL formatting (if info messages
* are enabled by lalDebugLevel).
*/
void XLALPrintInfoMessage(const char *func, const char *file, int line, void XLALPrintInfoMessage(const char *func, const char *file, int line,
const char *fmt, ...); const char *fmt, ...);
#ifndef SWIG /* exclude from SWIG interface */ #ifndef SWIG /* exclude from SWIG interface */
/** Print an error message with standard XLAL formatting (if error messages /**
* are enabled by lalDebugLevel). */ * Print an error message with standard XLAL formatting (if error messages
* are enabled by lalDebugLevel).
*/
void XLALVPrintErrorMessage(const char *func, const char *file, int line, void XLALVPrintErrorMessage(const char *func, const char *file, int line,
const char *fmt, va_list ap); const char *fmt, va_list ap);
/** Print an warning message with standard XLAL formatting (if warning mess /**
ages * Print an warning message with standard XLAL formatting (if warning messa
* are enabled by lalDebugLevel). */ ges
* are enabled by lalDebugLevel).
*/
void XLALVPrintWarningMessage(const char *func, const char *file, int line, void XLALVPrintWarningMessage(const char *func, const char *file, int line,
const char *fmt, va_list ap); const char *fmt, va_list ap);
/** Print an error message with standard XLAL formatting (if error messages /**
* are enabled by lalDebugLevel). */ * Print an error message with standard XLAL formatting (if error messages
* are enabled by lalDebugLevel).
*/
void XLALVPrintInfoMessage(const char *func, const char *file, int line, void XLALVPrintInfoMessage(const char *func, const char *file, int line,
const char *fmt, va_list ap); const char *fmt, va_list ap);
#endif /* SWIG */ #endif /* SWIG */
/** Prints a progress bar at the "info" verbosity level. */ /** Prints a progress bar at the "info" verbosity level. */
int XLALPrintProgressBar(double); int XLALPrintProgressBar(double);
/** Prints a deprecation warning at the "warning" verbosity level. */ /** Prints a deprecation warning at the "warning" verbosity level. */
int XLALPrintDeprecationWarning(const char *old, const char *replacement); #define XLAL_PRINT_DEPRECATION_WARNING(replacement) \
do { \
static int _xlal_print_deprecation_warning_ = 1; \
if (_xlal_print_deprecation_warning_) { \
XLALPrintWarning( \
"\nDEPRECATION WARNING: program has invoked obsolete function %s().
" \
"Please see %s() for information about a replacement.\n", \
__func__, replacement); \
_xlal_print_deprecation_warning_ = 0; \
} \
} while(0)
/* /*
* *
* Macros that will print error/warning/info messages with a standard forma t. * Macros that will print error/warning/info messages with a standard forma t.
* *
*/ */
/** \brief Macro that will print an error message with a standard format. /**
* \brief Macro that will print an error message with a standard format.
* *
* Prototype: <b>XLAL_PRINT_ERROR(fmt [, ...])</b> * Prototype: <b>XLAL_PRINT_ERROR(fmt [, ...])</b>
* *
* \b Parameters:<ul> * \b Parameters:<ul>
* <li> \b fmt A printf-like format string. * <li> \b fmt A printf-like format string.
* <li> \b ... (Optional) Arguments to the format string. * <li> \b ... (Optional) Arguments to the format string.
* </ul> * </ul>
*/ */
#define XLAL_PRINT_ERROR(...) \ #define XLAL_PRINT_ERROR(...) \
XLALPrintErrorMessage(__func__, __FILE__, __LINE__, __VA_ARGS__) XLALPrintErrorMessage(__func__, __FILE__, __LINE__, __VA_ARGS__)
/** \brief Macro that will print a warning message with a standard format. /**
* \brief Macro that will print a warning message with a standard format.
* *
* Prototype: <b>XLAL_PRINT_WARNING(fmt [, ...])</b> * Prototype: <b>XLAL_PRINT_WARNING(fmt [, ...])</b>
* *
* \b Parameters:<ul> * \b Parameters:<ul>
* <li> \b fmt A printf-like format string. * <li> \b fmt A printf-like format string.
* <li> \b ... (Optional) Arguments to the format string. * <li> \b ... (Optional) Arguments to the format string.
* </ul> * </ul>
*/ */
#define XLAL_PRINT_WARNING(...) \ #define XLAL_PRINT_WARNING(...) \
XLALPrintWarningMessage(__func__, __FILE__, __LINE__, __VA_ARGS__) XLALPrintWarningMessage(__func__, __FILE__, __LINE__, __VA_ARGS__)
/** \brief Macro that will print an info message with a standard format. /**
* \brief Macro that will print an info message with a standard format.
* *
* Prototype: <b>XLAL_PRINT_INFO(fmt [, ...])</b> * Prototype: <b>XLAL_PRINT_INFO(fmt [, ...])</b>
* *
* \b Parameters:<ul> * \b Parameters:<ul>
* <li> \b fmt A printf-like format string. * <li> \b fmt A printf-like format string.
* <li> \b ... (Optional) Arguments to the format string. * <li> \b ... (Optional) Arguments to the format string.
* </ul> * </ul>
*/ */
#define XLAL_PRINT_INFO(...) \ #define XLAL_PRINT_INFO(...) \
XLALPrintInfoMessage(__func__, __FILE__, __LINE__, __VA_ARGS__) XLALPrintInfoMessage(__func__, __FILE__, __LINE__, __VA_ARGS__)
/* silence gcc warnings about certain (possibly) unused symbols */
#ifdef __GNUC__
#define UNUSED __attribute__ ((unused))
#else
#define UNUSED
#endif
/* /*
* *
* The LAL specification requires that XLAL functions that return a * The LAL specification requires that XLAL functions that return a
* floating-point type (either <tt>REAL4</tt> or <tt>REAL8</tt>) should ret urn * floating-point type (either <tt>REAL4</tt> or <tt>REAL8</tt>) should ret urn
* a particular value to indicate an error. These values are given by the * a particular value to indicate an error. These values are given by the
* macros <tt>XLAL_REAL4_FAIL_NAN</tt> and <tt>XLAL_REAL8_FAIL_NAN</tt> (th ey * macros <tt>XLAL_REAL4_FAIL_NAN</tt> and <tt>XLAL_REAL8_FAIL_NAN</tt> (th ey
* are Not a Number or NaN values). To implement these we choose hexadecim al * are Not a Number or NaN values). To implement these we choose hexadecim al
* representations and then provide static functions that return the equiva lent * representations and then provide static functions that return the equiva lent
* <tt>REAL4</tt> or <tt>REAL8</tt> values. The macros then invoke these * <tt>REAL4</tt> or <tt>REAL8</tt> values. The macros then invoke these
* functions. This is done so that the compiler can easily inline the * functions. This is done so that the compiler can easily inline the
skipping to change at line 301 skipping to change at line 319
#define XLAL_REAL4_FAIL_NAN_INT 0x7fc001a1 /**< Hexadecimal representation of <tt>REAL4</tt> NaN failure bit pattern */ #define XLAL_REAL4_FAIL_NAN_INT 0x7fc001a1 /**< Hexadecimal representation of <tt>REAL4</tt> NaN failure bit pattern */
#define XLAL_REAL8_FAIL_NAN_INT LAL_INT8_C(0x7ff80000000001a1) /**< Hexadec imal representation of <tt>REAL8</tt> NaN failure bit pattern */ #define XLAL_REAL8_FAIL_NAN_INT LAL_INT8_C(0x7ff80000000001a1) /**< Hexadec imal representation of <tt>REAL8</tt> NaN failure bit pattern */
/* /*
* The floating point values themselves are returned by static functions th at * The floating point values themselves are returned by static functions th at
* can be easily inlined by the compiler; similarly, the routines to test i f a * can be easily inlined by the compiler; similarly, the routines to test i f a
* value is the LAL failure NaN can also be inlined. * value is the LAL failure NaN can also be inlined.
*/ */
/** Returns the value of the XLAL <tt>REAL4</tt> failure NaN. */ /** Returns the value of the XLAL <tt>REAL4</tt> failure NaN. */
static REAL4 UNUSED XLALREAL4FailNaN(void) static _LAL_INLINE_ REAL4 XLALREAL4FailNaN(void);
#ifndef SWIG /* exclude from SWIG interface */
static _LAL_INLINE_ REAL4 XLALREAL4FailNaN(void)
{ {
volatile const union { volatile const union {
INT4 i; INT4 i;
REAL4 x; REAL4 x;
} val = { } val = {
XLAL_REAL4_FAIL_NAN_INT}; XLAL_REAL4_FAIL_NAN_INT};
return val.x; return val.x;
} }
#endif /* SWIG */
/** Returns the value of the XLAL <tt>REAL8</tt> failure NaN. */ /** Returns the value of the XLAL <tt>REAL8</tt> failure NaN. */
static REAL8 UNUSED XLALREAL8FailNaN(void) static _LAL_INLINE_ REAL8 XLALREAL8FailNaN(void);
#ifndef SWIG /* exclude from SWIG interface */
static _LAL_INLINE_ REAL8 XLALREAL8FailNaN(void)
{ {
volatile const union { volatile const union {
INT8 i; INT8 i;
REAL8 x; REAL8 x;
} val = { } val = {
XLAL_REAL8_FAIL_NAN_INT}; XLAL_REAL8_FAIL_NAN_INT};
return val.x; return val.x;
} }
#endif /* SWIG */
/** Tests if a value is an XLAL <tt>REAL4</tt> failure NaN. */ /** Tests if a value is an XLAL <tt>REAL4</tt> failure NaN. */
static int UNUSED XLALIsREAL4FailNaN(REAL4 val) static _LAL_INLINE_ int XLALIsREAL4FailNaN(REAL4 val);
#ifndef SWIG /* exclude from SWIG interface */
static _LAL_INLINE_ int XLALIsREAL4FailNaN(REAL4 val)
{ {
volatile const union { volatile const union {
INT4 i; INT4 i;
unsigned char s[4]; unsigned char s[4];
} a = { } a = {
XLAL_REAL4_FAIL_NAN_INT}; XLAL_REAL4_FAIL_NAN_INT};
volatile union { volatile union {
REAL4 x; REAL4 x;
unsigned char s[4]; unsigned char s[4];
} b; } b;
size_t n; size_t n;
b.x = val; b.x = val;
for (n = 0; n < sizeof(val); ++n) for (n = 0; n < sizeof(val); ++n)
if (a.s[n] != b.s[n]) if (a.s[n] != b.s[n])
return 0; return 0;
return 1; return 1;
} }
#endif /* SWIG */
/** Tests if a value is an XLAL <tt>REAL8</tt> failure NaN. */ /** Tests if a value is an XLAL <tt>REAL8</tt> failure NaN. */
static int UNUSED XLALIsREAL8FailNaN(REAL8 val) static _LAL_INLINE_ int XLALIsREAL8FailNaN(REAL8 val);
#ifndef SWIG /* exclude from SWIG interface */
static _LAL_INLINE_ int XLALIsREAL8FailNaN(REAL8 val)
{ {
volatile const union { volatile const union {
INT8 i; INT8 i;
unsigned char s[8]; unsigned char s[8];
} a = { } a = {
XLAL_REAL8_FAIL_NAN_INT}; XLAL_REAL8_FAIL_NAN_INT};
volatile union { volatile union {
REAL8 x; REAL8 x;
unsigned char s[8]; unsigned char s[8];
} b; } b;
size_t n; size_t n;
b.x = val; b.x = val;
for (n = 0; n < sizeof(val); ++n) for (n = 0; n < sizeof(val); ++n)
if (a.s[n] != b.s[n]) if (a.s[n] != b.s[n])
return 0; return 0;
return 1; return 1;
} }
#endif /* SWIG */
#undef UNUSED
/* Here are the macro constants for the fail NaNs. */ /* Here are the macro constants for the fail NaNs. */
#define XLAL_REAL4_FAIL_NAN ( XLALREAL4FailNaN() ) /**< Floating-point valu e of the XLAL <tt>REAL4</tt> failure NaN. */ #define XLAL_REAL4_FAIL_NAN ( XLALREAL4FailNaN() ) /**< Floating-point valu e of the XLAL <tt>REAL4</tt> failure NaN. */
#define XLAL_REAL8_FAIL_NAN ( XLALREAL8FailNaN() ) /**< Floating-point valu e of the XLAL <tt>REAL8</tt> failure NaN. */ #define XLAL_REAL8_FAIL_NAN ( XLALREAL8FailNaN() ) /**< Floating-point valu e of the XLAL <tt>REAL8</tt> failure NaN. */
/* Here are the macros to test for fail NaNs. */ /* Here are the macros to test for fail NaNs. */
#define XLAL_IS_REAL4_FAIL_NAN(val) XLALIsREAL4FailNaN(val) /**< Tests if < tt>val</tt> is a XLAL <tt>REAL4</tt> failure NaN. */ #define XLAL_IS_REAL4_FAIL_NAN(val) XLALIsREAL4FailNaN(val) /**< Tests if < tt>val</tt> is a XLAL <tt>REAL4</tt> failure NaN. */
#define XLAL_IS_REAL8_FAIL_NAN(val) XLALIsREAL8FailNaN(val) /**< Tests if < tt>val</tt> is a XLAL <tt>REAL8</tt> failure NaN. */ #define XLAL_IS_REAL8_FAIL_NAN(val) XLALIsREAL8FailNaN(val) /**< Tests if < tt>val</tt> is a XLAL <tt>REAL8</tt> failure NaN. */
/** XLAL error numbers and return values. */ /** XLAL error numbers and return values. */
skipping to change at line 568 skipping to change at line 596
/* /*
* *
* Here are the routines and macros that are used to report errors when * Here are the routines and macros that are used to report errors when
* an XLAL function fails. They (i) set the XLAL error number and (ii) * an XLAL function fails. They (i) set the XLAL error number and (ii)
* invoke the XLAL error handler. The macros also (iii) return the * invoke the XLAL error handler. The macros also (iii) return the
* appropriate failure codes. The macros should be used to report all * appropriate failure codes. The macros should be used to report all
* failures. * failures.
* *
*/ */
/** Routine to set the XLAL error number and invoke the XLAL error handler. /**
* It is used by the error macros. */ * Routine to set the XLAL error number and invoke the XLAL error handler.
* It is used by the error macros.
*/
void XLALError(const char *func, void XLALError(const char *func,
/**< name of function where the error occurs */ /**< name of function where the error occurs */
const char *file, const char *file,
/**< source file name (use the __FILE__ macro) */ /**< source file name (use the __FILE__ macro) */
int line, /**< source line number (use the __LINE__ macro) */ int line, /**< source line number (use the __LINE__ macro) */
int errnum /**< error code */ int errnum /**< error code */
); );
/** \brief Macro to invoke the <tt>XLALError()</tt> function and return /**
* \brief Macro to invoke the <tt>XLALError()</tt> function and return
* with code val (it should not really be used itself, but forms the basis for * with code val (it should not really be used itself, but forms the basis for
* other macros). * other macros).
* *
* Prototype: <b>XLAL_ERROR_VAL(val, errnum [, fmt [, ...]])</b> * Prototype: <b>XLAL_ERROR_VAL(val, errnum [, fmt [, ...]])</b>
* *
* \b Parameters:<ul> * \b Parameters:<ul>
* <li> \b val The value to return. * <li> \b val The value to return.
* <li> \b errnum The XLAL error number to set. * <li> \b errnum The XLAL error number to set.
* <li> \b fmt (Optional) Format string for additional error information. * <li> \b fmt (Optional) Format string for additional error information.
* <li> \b ... (Optional) Additional arguments for printf-like format. * <li> \b ... (Optional) Additional arguments for printf-like format.
skipping to change at line 603 skipping to change at line 634
/* Helper macro for internal use only */ /* Helper macro for internal use only */
#define XLAL_ERROR_VAL_(val, errnum, fmt, ...) \ #define XLAL_ERROR_VAL_(val, errnum, fmt, ...) \
do { \ do { \
if (fmt) { \ if (fmt) { \
XLAL_PRINT_ERROR(fmt, __VA_ARGS__); \ XLAL_PRINT_ERROR(fmt, __VA_ARGS__); \
} \ } \
XLALError(__func__, __FILE__, __LINE__, errnum); \ XLALError(__func__, __FILE__, __LINE__, errnum); \
return val; \ return val; \
} while (0) } while (0)
/** Macro to invoke a failure from a XLAL routine returning an integer. /**
* Macro to invoke a failure from a XLAL routine returning an integer.
* *
* Prototype: <b>XLAL_ERROR(errnum [, fmt [, ...]])</b> * Prototype: <b>XLAL_ERROR(errnum [, fmt [, ...]])</b>
* *
* \b Parameters:<ul> * \b Parameters:<ul>
* <li> \b errnum The XLAL error number to set. * <li> \b errnum The XLAL error number to set.
* <li> \b fmt (Optional) Format string for additional error informatio n. * <li> \b fmt (Optional) Format string for additional error informatio n.
* <li> \b ... (Optional) Additional arguments for printf-like format. * <li> \b ... (Optional) Additional arguments for printf-like format.
* </ul> * </ul>
*/ */
#define XLAL_ERROR(...) XLAL_ERROR_VAL(XLAL_FAILURE, __VA_ARGS__) #define XLAL_ERROR(...) XLAL_ERROR_VAL(XLAL_FAILURE, __VA_ARGS__)
/** Macro to invoke a failure from a XLAL routine returning a pointer. /**
* Macro to invoke a failure from a XLAL routine returning a pointer.
* *
* Prototype: <b>XLAL_ERROR_NULL(errnum [, fmt [, ...]])</b> * Prototype: <b>XLAL_ERROR_NULL(errnum [, fmt [, ...]])</b>
* *
* \b Parameters:<ul> * \b Parameters:<ul>
* <li> \b errnum The XLAL error number to set. * <li> \b errnum The XLAL error number to set.
* <li> \b fmt (Optional) Format string for additional error information. * <li> \b fmt (Optional) Format string for additional error information.
* <li> \b ... (Optional) Additional arguments for printf-like format. * <li> \b ... (Optional) Additional arguments for printf-like format.
* </ul> * </ul>
*/ */
#define XLAL_ERROR_NULL(...) XLAL_ERROR_VAL(NULL, __VA_ARGS__) #define XLAL_ERROR_NULL(...) XLAL_ERROR_VAL(NULL, __VA_ARGS__)
/** \brief Macro to invoke a failure from a XLAL routine returning void. /**
* \brief Macro to invoke a failure from a XLAL routine returning void.
* *
* Prototype: <b>XLAL_ERROR_VOID(errnum [, fmt [, ...]])</b> * Prototype: <b>XLAL_ERROR_VOID(errnum [, fmt [, ...]])</b>
* *
* \b Parameters:<ul> * \b Parameters:<ul>
* <li> \b errnum The XLAL error number to set. * <li> \b errnum The XLAL error number to set.
* <li> \b fmt (Optional) Format string for additional error information. * <li> \b fmt (Optional) Format string for additional error information.
* <li> \b ... (Optional) Additional arguments for printf-like format. * <li> \b ... (Optional) Additional arguments for printf-like format.
* </ul> * </ul>
*/ */
#define XLAL_ERROR_VOID(...) XLAL_ERROR_VAL(/* void */, __VA_ARGS__) #define XLAL_ERROR_VOID(...) XLAL_ERROR_VAL(/* void */, __VA_ARGS__)
/** \brief Macro to invoke a failure from a XLAL routine returning a <tt>RE /**
AL4</tt>. * \brief Macro to invoke a failure from a XLAL routine returning a <tt>REA
L4</tt>.
* *
* Prototype: <b>XLAL_ERROR_REAL4(errnum [, fmt [, ...]])</b> * Prototype: <b>XLAL_ERROR_REAL4(errnum [, fmt [, ...]])</b>
* *
* \b Parameters:<ul> * \b Parameters:<ul>
* <li> \b errnum The XLAL error number to set. * <li> \b errnum The XLAL error number to set.
* <li> \b fmt (Optional) Format string for additional error information. * <li> \b fmt (Optional) Format string for additional error information.
* <li> \b ... (Optional) Additional arguments for printf-like format. * <li> \b ... (Optional) Additional arguments for printf-like format.
* </ul> * </ul>
*/ */
#define XLAL_ERROR_REAL4(...) XLAL_ERROR_VAL(XLAL_REAL4_FAIL_NAN, __VA_ARGS __) #define XLAL_ERROR_REAL4(...) XLAL_ERROR_VAL(XLAL_REAL4_FAIL_NAN, __VA_ARGS __)
/** * \brief Macro to invoke a failure from a XLAL routine returning a <tt /**
>REAL8</tt>. * \brief Macro to invoke a failure from a XLAL routine returning a <tt>REA
L8</tt>.
* *
* Prototype <b>XLAL_ERROR_REAL8(errnum [, fmt [, ...]])</b> * Prototype <b>XLAL_ERROR_REAL8(errnum [, fmt [, ...]])</b>
* *
* \b Parameters:<ul> * \b Parameters:<ul>
* <li> \b errnum The XLAL error number to set. * <li> \b errnum The XLAL error number to set.
* <li> \b fmt (Optional) Format string for additional error information. * <li> \b fmt (Optional) Format string for additional error information.
* <li> \b ... (Optional) Additional arguments for printf-like format. * <li> \b ... (Optional) Additional arguments for printf-like format.
* </ul> * </ul>
*/ */
#define XLAL_ERROR_REAL8(...) XLAL_ERROR_VAL(XLAL_REAL8_FAIL_NAN, __VA_ARGS __) #define XLAL_ERROR_REAL8(...) XLAL_ERROR_VAL(XLAL_REAL8_FAIL_NAN, __VA_ARGS __)
/** \brief Macro to test an assertion; if it is not true, invoke the /**
* \brief Macro to test an assertion; if it is not true, invoke the
* <tt>XLALError()</tt> function and return with code val (it should not re ally * <tt>XLALError()</tt> function and return with code val (it should not re ally
* be used itself, but forms the basis for other macros). * be used itself, but forms the basis for other macros).
* *
* Prototype: <b>XLAL_CHECK_VAL(val, assertion, errnum [, fmt [, ...]])</b> * Prototype: <b>XLAL_CHECK_VAL(val, assertion, errnum [, fmt [, ...]])</b>
* *
* \b Parameters:<ul> * \b Parameters:<ul>
* <li> \b val The value to return. * <li> \b val The value to return.
* <li> \b assertion The assertion to test. * <li> \b assertion The assertion to test.
* <li> \b errnum The XLAL error number to set if the assertion is false. * <li> \b errnum The XLAL error number to set if the assertion is false.
* <li> \b fmt (Optional) Format string for additional error information. * <li> \b fmt (Optional) Format string for additional error information.
skipping to change at line 693 skipping to change at line 730
if (fmt) { \ if (fmt) { \
XLAL_PRINT_ERROR(fmt, __VA_ARGS__); \ XLAL_PRINT_ERROR(fmt, __VA_ARGS__); \
} else { \ } else { \
XLAL_PRINT_ERROR("Check failed: " #assertion ); \ XLAL_PRINT_ERROR("Check failed: " #assertion ); \
} \ } \
XLALError(__func__, __FILE__, __LINE__, errnum); \ XLALError(__func__, __FILE__, __LINE__, errnum); \
return val; \ return val; \
} \ } \
} while (0) } while (0)
/** * \brief Macro to test an assertion and invoke a failure if it is not /**
true * \brief Macro to test an assertion and invoke a failure if it is not true
* in a function that returns an integer. * in a function that returns an integer.
* *
* Prototype: <b>XLAL_CHECK(assertion, errnum [, fmt [, ...]])</b> * Prototype: <b>XLAL_CHECK(assertion, errnum [, fmt [, ...]])</b>
* *
* \b Parameters:<ul> * \b Parameters:<ul>
* <li> \b assertion The assertion to test. * <li> \b assertion The assertion to test.
* <li> \b errnum The XLAL error number to set if the assertion is false. * <li> \b errnum The XLAL error number to set if the assertion is false.
* <li> \b fmt (Optional) Format string for additional error information. * <li> \b fmt (Optional) Format string for additional error information.
* <li> \b ... (Optional) Additional arguments for printf-like format. * <li> \b ... (Optional) Additional arguments for printf-like format.
* </ul> * </ul>
*/ */
#define XLAL_CHECK(assertion, ...) \ #define XLAL_CHECK(assertion, ...) \
XLAL_CHECK_VAL(XLAL_FAILURE, assertion, __VA_ARGS__) XLAL_CHECK_VAL(XLAL_FAILURE, assertion, __VA_ARGS__)
/** \brief Macro to test an assertion and invoke a failure if it is not tru /**
e * \brief Macro to test an assertion and invoke a failure if it is not true
* in a function that returns a pointer. * in a function that returns a pointer.
* *
* Prototype: <b>XLAL_CHECK_NULL(assertion, errnum [, fmt [, ...]])</b> * Prototype: <b>XLAL_CHECK_NULL(assertion, errnum [, fmt [, ...]])</b>
* *
* \b Parameters:<ul> * \b Parameters:<ul>
* <li> \b assertion The assertion to test. * <li> \b assertion The assertion to test.
* <li> \b errnum The XLAL error number to set if the assertion is false. * <li> \b errnum The XLAL error number to set if the assertion is false.
* <li> \b fmt (Optional) Format string for additional error information. * <li> \b fmt (Optional) Format string for additional error information.
* <li> \b ... (Optional) Additional arguments for printf-like format. * <li> \b ... (Optional) Additional arguments for printf-like format.
* </ul> * </ul>
*/ */
#define XLAL_CHECK_NULL(assertion, ...) \ #define XLAL_CHECK_NULL(assertion, ...) \
XLAL_CHECK_VAL(NULL, assertion, __VA_ARGS__) XLAL_CHECK_VAL(NULL, assertion, __VA_ARGS__)
/** \brief Macro to test an assertion and invoke a failure if it is not tru /**
e * \brief Macro to test an assertion and invoke a failure if it is not true
* in a function that returns void. * in a function that returns void.
* *
* Prototype: <b>XLAL_CHECK_VOID(assertion, errnum [, fmt [, ...]])</b> * Prototype: <b>XLAL_CHECK_VOID(assertion, errnum [, fmt [, ...]])</b>
* *
* \b Parameters:<ul> * \b Parameters:<ul>
* <li> \b assertion The assertion to test. * <li> \b assertion The assertion to test.
* <li> \b errnum The XLAL error number to set if the assertion is false. * <li> \b errnum The XLAL error number to set if the assertion is false.
* <li> \b fmt (Optional) Format string for additional error information. * <li> \b fmt (Optional) Format string for additional error information.
* <li> \b ... (Optional) Additional arguments for printf-like format. * <li> \b ... (Optional) Additional arguments for printf-like format.
* </ul> * </ul>
*/ */
#define XLAL_CHECK_VOID(assertion, ...) \ #define XLAL_CHECK_VOID(assertion, ...) \
XLAL_CHECK_VAL(/* void */, assertion, __VA_ARGS__) XLAL_CHECK_VAL(/* void */, assertion, __VA_ARGS__)
/** \brief Macro to test an assertion and invoke a failure if it is not tru /**
e * \brief Macro to test an assertion and invoke a failure if it is not true
* in a function that returns a <tt>REAL4</tt>. * in a function that returns a <tt>REAL4</tt>.
* *
* Prototype: <b>XLAL_CHECK_REAL4(assertion, errnum [, fmt [, ...]])</b> * Prototype: <b>XLAL_CHECK_REAL4(assertion, errnum [, fmt [, ...]])</b>
* *
* \b Parameters:<ul> * \b Parameters:<ul>
* <li> \b assertion The assertion to test. * <li> \b assertion The assertion to test.
* <li> \b errnum The XLAL error number to set if the assertion is false. * <li> \b errnum The XLAL error number to set if the assertion is false.
* <li> \b fmt (Optional) Format string for additional error information. * <li> \b fmt (Optional) Format string for additional error information.
* <li> \b ... (Optional) Additional arguments for printf-like format. * <li> \b ... (Optional) Additional arguments for printf-like format.
* </ul> * </ul>
*/ */
#define XLAL_CHECK_REAL4(assertion, ...) \ #define XLAL_CHECK_REAL4(assertion, ...) \
XLAL_CHECK_VAL(XLAL_REAL4_FAIL_NAN, assertion, __VA_ARGS__) XLAL_CHECK_VAL(XLAL_REAL4_FAIL_NAN, assertion, __VA_ARGS__)
/** \brief Macro to test an assertion and invoke a failure if it is not tru /**
e * \brief Macro to test an assertion and invoke a failure if it is not true
* in a function that returns a <tt>REAL8</tt>. * in a function that returns a <tt>REAL8</tt>.
* *
* Prototype: <b>XLAL_CHECK_REAL8(assertion, errnum [, fmt [, ...]])</b> * Prototype: <b>XLAL_CHECK_REAL8(assertion, errnum [, fmt [, ...]])</b>
* *
* \b Parameters:<ul> * \b Parameters:<ul>
* <li> \b assertion The assertion to test. * <li> \b assertion The assertion to test.
* <li> \b errnum The XLAL error number to set if the assertion is false. * <li> \b errnum The XLAL error number to set if the assertion is false.
* <li> \b fmt (Optional) Format string for additional error information. * <li> \b fmt (Optional) Format string for additional error information.
* <li> \b ... (Optional) Additional arguments for printf-like format. * <li> \b ... (Optional) Additional arguments for printf-like format.
* </ul> * </ul>
 End of changes. 35 change blocks. 
55 lines changed or deleted 93 lines changed or added


 ZPGFilter.h   ZPGFilter.h 
skipping to change at line 32 skipping to change at line 32
#include <lal/LALStdlib.h> #include <lal/LALStdlib.h>
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#elif 0 #elif 0
} /* so that editors will match preceding brace */ } /* so that editors will match preceding brace */
#endif #endif
/** /**
\addtogroup ZPGFilter_h * \addtogroup ZPGFilter_h
\author Creighton, T. D. * \author Creighton, T. D.
*
\brief Provides routines to manipulate ZPG filters. * \brief Provides routines to manipulate ZPG filters.
*
\heading{Synopsis} * ### Synopsis ###
\code *
#include <lal/ZPGFilter.h> * \code
\endcode * #include <lal/ZPGFilter.h>
* \endcode
This header covers routines that create, destroy, and *
transform objects of type <tt>\<datatype\>ZPGFilter</tt>, where * This header covers routines that create, destroy, and
<tt>\<datatype\></tt> is either \c COMPLEX8 or \c COMPLEX16. * transform objects of type <tt>\<datatype\>ZPGFilter</tt>, where
Generically, these data types can be used to store any rational * <tt>\<datatype\></tt> is either \c COMPLEX8 or \c COMPLEX16.
complex function in a factored form. Normally this function is a * Generically, these data types can be used to store any rational
filter response, or "transfer function" \f$T(z)\f$, expressed in terms * complex function in a factored form. Normally this function is a
of a complex frequency parameter \f$z=\exp(2\pi if\Delta t)\f$, where * filter response, or "transfer function" \f$T(z)\f$, expressed in terms
\f$\Delta t\f$ is the sampling interval. The rational function is * of a complex frequency parameter \f$z=\exp(2\pi if\Delta t)\f$, where
factored as follows: * \f$\Delta t\f$ is the sampling interval. The rational function is
\f[ * factored as follows:
T(f) = g\times\frac{\prod_k (z-a_k)}{\prod_l (z-b_l)} * \f[
\f] * T(f) = g\times\frac{\prod_k (z-a_k)}{\prod_l (z-b_l)}
where \f$g\f$ is the gain, \f$a_k\f$ are the (finite) zeros, and \f$b_l\f$ * \f]
are the * where \f$g\f$ is the gain, \f$a_k\f$ are the (finite) zeros, and \f$b_l\
(finite) poles. It should be noted that rational functions always f$ are the
have the same number of zeros as poles if one includes the point * (finite) poles. It should be noted that rational functions always
\f$z=\infty\f$; any excess in the number of finite zeros or poles in the * have the same number of zeros as poles if one includes the point
rational expression simply indicates that there is a corresponding * \f$z=\infty\f$; any excess in the number of finite zeros or poles in the
pole or zero of that order at infinity. It is also worth pointing out * rational expression simply indicates that there is a corresponding
that the "gain" is just the overall prefactor of this rational * pole or zero of that order at infinity. It is also worth pointing out
function, and is not necessarily equal to the actual gain of the * that the "gain" is just the overall prefactor of this rational
transfer function at any particular frequency. * function, and is not necessarily equal to the actual gain of the
* transfer function at any particular frequency.
Another common complex frequency space is the \f$w\f$-space, obtained *
from the \f$z\f$-space by the bilinear transformation: * Another common complex frequency space is the \f$w\f$-space, obtained
\f[ * from the \f$z\f$-space by the bilinear transformation:
w = i\left(\frac{1-z}{1+z}\right) = \tan(\pi f\Delta t) , \quad * \f[
z = \frac{1+iw}{1-iw} \; . * w = i\left(\frac{1-z}{1+z}\right) = \tan(\pi f\Delta t) , \quad
\f] * z = \frac{1+iw}{1-iw} \; .
Other variables can also be used to represent the complex frequency * \f]
plane. The <tt>\<datatype\>ZPGFilter</tt> structure can be used to * Other variables can also be used to represent the complex frequency
represent the transfer function in any of these spaces by transforming * plane. The <tt>\<datatype\>ZPGFilter</tt> structure can be used to
the coordinates of the zeros and poles, and incorporating any residual * represent the transfer function in any of these spaces by transforming
factors into the gain. Care must be taken to include any zeros or * the coordinates of the zeros and poles, and incorporating any residual
poles that are brought in from infinity by the transformation, and to * factors into the gain. Care must be taken to include any zeros or
remove any zeros or poles which were sent to infinity. Thus the * poles that are brought in from infinity by the transformation, and to
number of zeros and poles of the <tt>\<datatype\>ZPGFilter</tt> is not * remove any zeros or poles which were sent to infinity. Thus the
necessarily constant under transformations! Routines invoking the * number of zeros and poles of the <tt>\<datatype\>ZPGFilter</tt> is not
<tt>\<datatype\>ZPGFilter</tt> data types should document which complex * necessarily constant under transformations! Routines invoking the
variable is assumed. * <tt>\<datatype\>ZPGFilter</tt> data types should document which complex
* variable is assumed.
*/ *
*/
/*@{*/ /*@{*/
/** /**
@{ * @{
\defgroup CreateZPGFilter_c Module CreateZPGFilter.c * \defgroup CreateZPGFilter_c Module CreateZPGFilter.c
\defgroup DestroyZPGFilter_c Module DestroyZPGFilter.c * \defgroup DestroyZPGFilter_c Module DestroyZPGFilter.c
\defgroup BilinearTransform_c Module BilinearTransform.c * \defgroup BilinearTransform_c Module BilinearTransform.c
@} * @}
*/ */
/** \name Error Codes */ /** \name Error Codes */
/*@{*/ /*@{*/
#define ZPGFILTERH_ENUL 1 /**< Unexpected null pointer in arguments */ #define ZPGFILTERH_ENUL 1 /**< Unexpected null pointer in arguments */
#define ZPGFILTERH_EOUT 2 /**< Output handle points to a non-null poin ter */ #define ZPGFILTERH_EOUT 2 /**< Output handle points to a non-null poin ter */
#define ZPGFILTERH_EMEM 3 /**< Memory allocation error */ #define ZPGFILTERH_EMEM 3 /**< Memory allocation error */
#define ZPGFILTERH_EBAD 4 /**< Bad filter parameters */ #define ZPGFILTERH_EBAD 4 /**< Bad filter parameters */
/*@}*/ /*@}*/
/*@}*/ /*@}*/
 End of changes. 2 change blocks. 
58 lines changed or deleted 59 lines changed or added


 lalswig_test.i   lalswig_test.i 
// Tests of SWIG interface code // Tests of SWIG interface code
// Author: Karl Wette, 2011, 2012 // Author: Karl Wette, 2011, 2012
// Test various combinations of 1D and 2D fixed arrays with // Test various combinations of 1D and 2D fixed arrays
// structs, struct/enum type, and global variables (LAL only). // with structs, struct/enum type, and global variables.
typedef enum { typedef enum {
lalswig_test_enum_a, swig_lal_test_enum_a,
lalswig_test_enum_b, swig_lal_test_enum_b,
lalswig_test_enum_c swig_lal_test_enum_c
} lalswig_test_enum; } swig_lal_test_enum;
typedef struct taglalswig_test_struct { typedef struct tagswig_lal_test_struct {
int n;
INT4 i; INT4 i;
REAL4 f; REAL4 f;
CHAR str[10]; CHAR str[10];
INT4 vec[3]; INT4 vec[3];
INT4 mat[2][3]; INT4 mat[2][3];
lalswig_test_enum evec[3]; swig_lal_test_enum evec[3];
} lalswig_test_struct; } swig_lal_test_struct;
static const lalswig_test_struct lalswig_test_struct_const = { static const swig_lal_test_struct swig_lal_test_struct_const = {
3, 5.7, "abcde", {1,2,3}, {{4,5,6},{7,8,9}}, 2, 3, 5.7, "abcde", {1,2,3}, {{4,5,6},{7,8,9}},
{lalswig_test_enum_a,lalswig_test_enum_b,lalswig_test_enum_c} {swig_lal_test_enum_a,swig_lal_test_enum_b,swig_lal_test_enum_c}
}; };
static lalswig_test_struct lalswig_test_struct_vector[3]; static swig_lal_test_struct swig_lal_test_struct_vector[3];
static lalswig_test_struct lalswig_test_struct_matrix[2][3]; static swig_lal_test_struct swig_lal_test_struct_matrix[2][3];
static lalswig_test_enum lalswig_test_enum_vector[3]; static swig_lal_test_enum swig_lal_test_enum_vector[3];
static lalswig_test_enum lalswig_test_enum_matrix[2][3]; static swig_lal_test_enum swig_lal_test_enum_matrix[2][3];
static INT4 lalswig_test_empty_INT4_vector[0]; static INT4 swig_lal_test_empty_INT4_vector[0];
static INT4 lalswig_test_INT4_vector[3]; static INT4 swig_lal_test_INT4_vector[3];
static INT4 lalswig_test_INT4_matrix[2][3]; static INT4 swig_lal_test_INT4_matrix[2][3];
static const INT4 lalswig_test_INT4_const_vector[3] = {1, 2, 4}; static const INT4 swig_lal_test_INT4_const_vector[3] = {1, 2, 4};
static const INT4 lalswig_test_INT4_const_matrix[2][3] = {{1, 2, 4}, {2, 4, static const INT4 swig_lal_test_INT4_const_matrix[2][3] = {{1, 2, 4}, {2, 4
8}}; , 8}};
static REAL8 lalswig_test_REAL8_vector[3]; static REAL8 swig_lal_test_REAL8_vector[3];
static REAL8 lalswig_test_REAL8_matrix[2][3]; static REAL8 swig_lal_test_REAL8_matrix[2][3];
static COMPLEX8 lalswig_test_COMPLEX8_vector[3]; static COMPLEX8 swig_lal_test_COMPLEX8_vector[3];
static COMPLEX8 lalswig_test_COMPLEX8_matrix[2][3]; static COMPLEX8 swig_lal_test_COMPLEX8_matrix[2][3];
// Test fixed and dynamic arrays typemaps.
static void swig_lal_test_copyin_array1(REAL8 INPUT[3], REAL8 scale, REAL8
OUTPUT[3]);
static void swig_lal_test_copyin_array2(INT4 INPUT[3][2], INT4 scale, INT4
OUTPUT[3][2]);
#ifdef SWIG
%header %{
static void swig_lal_test_copyin_array1(REAL8 INPUT[3], REAL8 scale, REAL
8 OUTPUT[3]) {
for (int i = 0; i < 3; ++i) OUTPUT[i] = scale * INPUT[i];
}
static void swig_lal_test_copyin_array2(INT4 INPUT[3][2], INT4 scale, INT
4 OUTPUT[3][2]) {
for (int i = 0; i < 3; ++i) for (int j = 0; j < 2; ++j) OUTPUT[i][j] =
scale * INPUT[i][j];
}
%}
#endif // SWIG
// Test dynamic array of pointer access // Test dynamic array of pointer access
typedef struct taglalswig_test_arrayofdata { typedef struct tagswig_lal_test_arrayofdata {
#ifdef SWIG #ifdef SWIG
SWIGLAL(ARRAY_1D(lalswig_test_arrayofdata, INT4, data, UINT4, length)); SWIGLAL(ARRAY_1D(swig_lal_test_arrayofdata, INT4, data, UINT4, length));
#endif // SWIG #endif // SWIG
UINT4 length; UINT4 length;
INT4 *data; INT4 *data;
} lalswig_test_arrayofdata; } swig_lal_test_arrayofdata;
typedef struct taglalswig_test_arrayofptrs { typedef struct tagswig_lal_test_arrayofptrs {
#ifdef SWIG #ifdef SWIG
SWIGLAL(ARRAY_1D(lalswig_test_arrayofptrs, lalswig_test_arrayofdata*, dat a, UINT4, length)); SWIGLAL(ARRAY_1D(swig_lal_test_arrayofptrs, swig_lal_test_arrayofdata*, d ata, UINT4, length));
#endif // SWIG #endif // SWIG
UINT4 length; UINT4 length;
lalswig_test_arrayofdata **data; swig_lal_test_arrayofdata **data;
} lalswig_test_arrayofptrs; } swig_lal_test_arrayofptrs;
static lalswig_test_arrayofptrs* lalswig_test_Create_arrayofptrs(UINT4); static swig_lal_test_arrayofptrs* swig_lal_test_Create_arrayofptrs(UINT4);
static void lalswig_test_Destroy_arrayofptrs(lalswig_test_arrayofptrs*); static void swig_lal_test_Destroy_arrayofptrs(swig_lal_test_arrayofptrs*);
#ifdef SWIG #ifdef SWIG
%header %{ %header %{
static lalswig_test_arrayofptrs* lalswig_test_Create_arrayofptrs(UINT4 le static swig_lal_test_arrayofptrs* swig_lal_test_Create_arrayofptrs(UINT4
ngth) { length) {
lalswig_test_arrayofptrs* ap = (lalswig_test_arrayofptrs*)XLALMalloc(si swig_lal_test_arrayofptrs* ap = (swig_lal_test_arrayofptrs*)XLALMalloc(
zeof(lalswig_test_arrayofptrs)); sizeof(swig_lal_test_arrayofptrs));
XLAL_CHECK_NULL(ap != NULL, XLAL_ENOMEM); XLAL_CHECK_NULL(ap != NULL, XLAL_ENOMEM);
ap->length = length; ap->length = length;
ap->data = (lalswig_test_arrayofdata**)XLALCalloc(ap->length, sizeof(la lswig_test_arrayofdata*)); ap->data = (swig_lal_test_arrayofdata**)XLALCalloc(ap->length, sizeof(s wig_lal_test_arrayofdata*));
XLAL_CHECK_NULL(ap->data != NULL, XLAL_ENOMEM); XLAL_CHECK_NULL(ap->data != NULL, XLAL_ENOMEM);
for (UINT4 i = 0; i < ap->length; ++i) { for (UINT4 i = 0; i < ap->length; ++i) {
ap->data[i] = (lalswig_test_arrayofdata*)XLALMalloc(sizeof(lalswig_te st_arrayofdata)); ap->data[i] = (swig_lal_test_arrayofdata*)XLALMalloc(sizeof(swig_lal_ test_arrayofdata));
XLAL_CHECK_NULL(ap->data[i] != NULL, XLAL_ENOMEM); XLAL_CHECK_NULL(ap->data[i] != NULL, XLAL_ENOMEM);
ap->data[i]->length = 2*length; ap->data[i]->length = 2*length;
ap->data[i]->data = (INT4*)XLALCalloc(ap->data[i]->length, sizeof(INT 4)); ap->data[i]->data = (INT4*)XLALCalloc(ap->data[i]->length, sizeof(INT 4));
XLAL_CHECK_NULL(ap->data[i]->data != NULL, XLAL_ENOMEM); XLAL_CHECK_NULL(ap->data[i]->data != NULL, XLAL_ENOMEM);
for (UINT4 j = 0; j < ap->data[i]->length; ++j) { for (UINT4 j = 0; j < ap->data[i]->length; ++j) {
ap->data[i]->data[j] = 42*length*i + j; ap->data[i]->data[j] = 42*length*i + j;
} }
} }
return ap; return ap;
} }
static void lalswig_test_Destroy_arrayofptrs(lalswig_test_arrayofptrs* ap ) { static void swig_lal_test_Destroy_arrayofptrs(swig_lal_test_arrayofptrs* ap) {
if (ap) { if (ap) {
if (ap->data) { if (ap->data) {
for (UINT4 i = 0; i < ap->length; ++i) { for (UINT4 i = 0; i < ap->length; ++i) {
if (ap->data[i]) { if (ap->data[i]) {
if (ap->data[i]->data) { if (ap->data[i]->data) {
XLALFree(ap->data[i]->data); XLALFree(ap->data[i]->data);
} }
XLALFree(ap->data[i]); XLALFree(ap->data[i]);
} }
} }
XLALFree(ap->data); XLALFree(ap->data);
} }
XLALFree(ap); XLALFree(ap);
} }
} }
%} %}
#endif // SWIG #endif // SWIG
// Test LIGOTimeGPS operations. // Test LIGOTimeGPS operations.
typedef struct taglalswig_test_gps { typedef struct tagswig_lal_test_gps {
LIGOTimeGPS t; LIGOTimeGPS t;
} lalswig_test_gps; } swig_lal_test_gps;
static REAL8 lalswig_test_noptrgps(const LIGOTimeGPS gps); static REAL8 swig_lal_test_noptrgps(const LIGOTimeGPS gps);
#ifdef SWIG #ifdef SWIG
%header %{ %header %{
static REAL8 lalswig_test_noptrgps(const LIGOTimeGPS gps) { static REAL8 swig_lal_test_noptrgps(const LIGOTimeGPS gps) {
return XLALGPSGetREAL8(&gps); return XLALGPSGetREAL8(&gps);
} }
%} %}
#endif // SWIG #endif // SWIG
 End of changes. 16 change blocks. 
46 lines changed or deleted 66 lines changed or added


 swiglal_common.i   swiglal_common.i 
skipping to change at line 157 skipping to change at line 157
#else #else
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdbool.h> #include <stdbool.h>
#include <complex.h> #include <complex.h>
#endif #endif
%} %}
// Remove LAL macros for certain keywords.
#define _LAL_INLINE_
#define _LAL_RESTRICT_
// If necessary, redefine 'restrict' keyword for C++ code.
%header %{
#ifdef __cplusplus
# ifndef restrict
# if defined __GNUC__
# define restrict __restrict__
# else
# define restrict
# endif
# endif
#endif
%}
// Include SWIG configuration header generated from 'config.h'.
%header %{
#include <swig_config.h>
%}
// Include LAL headers. // Include LAL headers.
%header %{ %header %{
#include <lal/LALDatatypes.h> #include <lal/LALDatatypes.h>
#include <lal/LALMalloc.h> #include <lal/LALMalloc.h>
#include <lal/XLALError.h> #include <lal/XLALError.h>
#include <lal/Date.h> #include <lal/Date.h>
%} %}
// Version of SWIG used to generate wrapping code. // Version of SWIG used to generate wrapping code.
%inline %{const int swig_version = SWIG_VERSION;%} %constant int swig_version = SWIG_VERSION;
// Whether wrapping code was generated in debug mode.
#ifdef NDEBUG
%inline %{const bool swig_debug = false;%}
#else
%inline %{const bool swig_debug = true;%}
#endif
// Constructors for GSL complex numbers, if required. // Constructors for GSL complex numbers, if required.
#ifdef HAVE_LIBGSL
%header %{ %header %{
#include <gsl/gsl_complex_math.h> // provides gsl_complex_rect() #ifdef SWIGLAL_HAVE_LIBGSL
SWIGINTERNINLINE gsl_complex_float gsl_complex_float_rect(float x, float #include <gsl/gsl_complex_math.h> // provides gsl_complex_rect()
y) { SWIGINTERNINLINE gsl_complex_float gsl_complex_float_rect(float x, float y)
gsl_complex_float z; {
GSL_SET_COMPLEX(&z, x, y); gsl_complex_float z;
return z; GSL_SET_COMPLEX(&z, x, y);
} return z;
%} }
#endif #endif
%}
// Convert XLAL/LAL errors into native scripting-language exceptions: // Convert XLAL/LAL errors into native scripting-language exceptions:
// - XLAL: Before performing any action, clear the XLAL error number. // - XLAL: Before performing any action, clear the XLAL error number.
// Check it after the action is performed; if it is non-zero, raise // Check it after the action is performed; if it is non-zero, raise
// a native scripting-language exception with the appropriate XLAL // a native scripting-language exception with the appropriate XLAL
// error message. // error message.
// - LAL: For any function which has a LALStatus* argument, create a // - LAL: For any function which has a LALStatus* argument, create a
// blank LALStatus struct and pass its pointer to the LAL function. // blank LALStatus struct and pass its pointer to the LAL function.
// After the function is called, check the LALStatus statusCode; // After the function is called, check the LALStatus statusCode;
// if it is non-zero, raise a generic XLAL error (to set the XLAL // if it is non-zero, raise a generic XLAL error (to set the XLAL
skipping to change at line 260 skipping to change at line 275
////////// Generate interface ////////// ////////// Generate interface //////////
// The SWIG interface file is generated by 'generate_swiglal_iface.py', whi ch // The SWIG interface file is generated by 'generate_swiglal_iface.py', whi ch
// extracts lists of interface symbols (functions, structs, typedefs to str ucts) // extracts lists of interface symbols (functions, structs, typedefs to str ucts)
// and headers from the preprocessing interface, and generates calls to the // and headers from the preprocessing interface, and generates calls to the
// following macros: // following macros:
// Process an interface function NAME: rename it to RENAME, and set it to // Process an interface function NAME: rename it to RENAME, and set it to
// always return SWIG-owned wrapping objects (unless the function is being // always return SWIG-owned wrapping objects (unless the function is being
// ignored). If IGNORE_TYPE is given, ignore the function's return value. // ignored). If RETN_1STARG is true, define 'swiglal_return_1starg_##NAME'.
// If DISOWN is true, disown the function's first argument. %define %swiglal_process_function(NAME, RENAME, RETN_1STARG)
%define %swiglal_process_function(NAME, RENAME, IGNORE_TYPE, DISOWN)
%rename(#RENAME) NAME; %rename(#RENAME) NAME;
#if #RENAME != "$ignore" #if #RENAME != "$ignore"
%feature("new", "1") NAME; %feature("new", "1") NAME;
#if #IGNORE_TYPE != "" #if RETN_1STARG
%apply SWIGTYPE SWIGLAL_RETURN_VOID { IGNORE_TYPE NAME }; %header {#define swiglal_return_1starg_##NAME}
#endif
#if DISOWN
%feature("del", "1") NAME;
#endif #endif
#endif #endif
%enddef %enddef
// Process a typedef to an interface struct TAGNAME: rename it to RENAME. // Process a typedef to an interface struct TAGNAME: rename it to RENAME.
%define %swiglal_process_tdstruct(TAGNAME, RENAME) %define %swiglal_process_tdstruct(TAGNAME, RENAME)
%rename(#RENAME) TAGNAME; %rename(#RENAME) TAGNAME;
%enddef %enddef
// Do not generate any default (copy) contructors or destructors. // Do not generate any default (copy) contructors or destructors.
skipping to change at line 301 skipping to change at line 312
%enddef %enddef
// Generate constructors and destructors for a struct NAME. // Generate constructors and destructors for a struct NAME.
%define %swiglal_generate_struct_cdtor(NAME, TAGNAME, OPAQUE, DTORFUNC) %define %swiglal_generate_struct_cdtor(NAME, TAGNAME, OPAQUE, DTORFUNC)
// If this is an opaque struct: // If this is an opaque struct:
#if OPAQUE #if OPAQUE
// Create an empty struct to represent the opaque struct, // Create an empty struct to represent the opaque struct,
// so that SWIG has something to attach the destructor to. // so that SWIG has something to attach the destructor to.
// No constructors are generated, since it is assumed that
// the struct will be created internally by some function
// and returned.
struct TAGNAME { struct TAGNAME {
}; };
#else #else
// If there is no XLAL destructor function, this is taken to mean // Generate constructors, using XLALCalloc() to allocate memory.
// this struct can be validly constructed using XLALCalloc(), i.e. %extend TAGNAME {
// it contains no pointers which must also be initialised. TAGNAME() {
#if #DTORFUNC == "" NAME* self = %reinterpret_cast(XLALCalloc(1, sizeof(NAME)), NAME*);
%extend TAGNAME { return self;
TAGNAME() { }
NAME* self = %reinterpret_cast(XLALCalloc(1, sizeof(NAME)), NAME* TAGNAME(NAME* src) {
); NAME* self = %reinterpret_cast(XLALCalloc(1, sizeof(NAME)), NAME*);
return self; memcpy(self, src, sizeof(NAME));
} return self;
TAGNAME(NAME* src) {
NAME* self = %reinterpret_cast(XLALCalloc(1, sizeof(NAME)), NAME*
);
memcpy(self, src, sizeof(NAME));
return self;
}
} }
#endif }
#endif #endif
// If there is no XLAL destructor function, this is taken to mean // Generate destructor, using either the destructor function DTORFUNC,
// this struct can be validly destroyed using XLALFree(), i.e. // or else XLALFree() if DTORFUNC is undefined, to destroy memory.
// it contains no pointers which must first be destroyed. Otherwise,
// use the XLAL destructor function.
#if #DTORFUNC == "" #if #DTORFUNC == ""
%extend TAGNAME { %extend TAGNAME {
~TAGNAME() { ~TAGNAME() {
%swiglal_call_dtor(XLALFree, $self); %swiglal_call_dtor(XLALFree, $self);
} }
} }
#else #else
%extend TAGNAME { %extend TAGNAME {
~TAGNAME() { ~TAGNAME() {
%swiglal_call_dtor(%arg(DTORFUNC), $self); %swiglal_call_dtor(%arg(DTORFUNC), $self);
skipping to change at line 454 skipping to change at line 462
// Call the appropriate conversion function for C TYPE arrays. // Call the appropriate conversion function for C TYPE arrays.
#define %swiglal_array_copyin(TYPE) %swiglal_array_copyin_func($typemap(swi glal_array_typeid, TYPE)) #define %swiglal_array_copyin(TYPE) %swiglal_array_copyin_func($typemap(swi glal_array_typeid, TYPE))
#define %swiglal_array_copyout(TYPE) %swiglal_array_copyout_func($typemap(s wiglal_array_typeid, TYPE)) #define %swiglal_array_copyout(TYPE) %swiglal_array_copyout_func($typemap(s wiglal_array_typeid, TYPE))
#define %swiglal_array_viewout(TYPE) %swiglal_array_viewout_func($typemap(s wiglal_array_typeid, TYPE)) #define %swiglal_array_viewout(TYPE) %swiglal_array_viewout_func($typemap(s wiglal_array_typeid, TYPE))
// //
// Typemaps which convert to/from fixed-size arrays. // Typemaps which convert to/from fixed-size arrays.
// //
// Input typemaps for functions and structs: // Input typemaps for functions and structs:
%typemap(in) SWIGTYPE[ANY], SWIGTYPE INOUT[ANY] { %typemap(in, noblock=1) SWIGTYPE[ANY], SWIGTYPE INOUT[ANY] {
const size_t dims[] = {$1_dim0}; $typemap(swiglal_fixarr_ltype, $1_type) temp$argnum[$1_dim0];
const size_t strides[] = {1}; $1 = &temp$argnum[0];
$typemap(swiglal_fixarr_ltype, $1_type) temp[$1_dim0]; {
$1 = &temp[0]; const size_t dims[] = {$1_dim0};
// swiglal_array_typeid input type: $1_type const size_t strides[] = {1};
int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as // swiglal_array_typeid input type: $1_type
_voidptr($1), int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %
sizeof($1[0]), 1, dims, stride as_voidptr($1),
s, sizeof($1[0]), 1, dim
false, $typemap(swiglal_fixarr s, strides,
_tinfo, $1_type), false, $typemap(swigl
$disown | %convertptr_flags); al_fixarr_tinfo, $1_type),
if (!SWIG_IsOK(ecode)) { $disown | %convertptr
%argument_fail(ecode, "$type", $symname, $argnum); _flags);
if (!SWIG_IsOK(ecode)) {
%argument_fail(ecode, "$type", $symname, $argnum);
}
} }
} }
%typemap(in) SWIGTYPE[ANY][ANY], SWIGTYPE INOUT[ANY][ANY] { %typemap(in, noblock=1) SWIGTYPE[ANY][ANY], SWIGTYPE INOUT[ANY][ANY] {
const size_t dims[] = {$1_dim0, $1_dim1}; $typemap(swiglal_fixarr_ltype, $1_type) temp$argnum[$1_dim0][$1_dim1];
const size_t strides[] = {$1_dim1, 1}; $1 = &temp$argnum[0];
$typemap(swiglal_fixarr_ltype, $1_type) temp[$1_dim0][$1_dim1]; {
$1 = &temp[0]; const size_t dims[] = {$1_dim0, $1_dim1};
// swiglal_array_typeid input type: $1_type const size_t strides[] = {$1_dim1, 1};
int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as // swiglal_array_typeid input type: $1_type
_voidptr($1), int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %
sizeof($1[0][0]), 2, dims, str as_voidptr($1),
ides, sizeof($1[0][0]), 2, dims, s
false, $typemap(swiglal_fixarr trides,
_tinfo, $1_type), false, $typemap(swiglal_fixa
$disown | %convertptr_flags); rr_tinfo, $1_type),
if (!SWIG_IsOK(ecode)) { $disown | %convertptr_flags)
%argument_fail(ecode, "$type", $symname, $argnum); ;
if (!SWIG_IsOK(ecode)) {
%argument_fail(ecode, "$type", $symname, $argnum);
}
} }
} }
// Input typemaps for global variables: // Input typemaps for global variables:
%typemap(varin) SWIGTYPE[ANY] { %typemap(varin) SWIGTYPE[ANY] {
const size_t dims[] = {$1_dim0}; const size_t dims[] = {$1_dim0};
const size_t strides[] = {1}; const size_t strides[] = {1};
// swiglal_array_typeid input type: $1_type // swiglal_array_typeid input type: $1_type
int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as _voidptr($1), int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as _voidptr($1),
sizeof($1[0]), 1, dims, stride s, sizeof($1[0]), 1, dims, stride s,
skipping to change at line 564 skipping to change at line 576
const size_t dims[] = {$1_dim0, $1_dim1}; const size_t dims[] = {$1_dim0, $1_dim1};
const size_t strides[] = {$1_dim1, 1}; const size_t strides[] = {$1_dim1, 1};
// swiglal_array_typeid input type: $1_type // swiglal_array_typeid input type: $1_type
%set_output(%swiglal_array_viewout($1_type)(swiglal_no_self(), %as_voidpt r($1), %set_output(%swiglal_array_viewout($1_type)(swiglal_no_self(), %as_voidpt r($1),
sizeof($1[0][0]), 2, dims, st rides, sizeof($1[0][0]), 2, dims, st rides,
false, $typemap(swiglal_fixar r_tinfo, $1_type), false, $typemap(swiglal_fixar r_tinfo, $1_type),
%newpointer_flags)); %newpointer_flags));
} }
// Argument-output typemaps for functions: // Argument-output typemaps for functions:
%typemap(in, numinputs=0) SWIGTYPE OUTPUT[ANY] { %typemap(in, noblock=1, numinputs=0) SWIGTYPE OUTPUT[ANY] {
$typemap(swiglal_fixarr_ltype, $1_type) temp[$1_dim0]; $typemap(swiglal_fixarr_ltype, $1_type) temp$argnum[$1_dim0];
$1 = &temp[0]; $1 = &temp$argnum[0];
} }
%typemap(argout) SWIGTYPE OUTPUT[ANY], SWIGTYPE INOUT[ANY] { %typemap(argout) SWIGTYPE OUTPUT[ANY], SWIGTYPE INOUT[ANY] {
const size_t dims[] = {$1_dim0}; const size_t dims[] = {$1_dim0};
const size_t strides[] = {1}; const size_t strides[] = {1};
// swiglal_array_typeid input type: $1_type // swiglal_array_typeid input type: $1_type
%append_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voi dptr($1), %append_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voi dptr($1),
sizeof($1[0]), 1, dims, st rides, sizeof($1[0]), 1, dims, st rides,
false, $typemap(swiglal_fi xarr_tinfo, $1_type), false, $typemap(swiglal_fi xarr_tinfo, $1_type),
SWIG_POINTER_OWN | %newpoi nter_flags)); SWIG_POINTER_OWN | %newpoi nter_flags));
} }
%typemap(in, numinputs=0) SWIGTYPE OUTPUT[ANY][ANY] { %typemap(in, noblock=1, numinputs=0) SWIGTYPE OUTPUT[ANY][ANY] {
$typemap(swiglal_fixarr_ltype, $1_type) temp[$1_dim0][$1_dim1]; $typemap(swiglal_fixarr_ltype, $1_type) temp$argnum[$1_dim0][$1_dim1];
$1 = &temp[0]; $1 = &temp$argnum[0];
} }
%typemap(argout) SWIGTYPE OUTPUT[ANY][ANY], SWIGTYPE INOUT[ANY][ANY] { %typemap(argout) SWIGTYPE OUTPUT[ANY][ANY], SWIGTYPE INOUT[ANY][ANY] {
const size_t dims[] = {$1_dim0, $1_dim1}; const size_t dims[] = {$1_dim0, $1_dim1};
const size_t strides[] = {$1_dim1, 1}; const size_t strides[] = {$1_dim1, 1};
// swiglal_array_typeid input type: $1_type // swiglal_array_typeid input type: $1_type
%append_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voi dptr($1), %append_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voi dptr($1),
sizeof($1[0][0]), 2, dims, strides, sizeof($1[0][0]), 2, dims, strides,
false, $typemap(swiglal_fi xarr_tinfo, $1_type), false, $typemap(swiglal_fi xarr_tinfo, $1_type),
SWIG_POINTER_OWN | %newpoi nter_flags)); SWIG_POINTER_OWN | %newpoi nter_flags));
} }
skipping to change at line 851 skipping to change at line 863
%enddef %enddef
#define %swiglal_public_clear_FUNCTION_POINTER(...) #define %swiglal_public_clear_FUNCTION_POINTER(...)
// The SWIGLAL(IMMUTABLE_MEMBERS(TAGNAME, ...)) macro can be used to make // The SWIGLAL(IMMUTABLE_MEMBERS(TAGNAME, ...)) macro can be used to make
// the listed members of the struct TAGNAME immutable. // the listed members of the struct TAGNAME immutable.
%define %swiglal_public_IMMUTABLE_MEMBERS(TAGNAME, ...) %define %swiglal_public_IMMUTABLE_MEMBERS(TAGNAME, ...)
%swiglal_map_abc(%swiglal_feature_nspace, "immutable", "1", TAGNAME, __VA_A RGS__); %swiglal_map_abc(%swiglal_feature_nspace, "immutable", "1", TAGNAME, __VA_A RGS__);
%enddef %enddef
#define %swiglal_public_clear_IMMUTABLE_MEMBERS(...) #define %swiglal_public_clear_IMMUTABLE_MEMBERS(...)
// Typemap for functions which return 'int'. If these functions also return
// other output arguments (via 'argout' typemaps), the 'int' return value i
s
// ignored. This is because 'int' is very commonly used to return an XLAL
// error code, which will be converted into a native scripting-language
// exception, and so the error code itself is not needed directly. To avoid
// having to unpack the error code when collecting the other output argumen
ts,
// therefore, it is ignored in the wrappings. Functions which fit this crit
eria
// but do return a useful 'int' can use SWIGLAL(RETURN_VALUE(int, ...)) to
// disable this behaviour.
//
// For functions, since %feature("new") is set, the 'out' typemap will have
$owner=1,
// and the 'newfree' typemap is also applied. The 'out' typemap ignores the
'int'
// return value by setting the output argument list to VOID_Object; the wra
pping
// function them proceeds to add other output arguments to the list, if any
. After
// this, the 'newfree' typemap is triggered, which appends the 'int' return
if the
// output argument list is empty, using the scripting-language-specific mac
ro
// swiglal_append_output_if_empty(). For structs, $owner=0, so the int retu
rn is
// set straight away, and the 'newfree' typemap is never applied.
%typemap(out, noblock=1, fragment=SWIG_From_frag(int)) int {
%#if $owner
%set_output(VOID_Object);
%#else
%set_output(SWIG_From(int)($1));
%#endif
}
%typemap(newfree, noblock=1, fragment=SWIG_From_frag(int)) int {
swiglal_append_output_if_empty(SWIG_From(int)($1));
}
// Typemaps for empty arguments. These typemaps are useful when no input fr om the // Typemaps for empty arguments. These typemaps are useful when no input fr om the
// scripting language is required, and an empty struct needs to be supplied to // scripting language is required, and an empty struct needs to be supplied to
// the C function. The SWIGLAL(EMPTY_ARGUMENT(TYPE, ...)) macro applies the typemap which // the C function. The SWIGLAL(EMPTY_ARGUMENT(TYPE, ...)) macro applies the typemap which
// supplies a static struct, while the SWIGLAL(NEW_EMPTY_ARGUMENT(TYPE, ... )) macro // supplies a static struct, while the SWIGLAL(NEW_EMPTY_ARGUMENT(TYPE, ... )) macro
// applies the typemap which supplies a dynamically-allocated struct. // applies the typemap which supplies a dynamically-allocated struct. These
typemaps
// may cause there to be no SWIG-wrapped object for the first argument; if
so,
// 'swiglal_no_1starg' is defined for the duration of the wrapping function
.
%define %swiglal_public_EMPTY_ARGUMENT(TYPE, ...) %define %swiglal_public_EMPTY_ARGUMENT(TYPE, ...)
%swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT, TYPE, __V A_ARGS__); %swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT, TYPE, __V A_ARGS__);
%enddef %enddef
%define %swiglal_public_clear_EMPTY_ARGUMENT(TYPE, ...) %define %swiglal_public_clear_EMPTY_ARGUMENT(TYPE, ...)
%swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__);
%enddef %enddef
%typemap(in, noblock=1, numinputs=0) SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT ($*lt ype emptyarg) { %typemap(in, noblock=1, numinputs=0) SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT ($*lt ype emptyarg) {
memset(&emptyarg, 0, sizeof($*type)); memset(&emptyarg, 0, sizeof($*type));
$1 = &emptyarg; $1 = &emptyarg;
%#if $argnum == 1
%#define swiglal_no_1starg
%#endif
}
%typemap(freearg, noblock=1) SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT {
%#undef swiglal_no_1starg
} }
%typemap(freearg) SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT "";
%define %swiglal_public_NEW_EMPTY_ARGUMENT(TYPE, ...) %define %swiglal_public_NEW_EMPTY_ARGUMENT(TYPE, ...)
%swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT, TYPE, __VA_ARGS__); %swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT, TYPE, __VA_ARGS__);
%enddef %enddef
%define %swiglal_public_clear_NEW_EMPTY_ARGUMENT(TYPE, ...) %define %swiglal_public_clear_NEW_EMPTY_ARGUMENT(TYPE, ...)
%swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__);
%enddef %enddef
%typemap(in, noblock=1, numinputs=0) SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT { %typemap(in, noblock=1, numinputs=0) SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT {
$1 = %swiglal_new_instance($*type); $1 = %swiglal_new_instance($*type);
%#if $argnum == 1
%#define swiglal_no_1starg
%#endif
}
%typemap(freearg, noblock=1) SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT {
%#undef swiglal_no_1starg
} }
%typemap(freearg) SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT "";
// SWIG conversion functions for C99 integer types. // SWIG conversion functions for C99 integer types.
// These are mapped to the corresponding basic C types, // These are mapped to the corresponding basic C types,
// conversion functions for which are supplied by SWIG. // conversion functions for which are supplied by SWIG.
%define %swiglal_numeric_typedef(CHECKCODE, BASETYPE, TYPE) %define %swiglal_numeric_typedef(CHECKCODE, BASETYPE, TYPE)
%numeric_type_from(TYPE, BASETYPE); %numeric_type_from(TYPE, BASETYPE);
%numeric_type_asval(TYPE, BASETYPE, "swiglal_empty_frag", false); %numeric_type_asval(TYPE, BASETYPE, "swiglal_empty_frag", false);
%typemaps_primitive(%checkcode(CHECKCODE), TYPE); %typemaps_primitive(%checkcode(CHECKCODE), TYPE);
%enddef %enddef
%swiglal_numeric_typedef(INT8, signed char, int8_t); %swiglal_numeric_typedef(INT8, signed char, int8_t);
skipping to change at line 1024 skipping to change at line 1077
// ownership of the pointer, since it cannot free it (since it is a pointer -to-const). // ownership of the pointer, since it cannot free it (since it is a pointer -to-const).
%typemap(in,noblock=1) const SWIGTYPE * (void *argp = 0, int res = 0) { %typemap(in,noblock=1) const SWIGTYPE * (void *argp = 0, int res = 0) {
res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 /*$disown*/ | %conver tptr_flags); res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 /*$disown*/ | %conver tptr_flags);
if (!SWIG_IsOK(res)) { if (!SWIG_IsOK(res)) {
%argument_fail(res, "$type", $symname, $argnum); %argument_fail(res, "$type", $symname, $argnum);
} }
$1 = %reinterpret_cast(argp, $ltype); $1 = %reinterpret_cast(argp, $ltype);
} }
%typemap(freearg) const SWIGTYPE * ""; %typemap(freearg) const SWIGTYPE * "";
// Typemap for output SWIGTYPEs. This typemaps will match either the SWIG-w rapped // Typemaps for output SWIGTYPEs. This typemaps will match either the SWIG- wrapped
// return argument from functions (which will have the SWIG_POINTER_OWN bit set // return argument from functions (which will have the SWIG_POINTER_OWN bit set
// in $owner) or return a member of a struct through a 'get' functions (in which // in $owner) or return a member of a struct through a 'get' functions (in which
// case SWIG_POINTER_OWN will not be set). If it is the latter case, the fu // case SWIG_POINTER_OWN will not be set). They require the following macro
nction s:
// swiglal_store_parent() is called to store a reference to the struct cont //
aining // The macro %swiglal_store_parent() is called to store a reference to the
// the member being accessed, in order to prevent it from being destroyed a struct
s long // containing the member being accessed, in order to prevent it from being
// as the SWIG-wrapped member object is in scope. The return object is then destroyed
always // as long as the SWIG-wrapped member object is in scope. The return object
// created with SWIG_POINTER_OWN, so that its destructor will always be cal is then
led. // always created with SWIG_POINTER_OWN, so that its destructor will always
be called.
%define %swiglal_store_parent(PTR, OWNER, SELF) %define %swiglal_store_parent(PTR, OWNER, SELF)
%#if !(OWNER & SWIG_POINTER_OWN) %#if !(OWNER & SWIG_POINTER_OWN)
if (%as_voidptr(PTR) != NULL) { if (%as_voidptr(PTR) != NULL) {
swiglal_store_parent(%as_voidptr(PTR), SELF); swiglal_store_parent(%as_voidptr(PTR), SELF);
} }
%#endif %#endif
%enddef %enddef
//
// The macro %swiglal_set_output() sets the output of the wrapping function
. If the
// (pointer) return type of the function is the same as its first argument,
then
// 'swiglal_return_1starg_##NAME' is defined. Unless 'swiglal_no_1starg' is
defined
// (in which case the first argument is being handled by e.g. the EMPTY_ARG
UMENT
// typemap), the macro compares the pointer of the return value (result) to
that of
// the first argument (arg1). If they're equal, the SWIG-wrapped function w
ill return
// a *reference* to the SWIG object wrapping the first argument, i.e. the s
ame object
// with its reference count incremented. That way, if the return value is a
ssigned to
// a different scripting-language variable than the first argument, the und
erlying
// C struct will not be destroyed until both scripting-language variables a
re cleared.
// If the pointers are not equal, or one pointer is NULL, the macro return
a SWIG
// object wrapping the new C struct.
%define %swiglal_set_output(NAME, OBJ)
%#if defined(swiglal_return_1starg_##NAME) && !defined(swiglal_no_1starg)
if (result != NULL && result == arg1) {
%set_output(swiglal_get_reference(swiglal_1starg()));
} else {
%set_output(OBJ);
}
%#else
%set_output(OBJ);
%#endif
%enddef
//
// Typemaps:
%typemap(out,noblock=1) SWIGTYPE *, SWIGTYPE &, SWIGTYPE[] { %typemap(out,noblock=1) SWIGTYPE *, SWIGTYPE &, SWIGTYPE[] {
%swiglal_store_parent($1, $owner, swiglal_self()); %swiglal_store_parent($1, $owner, swiglal_self());
%set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %n ewpointer_flags) | SWIG_POINTER_OWN)); %swiglal_set_output($1_name, SWIG_NewPointerObj(%as_voidptr($1), $descrip tor, ($owner | %newpointer_flags) | SWIG_POINTER_OWN));
} }
%typemap(out,noblock=1) const SWIGTYPE *, const SWIGTYPE &, const SWIGTYPE[ ] { %typemap(out,noblock=1) const SWIGTYPE *, const SWIGTYPE &, const SWIGTYPE[ ] {
%set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %n ewpointer_flags) & ~SWIG_POINTER_OWN)); %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %n ewpointer_flags) & ~SWIG_POINTER_OWN));
} }
%typemap(out, noblock=1) SWIGTYPE *const& { %typemap(out, noblock=1) SWIGTYPE *const& {
%swiglal_store_parent(*$1, $owner, swiglal_self()); %swiglal_store_parent(*$1, $owner, swiglal_self());
%set_output(SWIG_NewPointerObj(%as_voidptr(*$1), $*descriptor, ($owner | %newpointer_flags) | SWIG_POINTER_OWN)); %swiglal_set_output($1_name, SWIG_NewPointerObj(%as_voidptr(*$1), $*descr iptor, ($owner | %newpointer_flags) | SWIG_POINTER_OWN));
} }
%typemap(out, noblock=1) const SWIGTYPE *const& { %typemap(out, noblock=1) const SWIGTYPE *const& {
%set_output(SWIG_NewPointerObj(%as_voidptr(*$1), $*descriptor, ($owner | %newpointer_flags) & ~SWIG_POINTER_OWN)); %set_output(SWIG_NewPointerObj(%as_voidptr(*$1), $*descriptor, ($owner | %newpointer_flags) & ~SWIG_POINTER_OWN));
} }
%typemap(out, noblock=1) SWIGTYPE (void* copy = NULL) { %typemap(out, noblock=1) SWIGTYPE (void* copy = NULL) {
copy = %swiglal_new_copy($1, $ltype); copy = %swiglal_new_copy($1, $ltype);
%swiglal_store_parent(copy, SWIG_POINTER_OWN, swiglal_self()); %swiglal_store_parent(copy, SWIG_POINTER_OWN, swiglal_self());
%set_output(SWIG_NewPointerObj(copy, $&descriptor, (%newpointer_flags) | SWIG_POINTER_OWN)); %set_output(SWIG_NewPointerObj(copy, $&descriptor, (%newpointer_flags) | SWIG_POINTER_OWN));
} }
%typemap(varout, noblock=1) SWIGTYPE *, SWIGTYPE [] { %typemap(varout, noblock=1) SWIGTYPE *, SWIGTYPE [] {
%set_varoutput(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, (%newpoin ter_flags) & ~SWIG_POINTER_OWN)); %set_varoutput(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, (%newpoin ter_flags) & ~SWIG_POINTER_OWN));
} }
%typemap(varout, noblock=1) SWIGTYPE & { %typemap(varout, noblock=1) SWIGTYPE & {
%set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $descriptor, (%newpoi nter_flags) & ~SWIG_POINTER_OWN)); %set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $descriptor, (%newpoi nter_flags) & ~SWIG_POINTER_OWN));
} }
%typemap(varout, noblock=1) SWIGTYPE { %typemap(varout, noblock=1) SWIGTYPE {
%set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $&descriptor, (%newpo inter_flags) & ~SWIG_POINTER_OWN)); %set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $&descriptor, (%newpo inter_flags) & ~SWIG_POINTER_OWN));
} }
// The SWIGLAL(GET_OBJECT(...)) macro is used when a function returns an ob ject whose // The SWIGLAL(RETURNS_PROPERTY(...)) macro is used when a function returns an object whose
// memory is owned by the object supplied as the first argument to the func tion. // memory is owned by the object supplied as the first argument to the func tion.
// Typically this occurs when the function is returning some property of it s first // Typically this occurs when the function is returning some property of it s first
// argument. The macro applies a typemap which calles swiglal_store_parent( ) to store // argument. The macro applies a typemap which calles swiglal_store_parent( ) to store
// a reference to the first argument as the 'parent' of the return argument , so that // a reference to the first argument as the 'parent' of the return argument , so that
// the parent will not be destroyed as long as the return value is in scope . // the parent will not be destroyed as long as the return value is in scope .
%define %swiglal_public_GET_OBJECT(TYPE, ...) %define %swiglal_public_RETURNS_PROPERTY(TYPE, ...)
%swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_GET_OBJECT, TYPE, __VA_AR %swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_RETURNS_PROPERTY, TYPE, _
GS__); _VA_ARGS__);
%enddef %enddef
%define %swiglal_public_clear_GET_OBJECT(TYPE, ...) %define %swiglal_public_clear_RETURNS_PROPERTY(TYPE, ...)
%swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__);
%enddef %enddef
%typemap(out,noblock=1) SWIGTYPE* SWIGLAL_GET_OBJECT { %typemap(out,noblock=1) SWIGTYPE* SWIGLAL_RETURNS_PROPERTY {
%#ifndef swiglal_no_1starg
%swiglal_store_parent($1, 0, swiglal_1starg()); %swiglal_store_parent($1, 0, swiglal_1starg());
%#endif
%set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %n ewpointer_flags) | SWIG_POINTER_OWN)); %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %n ewpointer_flags) | SWIG_POINTER_OWN));
} }
// The SWIGLAL(ACQUIRES_OWNERSHIP(...)) macro indicates that a function wil
l acquire ownership
// of a particular argument, e.g. by storing that argument in some containe
r, and that therefore
// the SWIG object wrapping that argument should no longer own its memory.
%define %swiglal_public_ACQUIRES_OWNERSHIP(TYPE, ...)
%swiglal_map_ab(%swiglal_apply, SWIGTYPE* DISOWN, TYPE, __VA_ARGS__);
%enddef
%define %swiglal_public_clear_ACQUIRES_OWNERSHIP(TYPE, ...)
%swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__);
%enddef
// Typemaps for pointers to primitive scalars. These are treated as output- only // Typemaps for pointers to primitive scalars. These are treated as output- only
// arguments by default, by globally applying the SWIG OUTPUT typemaps. The INOUT // arguments by default, by globally applying the SWIG OUTPUT typemaps. The INOUT
// typemaps can be supplied as needed using the SWIGLAL(INOUT_SCALARS(TYPE, ...)) macro. // typemaps can be supplied as needed using the SWIGLAL(INOUT_SCALARS(TYPE, ...)) macro.
%apply int* OUTPUT { enum SWIGTYPE* }; %apply int* OUTPUT { enum SWIGTYPE* };
%apply short* OUTPUT { short* }; %apply short* OUTPUT { short* };
%apply unsigned short* OUTPUT { unsigned short* }; %apply unsigned short* OUTPUT { unsigned short* };
%apply int* OUTPUT { int* }; %apply int* OUTPUT { int* };
%apply unsigned int* OUTPUT { unsigned int* }; %apply unsigned int* OUTPUT { unsigned int* };
%apply long* OUTPUT { long* }; %apply long* OUTPUT { long* };
%apply unsigned long* OUTPUT { unsigned long* }; %apply unsigned long* OUTPUT { unsigned long* };
 End of changes. 32 change blocks. 
104 lines changed or deleted 222 lines changed or added


 swiglal_octave.i   swiglal_octave.i 
skipping to change at line 25 skipping to change at line 25
// along with with program; see the file COPYING. If not, write to the // along with with program; see the file COPYING. If not, write to the
// Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, // Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
// MA 02111-1307 USA // MA 02111-1307 USA
// //
// SWIG interface code specific to Octave. // SWIG interface code specific to Octave.
// Author: Karl Wette // Author: Karl Wette
////////// General SWIG directives and interface code ////////// ////////// General SWIG directives and interface code //////////
// Improved version of segfault-on-exit prevention hack.
#if SWIG_VERSION < 0x020008
%begin %{
#include <cstdlib>
#define SWIG_OCTAVE_NO_SEGFAULT_HACK
%}
%init %{
octave_exit = ::_Exit;
%}
#endif
// Include SWIG Octave headers. // Include SWIG Octave headers.
%include <octcomplex.swg> %include <octcomplex.swg>
// Include Octave headers. // Include Octave headers.
%header %{extern "C++" { %header %{
extern "C++" {
#include <octave/ov-cell.h> #include <octave/ov-cell.h>
#include <octave/ov-int-traits.h> #include <octave/ov-int-traits.h>
#include <octave/ov-flt-re-mat.h> #include <octave/ov-flt-re-mat.h>
#include <octave/ov-re-mat.h> #include <octave/ov-re-mat.h>
#include <octave/ov-flt-cx-mat.h> #include <octave/ov-flt-cx-mat.h>
#include <octave/ov-cx-mat.h> #include <octave/ov-cx-mat.h>
#include <octave/toplev.h> #include <octave/toplev.h>
}%} }
%}
// Name of octave_value containing the SWIG wrapping of the 'this' // Name of octave_value containing the SWIG wrapping of the struct whose me
// pointer, i.e. the struct whose members are being accessed. mbers are being accessed.
%header %{ %header %{
#define swiglal_self() (args.length() > 0 ? args(0) : octave_value()) #define swiglal_self() (args.length() > 0 ? args(0) : octave_value())
#define swiglal_no_self() octave_value() #define swiglal_no_self() (octave_value())
%} %}
// Name of octave_value containing the SWIG wrapping of the // Name of octave_value containing the SWIG wrapping of the first argument
// first argument to a function. to a function.
%header %{ %header %{
#define swiglal_1starg() (args.length() > 0 ? args(0) : octave_value()) #define swiglal_1starg() (args.length() > 0 ? args(0) : octave_value())
%} %}
// Return a reference to the supplied octave_value; since Octave handles re
ference counting, just return it.
%header %{
#define swiglal_get_reference(v) (v)
%}
// Append an argument to the output argument list of an Octave SWIG-wrapped
function, if the list is empty.
%header %{
#define swiglal_append_output_if_empty(v) \
if (_outp->length() == 0) _outp = SWIG_Octave_AppendOutput(_outp, v)
%}
////////// SWIG directives for operators ////////// ////////// SWIG directives for operators //////////
// Unary operators which return a new object, and thus // Unary operators which return a new object, and thus
// require %newobject to be set. // require %newobject to be set.
%define %swiglal_oct_urn_op(NAME, OCTNAME) %define %swiglal_oct_urn_op(NAME, OCTNAME)
%rename(__##OCTNAME##__) *::__##NAME##__; %rename(__##OCTNAME##__) *::__##NAME##__;
%newobject *::__##NAME##__; %newobject *::__##NAME##__;
%enddef %enddef
%swiglal_oct_urn_op(abs, abs); %swiglal_oct_urn_op(abs, abs);
%swiglal_oct_urn_op(neg, uminus); %swiglal_oct_urn_op(neg, uminus);
skipping to change at line 101 skipping to change at line 101
////////// General fragments, typemaps, and macros ////////// ////////// General fragments, typemaps, and macros //////////
// SWIG conversion fragments and typemaps for GSL complex numbers. // SWIG conversion fragments and typemaps for GSL complex numbers.
%swig_cplxflt_convn(gsl_complex_float, gsl_complex_float_rect, GSL_REAL, GS L_IMAG); %swig_cplxflt_convn(gsl_complex_float, gsl_complex_float_rect, GSL_REAL, GS L_IMAG);
%swig_cplxdbl_convn(gsl_complex, gsl_complex_rect, GSL_REAL, GSL_IMAG); %swig_cplxdbl_convn(gsl_complex, gsl_complex_rect, GSL_REAL, GSL_IMAG);
%typemaps_primitive(%checkcode(CPLXFLT), gsl_complex_float); %typemaps_primitive(%checkcode(CPLXFLT), gsl_complex_float);
%typemaps_primitive(%checkcode(CPLXDBL), gsl_complex); %typemaps_primitive(%checkcode(CPLXDBL), gsl_complex);
// SWIG conversion fragments and typemaps for LAL complex numbers. // SWIG conversion fragments and typemaps for LAL complex numbers.
%swig_cplxflt_convn(COMPLEX8, COMPLEX8, std::real, std::imag); %swig_cplxflt_convn(COMPLEX8, crectf, crealf, cimagf);
%swig_cplxdbl_convn(COMPLEX16, COMPLEX16, std::real, std::imag); %swig_cplxdbl_convn(COMPLEX16, crect, creal, cimag);
%typemaps_primitive(%checkcode(CPLXFLT), COMPLEX8); %typemaps_primitive(%checkcode(CPLXFLT), COMPLEX8);
%typemaps_primitive(%checkcode(CPLXDBL), COMPLEX16); %typemaps_primitive(%checkcode(CPLXDBL), COMPLEX16);
// Typemaps which convert to/from the C broken-down date/time struct. // Typemaps which convert to/from the C broken-down date/time struct.
%typemap(in) struct tm* (struct tm temptm) { %typemap(in) struct tm* (struct tm temptm) {
// Set 'tm' struct to zero // Set 'tm' struct to zero
memset(&temptm, 0, sizeof(temptm)); memset(&temptm, 0, sizeof(temptm));
if (!$input.is_empty()) { if (!$input.is_empty()) {
 End of changes. 8 change blocks. 
20 lines changed or deleted 24 lines changed or added


 swiglal_python.i   swiglal_python.i 
skipping to change at line 37 skipping to change at line 37
// Include NumPy headers in wrapping code, and ensure that // Include NumPy headers in wrapping code, and ensure that
// NumPy array module is loaded along with this module. // NumPy array module is loaded along with this module.
%header %{ %header %{
#include <numpy/arrayobject.h> #include <numpy/arrayobject.h>
%} %}
%init %{ %init %{
import_array(); import_array();
%} %}
// Name of PyObject containing the SWIG wrapping of the 'this' // Include compatibility code for NumPy API < 1.7
// pointer, i.e. the struct whose members are being accessed.
%header %{ %header %{
#define swiglal_self() self #if !SWIGLAL_HAVE_DECL_NPY_ARRAY_WRITEABLE
#define swiglal_no_self() NULL #define NPY_ARRAY_WRITEABLE NPY_WRITEABLE
#endif
#if !SWIGLAL_HAVE_DECL_PYARRAY_SETBASEOBJECT
#define PyArray_SetBaseObject(arr, obj) do { (arr)->base = (obj); } while(0
)
#endif
%}
// Name of PyObject containing the SWIG wrapping of the struct whose member
s are being accessed.
%header %{
#define swiglal_self() (self)
#define swiglal_no_self() (NULL)
%}
// Name of PyObject containing the SWIG wrapping of the first argument to a
function.
%header %{
#define swiglal_1starg() (obj0)
%}
// Return a reference to the supplied PyObject; increment its reference cou
nt, then return it.
%header %{
static inline PyObject* swiglal_get_reference(PyObject* v) { Py_XINCREF(v);
return v; }
%} %}
// Name of PyObject containing the SWIG wrapping of the // Append an argument to the output argument list of an Python SWIG-wrapped
// first argument to a function. function, if the list is empty.
%header %{ %header %{
#define swiglal_1starg() obj0 #define swiglal_append_output_if_empty(v) \
if (resultobj == Py_None) resultobj = SWIG_Python_AppendOutput(resultobj,
v)
%} %}
////////// SWIG directives for operators ////////// ////////// SWIG directives for operators //////////
// These macros apply the correct python:slot directives // These macros apply the correct python:slot directives
// to map Python __operator__ functions (which may be // to map Python __operator__ functions (which may be
// defined in %extend) to the correct PyTypeObject slots. // defined in %extend) to the correct PyTypeObject slots.
// Unary operators which do not return a new object. // Unary operators which do not return a new object.
%define %swiglal_py_ury_op(NAME, FUNCTYPE, SLOT) %define %swiglal_py_ury_op(NAME, FUNCTYPE, SLOT)
skipping to change at line 400 skipping to change at line 419
// Array of NumPy types that a NumPy object-view array can be safely cast to. // Array of NumPy types that a NumPy object-view array can be safely cast to.
static int swiglal_py_array_objview_copyswap_cancastto[2] = {NPY_OBJECT, NPY_NOTYPE}; static int swiglal_py_array_objview_copyswap_cancastto[2] = {NPY_OBJECT, NPY_NOTYPE};
// NumPy array descriptor function for copying/byte-swapping an array ele ment. // NumPy array descriptor function for copying/byte-swapping an array ele ment.
static void swiglal_py_array_objview_copyswap(void* dst, void* src, int s wap, void* arr) { static void swiglal_py_array_objview_copyswap(void* dst, void* src, int s wap, void* arr) {
// Check input. // Check input.
assert(arr != NULL); assert(arr != NULL);
PyArrayObject* nparr = (PyArrayObject*)arr; PyArrayObject* nparr = (PyArrayObject*)arr;
assert(nparr->descr != NULL); assert(PyArray_DESCR(nparr) != NULL);
// Copy array element. // Copy array element.
if (src != NULL) { if (src != NULL) {
memcpy(dst, src, nparr->descr->elsize); memcpy(dst, src, PyArray_DESCR(nparr)->elsize);
} }
// Byte-swap array element, if required. // Byte-swap array element, if required.
if (swap) { if (swap) {
const size_t n = nparr->descr->elsize / 2; const size_t n = PyArray_DESCR(nparr)->elsize / 2;
char *a, *b, c; char *a, *b, c;
a = (char *)dst; a = (char *)dst;
b = a + (nparr->descr->elsize-1); b = a + (PyArray_DESCR(nparr)->elsize-1);
for (size_t i = 0; i < n; i++) { for (size_t i = 0; i < n; i++) {
c = *a; c = *a;
*a++ = *b; *a++ = *b;
*b-- = c; *b-- = c;
} }
} }
} }
} // fragment swiglal_py_array_objview } // fragment swiglal_py_array_objview
skipping to change at line 454 skipping to change at line 473
fragment=INFRAG, fragment=OUTFRAG) fragment=INFRAG, fragment=OUTFRAG)
{ {
// NumPy array descriptor function which gets an element from the viewed array. // NumPy array descriptor function which gets an element from the viewed array.
static PyObject* swiglal_py_array_objview_##ACFTYPE##_getitem(void* elemp tr, void* arr) { static PyObject* swiglal_py_array_objview_##ACFTYPE##_getitem(void* elemp tr, void* arr) {
// Check input. // Check input.
assert(elemptr != NULL); assert(elemptr != NULL);
assert(arr != NULL); assert(arr != NULL);
PyArrayObject* nparr = (PyArrayObject*)arr; PyArrayObject* nparr = (PyArrayObject*)arr;
assert(nparr->descr != NULL); assert(PyArray_DESCR(nparr) != NULL);
// Look up the SWIG type descriptor for this array. // Look up the SWIG type descriptor for this array.
bool isptr; bool isptr;
swig_type_info* tinfo = NULL; swig_type_info* tinfo = NULL;
swiglal_py_array_tinfo_from_descr(&isptr, &tinfo, nparr->descr); swiglal_py_array_tinfo_from_descr(&isptr, &tinfo, PyArray_DESCR(nparr)) ;
assert(tinfo != NULL); assert(tinfo != NULL);
// Get the Python object wrapping the C array element. // Get the Python object wrapping the C array element.
const int tflags = 0; const int tflags = 0;
PyObject* parent = nparr->base; PyObject* parent = PyArray_BASE(nparr);
return OUTCALL; return OUTCALL;
} }
// NumPy array descriptor function which assigns an element in the viewed array. // NumPy array descriptor function which assigns an element in the viewed array.
static int swiglal_py_array_objview_##ACFTYPE##_setitem(PyObject* objelem , void* elemptr, void* arr) { static int swiglal_py_array_objview_##ACFTYPE##_setitem(PyObject* objelem , void* elemptr, void* arr) {
// Check input. // Check input.
assert(elemptr != NULL); assert(elemptr != NULL);
assert(arr != NULL); assert(arr != NULL);
PyArrayObject* nparr = (PyArrayObject*)arr; PyArrayObject* nparr = (PyArrayObject*)arr;
assert(nparr->descr != NULL); assert(PyArray_DESCR(nparr) != NULL);
// Look up the SWIG type descriptor for this array. // Look up the SWIG type descriptor for this array.
bool isptr; bool isptr;
swig_type_info* tinfo = NULL; swig_type_info* tinfo = NULL;
swiglal_py_array_tinfo_from_descr(&isptr, &tinfo, nparr->descr); swiglal_py_array_tinfo_from_descr(&isptr, &tinfo, PyArray_DESCR(nparr)) ;
assert(tinfo != NULL); assert(tinfo != NULL);
// Set the C array element to the supplied Python object. // Set the C array element to the supplied Python object.
const int tflags = 0; const int tflags = 0;
const size_t esize = nparr->descr->elsize; const size_t esize = PyArray_DESCR(nparr)->elsize;
PyObject* parent = nparr->base; PyObject* parent = PyArray_BASE(nparr);
int ecode = INCALL; int ecode = INCALL;
if (!SWIG_IsOK(ecode)) { if (!SWIG_IsOK(ecode)) {
SWIG_Error(ecode, "failure in swiglal_py_array_objview_" #ACFTYPE "_s etitem()"); SWIG_Error(ecode, "failure in swiglal_py_array_objview_" #ACFTYPE "_s etitem()");
return -1; return -1;
} }
return 0; return 0;
} }
// NumPy array descriptor function which casts elements of the viewed arr ay to NPY_OBJECTs. // NumPy array descriptor function which casts elements of the viewed arr ay to NPY_OBJECTs.
static void swiglal_py_array_objview_##ACFTYPE##_cast_to_object(void *fro m, void *to, npy_intp n, void *fromarr, void *toarr) { static void swiglal_py_array_objview_##ACFTYPE##_cast_to_object(void *fro m, void *to, npy_intp n, void *fromarr, void *toarr) {
// Check input. // Check input.
assert(fromarr != NULL); assert(fromarr != NULL);
PyArrayObject* npfromarr = (PyArrayObject*)fromarr; PyArrayObject* npfromarr = (PyArrayObject*)fromarr;
assert(npfromarr->descr != NULL); assert(PyArray_DESCR(npfromarr) != NULL);
assert(toarr != NULL); assert(toarr != NULL);
PyArrayObject* nptoarr = (PyArrayObject*)toarr; PyArrayObject* nptoarr = (PyArrayObject*)toarr;
assert(nptoarr->descr != NULL); assert(PyArray_DESCR(nptoarr) != NULL);
// toarr should be an array of pointers to PyObjects. // toarr should be an array of pointers to PyObjects.
assert(nptoarr->descr->elsize == sizeof(PyObject*)); assert(PyArray_DESCR(nptoarr)->elsize == sizeof(PyObject*));
// Loop over n elements, and assign each element of toarr // Loop over n elements, and assign each element of toarr
// the Python object wrapping the corresponding element of fromarr. // the Python object wrapping the corresponding element of fromarr.
char* fromelem = (void*)from; char* fromelem = (void*)from;
PyObject** toelem = (PyObject**)to; PyObject** toelem = (PyObject**)to;
while (--n >= 0) { while (--n >= 0) {
*toelem = swiglal_py_array_objview_##ACFTYPE##_getitem(fromelem, from arr); *toelem = swiglal_py_array_objview_##ACFTYPE##_getitem(fromelem, from arr);
fromelem += npfromarr->descr->elsize; fromelem += PyArray_DESCR(npfromarr)->elsize;
++toelem; ++toelem;
} }
} }
// NumPy array descriptor function table for type ACFTYPE. // NumPy array descriptor function table for type ACFTYPE.
static PyArray_ArrFuncs swiglal_py_array_objview_##ACFTYPE##_arrfuncs = { static PyArray_ArrFuncs swiglal_py_array_objview_##ACFTYPE##_arrfuncs = {
{(PyArray_VectorUnaryFunc*)NULL}, // cast {(PyArray_VectorUnaryFunc*)NULL}, // cast
(PyArray_GetItemFunc*)&swiglal_py_array_objview_##ACFTYPE##_getitem, // getitem (PyArray_GetItemFunc*)&swiglal_py_array_objview_##ACFTYPE##_getitem, // getitem
(PyArray_SetItemFunc*)&swiglal_py_array_objview_##ACFTYPE##_setitem, // setitem (PyArray_SetItemFunc*)&swiglal_py_array_objview_##ACFTYPE##_setitem, // setitem
skipping to change at line 622 skipping to change at line 641
PyObject* obj, PyObject* obj,
void* ptr, void* ptr,
const size_t esize, const size_t esize,
const size_t ndims, const size_t ndims,
const size_t dims[], const size_t dims[],
const size_t strides [], const size_t strides [],
const bool isptr, const bool isptr,
swig_type_info *tinf o, swig_type_info *tinf o,
const int tflags) const int tflags)
{ {
PyArrayObject* nparr = NULL;
int ecode = 0; int ecode = 0;
npy_intp idx[ndims]; npy_intp idx[ndims];
// Check that C array is non-NULL. // Check that C array is non-NULL.
if (ptr == NULL) { if (ptr == NULL) {
return SWIG_MemoryError; return SWIG_MemoryError;
} }
// Convert the input Python object to a NumPy array. // Convert the input Python object to a NumPy array.
PyObject* nparr = NULL; if (PyArray_Converter(obj, (PyObject**)&nparr) != NPY_SUCCEED) {
if (PyArray_Converter(obj, &nparr) != NPY_SUCCEED) {
ecode = SWIG_ValueError; ecode = SWIG_ValueError;
goto end; goto end;
} }
// Check that NumPy array dimensions are consistent with C array dime nsions. // Check that NumPy array dimensions are consistent with C array dime nsions.
if (PyArray_NDIM(nparr) != ndims) { if (PyArray_NDIM(nparr) != ndims) {
ecode = SWIG_ValueError; ecode = SWIG_ValueError;
goto end; goto end;
} }
size_t nelem = 1; size_t nelem = 1;
skipping to change at line 694 skipping to change at line 713
SWIGINTERN PyObject* %swiglal_array_copyout_func(ACFTYPE)(PyObject* par ent, SWIGINTERN PyObject* %swiglal_array_copyout_func(ACFTYPE)(PyObject* par ent,
void* ptr, void* ptr,
const size_t esize, const size_t esize,
const size_t ndims, const size_t ndims,
const size_t dims[], const size_t dims[],
const size_t strides[], const size_t strides[],
const bool is ptr, const bool is ptr,
swig_type_inf o *tinfo, swig_type_inf o *tinfo,
const int tfl ags) const int tfl ags)
{ {
PyObject* nparr = NULL; PyArrayObject* nparr = NULL;
npy_intp objdims[ndims]; npy_intp objdims[ndims];
npy_intp idx[ndims]; npy_intp idx[ndims];
// Check that C array is non-NULL. // Check that C array is non-NULL.
if (ptr == NULL) { if (ptr == NULL) {
goto fail; goto fail;
} }
// Copy C array dimensions. // Copy C array dimensions.
size_t nelem = 1; size_t nelem = 1;
for (int i = 0; i < ndims; ++i) { for (int i = 0; i < ndims; ++i) {
objdims[i] = dims[i]; objdims[i] = dims[i];
nelem *= dims[i]; nelem *= dims[i];
} }
// Create new NumPy array. // Create new NumPy array.
nparr = PyArray_EMPTY(ndims, objdims, NPYTYPE, 0); nparr = (PyArrayObject*)PyArray_EMPTY(ndims, objdims, NPYTYPE, 0);
if (nparr == NULL) { if (nparr == NULL) {
goto fail; goto fail;
} }
// Iterate over all elements in the C array. // Iterate over all elements in the C array.
memset(idx, 0, ndims*sizeof(npy_intp)); memset(idx, 0, ndims*sizeof(npy_intp));
for (size_t i = 0; i < nelem; ++i) { for (size_t i = 0; i < nelem; ++i) {
// Get a pointer to the element of the C array. // Get a pointer to the element of the C array.
void* elemptr = swiglal_py_get_element_ptr(ptr, esize, ndims, strid es, idx); void* elemptr = swiglal_py_get_element_ptr(ptr, esize, ndims, strid es, idx);
// Copy the C array element to the NumPy array. // Copy the C array element to the NumPy array.
PyObject* objelem = OUTCALL; PyObject* objelem = OUTCALL;
PyArray_SETITEM(nparr, PyArray_GetPtr((PyArrayObject*)nparr, idx), objelem); PyArray_SETITEM(nparr, PyArray_GetPtr((PyArrayObject*)nparr, idx), objelem);
// Increment the NumPy array index. // Increment the NumPy array index.
swiglal_py_increment_idx(ndims, dims, idx); swiglal_py_increment_idx(ndims, dims, idx);
} }
return nparr; return (PyObject*)nparr;
fail: fail:
Py_CLEAR(nparr); Py_CLEAR(nparr);
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;
} }
} }
// Output view conversion fragment for arrays of type ACFTYPE. // Output view conversion fragment for arrays of type ACFTYPE.
skipping to change at line 756 skipping to change at line 775
SWIGINTERN PyObject* %swiglal_array_viewout_func(ACFTYPE)(PyObject* par ent, SWIGINTERN PyObject* %swiglal_array_viewout_func(ACFTYPE)(PyObject* par ent,
void* ptr, void* ptr,
const size_t esize, const size_t esize,
const size_t ndims, const size_t ndims,
const size_t dims[], const size_t dims[],
const size_t strides[], const size_t strides[],
const bool is ptr, const bool is ptr,
swig_type_inf o *tinfo, swig_type_inf o *tinfo,
const int tfl ags) const int tfl ags)
{ {
PyObject* nparr = NULL; PyArrayObject* nparr = NULL;
npy_intp objdims[ndims]; npy_intp objdims[ndims];
npy_intp objstrides[ndims]; npy_intp objstrides[ndims];
// Copy C array dimensions and strides. // Copy C array dimensions and strides.
for (int i = 0; i < ndims; ++i) { for (int i = 0; i < ndims; ++i) {
objdims[i] = dims[i]; objdims[i] = dims[i];
objstrides[i] = strides[i] * esize; objstrides[i] = strides[i] * esize;
} }
// Create a new NumPy array view. // Create a new NumPy array view.
PyArray_Descr* descr = NPYDESCR; PyArray_Descr* descr = NPYDESCR;
if (descr == NULL) { if (descr == NULL) {
goto fail; goto fail;
} }
nparr = PyArray_NewFromDescr(&PyArray_Type, descr, ndims, objdims, ob jstrides, ptr, NPY_WRITEABLE, NULL); nparr = (PyArrayObject*)PyArray_NewFromDescr(&PyArray_Type, descr, nd ims, objdims, objstrides, ptr, NPY_ARRAY_WRITEABLE, NULL);
if (nparr == NULL) { if (nparr == NULL) {
goto fail; goto fail;
} }
// Set the NumPy array view parent, if given. // Set the NumPy array view parent, if given.
if (parent) { if (parent) {
Py_INCREF(parent); Py_INCREF(parent);
((PyArrayObject*)nparr)->base = parent; PyArray_SetBaseObject(nparr, parent);
} }
return nparr; return (PyObject*)nparr;
fail: fail:
Py_CLEAR(nparr); Py_CLEAR(nparr);
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;
} }
} }
%enddef // %swiglal_py_array_frags %enddef // %swiglal_py_array_frags
 End of changes. 27 change blocks. 
31 lines changed or deleted 57 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/