| Comm.h | | Comm.h | |
|
| /*----------------------------------------------------------------------- | | /* | |
| | | * <lalVerbatim file="CommHV"> | |
| | | * $Id: Comm.h,v 1.10 2001/12/05 21:11:36 jolien Exp $ | |
| | | * </lalVerbatim> | |
| | | */ | |
| | | | |
| | | /* | |
| | | * <lalLaTeX> | |
| * | | * | |
|
| * File Name: Comm.h | | * \section{Header \texttt{Comm.h}} | |
| * | | * | |
|
| * Author: Allen, B. and Creighton, J. D. E. | | * Provides routines for MPI communication. | |
| * | | * | |
|
| * Revision: $Id: Comm.h,v 1.3 2000/07/23 01:12:39 jolien Exp $ | | * \subsection*{Synopsis} | |
| | | * \begin{verbatim} | |
| | | * #include <lal/Comm.h> | |
| | | * \end{verbatim} | |
| * | | * | |
|
| *----------------------------------------------------------------------- | | * \noindent This header covers the routines for doing MPI communication. | |
| | | * | |
| | | * </lalLaTeX> | |
| */ | | */ | |
| | | | |
| #ifndef _COMM_H | | #ifndef _COMM_H | |
| #define _COMM_H | | #define _COMM_H | |
| | | | |
|
| #include "LALDatatypes.h" | | #include <lal/LALConfig.h> | |
| #include "AVFactories.h" | | #ifdef LAL_MPI_ENABLED | |
| #include "mpi.h" | | | |
| | | #include <mpi.h> | |
| | | #include <lal/LALDatatypes.h> | |
| | | #include <lal/AVFactories.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
|
| NRCSID (COMMH, "$Id: Comm.h,v 1.3 2000/07/23 01:12:39 jolien Exp $"); | | NRCSID (COMMH, "$Id: Comm.h,v 1.10 2001/12/05 21:11:36 jolien Exp $"); | |
| | | | |
|
| #define COMM_ENULL 1 | | /* | |
| #define COMM_ESIZE 2 | | * <lalLaTeX> | |
| #define COMM_ESTRL 4 | | * \subsection*{Error conditions} | |
| #define COMM_EMPIE 8 | | * \input{CommHErrTab} | |
| #define COMM_ESENV 16 | | * </lalLaTeX> | |
| #define COMM_ESYSC 32 | | * | |
| | | * <lalErrTable file="CommHErrTab"> | |
| #define COMM_MSGENULL "Null pointer" | | */ | |
| #define COMM_MSGESIZE "Invalid size" | | #define COMMH_ENULL 1 | |
| #define COMM_MSGESTRL "String too long" | | #define COMMH_ENNUL 2 | |
| #define COMM_MSGEMPIE "MPI error" | | #define COMMH_ESIZE 4 | |
| #define COMM_MSGESENV "Couldn't set environment variable" | | #define COMMH_ESZMM 8 | |
| #define COMM_MSGESYSC "Error executing system command" | | #define COMMH_EMPIE 16 | |
| | | #define COMMH_EHAND 32 | |
| /* Structure for identifying processors */ | | #define COMMH_ENOBJ 64 | |
| typedef struct | | | |
| tagMPIId | | #define COMMH_MSGENULL "Null pointer" | |
| { | | #define COMMH_MSGENNUL "Non-Null pointer" | |
| INT4 numProcs; | | #define COMMH_MSGESIZE "Invalid size" | |
| INT4 myId; | | #define COMMH_MSGESZMM "Exchange size mismatch" | |
| INT4 nameLen; | | #define COMMH_MSGEMPIE "MPI error" | |
| CHAR procName[MPI_MAX_PROCESSOR_NAME]; | | #define COMMH_MSGEHAND "Wrong handshake" | |
| } | | #define COMMH_MSGENOBJ "Invalid number of objects" | |
| MPIId; | | /* | |
| | | * </lalErrTable> | |
| | | */ | |
| | | | |
|
| typedef struct | | /* | |
| tagMPIDebugParams | | * <lalLaTeX> | |
| { | | * \subsection*{Types} | |
| CHAR *debugger; | | * </lalLaTeX> | |
| CHAR *progName; | | */ | |
| INT4 delay; | | | |
| INT4 myId; | | | |
| } | | | |
| MPIDebugParams; | | | |
| | | | |
| typedef enum | | typedef enum | |
| { | | { | |
| MPIDone, | | MPIDone, | |
| MPIMisc, | | MPIMisc, | |
| MPIErr, | | MPIErr, | |
| MPIMsg, | | MPIMsg, | |
|
| | | MPICHAR, | |
| | | MPII2, | |
| | | MPII4, | |
| | | MPII8, | |
| | | MPIU2, | |
| | | MPIU4, | |
| | | MPIU8, | |
| | | MPIS, | |
| | | MPID, | |
| | | MPIC, | |
| | | MPIZ, | |
| MPICHARVector, | | MPICHARVector, | |
| MPICHARVectorData, | | MPICHARVectorData, | |
| MPII2Vector, | | MPII2Vector, | |
| MPII2VectorData, | | MPII2VectorData, | |
| MPII4Vector, | | MPII4Vector, | |
| MPII4VectorData, | | MPII4VectorData, | |
| MPII8Vector, | | MPII8Vector, | |
| MPII8VectorData, | | MPII8VectorData, | |
|
| | | MPIU2Vector, | |
| | | MPIU2VectorData, | |
| | | MPIU4Vector, | |
| | | MPIU4VectorData, | |
| | | MPIU8Vector, | |
| | | MPIU8VectorData, | |
| MPISVector, | | MPISVector, | |
| MPISVectorData, | | MPISVectorData, | |
| MPIDVector, | | MPIDVector, | |
| MPIDVectorData, | | MPIDVectorData, | |
| MPICVector, | | MPICVector, | |
| MPICVectorData, | | MPICVectorData, | |
| MPIZVector, | | MPIZVector, | |
| MPIZVectorData, | | MPIZVectorData, | |
| MPII2TimeSeries, | | MPII2TimeSeries, | |
| MPII4TimeSeries, | | MPII4TimeSeries, | |
| MPII8TimeSeries, | | MPII8TimeSeries, | |
|
| | | MPIU2TimeSeries, | |
| | | MPIU4TimeSeries, | |
| | | MPIU8TimeSeries, | |
| MPISTimeSeries, | | MPISTimeSeries, | |
| MPIDTimeSeries, | | MPIDTimeSeries, | |
| MPICTimeSeries, | | MPICTimeSeries, | |
| MPIZTimeSeries, | | MPIZTimeSeries, | |
| MPII2FrequencySeries, | | MPII2FrequencySeries, | |
| MPII4FrequencySeries, | | MPII4FrequencySeries, | |
| MPII8FrequencySeries, | | MPII8FrequencySeries, | |
|
| | | MPIU2FrequencySeries, | |
| | | MPIU4FrequencySeries, | |
| | | MPIU8FrequencySeries, | |
| MPISFrequencySeries, | | MPISFrequencySeries, | |
| MPIDFrequencySeries, | | MPIDFrequencySeries, | |
| MPICFrequencySeries, | | MPICFrequencySeries, | |
| MPIZFrequencySeries | | MPIZFrequencySeries | |
| } | | } | |
| MPIMsgCode; | | MPIMsgCode; | |
| | | | |
| typedef struct | | typedef struct | |
| tagMPIMessage | | tagMPIMessage | |
| { | | { | |
| INT4 msg; | | INT4 msg; | |
| INT4 send; | | INT4 send; | |
| INT4 source; | | INT4 source; | |
| } | | } | |
| MPIMessage; | | MPIMessage; | |
| | | | |
|
| | | /* | |
| | | * <lalLaTeX> | |
| | | * | |
| | | * \subsubsection*{Structure \texttt{MPIMessage}} | |
| | | * \idx[Type]{MPIMessage} | |
| | | * | |
| | | * This structure is sent to a remote process, via \verb+LALMPISendMsg()+, | |
| | | * to alert that process that there is a message. Note that | |
| | | * \verb+LALMPIRecvMsg()+ is the only \verb+Recv+-type function that does n | |
| | | ot | |
| | | * require the source to be identified; the receiver can then identify the | |
| | | * source from the message received. | |
| | | * | |
| | | * Essentially, \verb+LALMPISendMsg()+ and \verb+LALMPIRecvMsg()+ form a | |
| | | * handshake for a subsequent transmission, and \verb+MPIMessage+ specifies | |
| | | * the protocol. The local process uses \verb+LALMPISendMsg()+ to communic | |
| | | ate | |
| | | * with a remote process, which is waiting to hear from \emph{any} process | |
| | | * using \verb+LALMPIRecvMsg()+. The message the local process sends speci | |
| | | fies | |
| | | * \begin{enumerate} | |
| | | * \item An integer code telling the remote process what operation it sho | |
| | | uld | |
| | | * take (e.g., get ready to exchange some data, tell the remote process | |
| | | * to terminate, etc.). | |
| | | * \item A boolean integer that is zero if the remote process is expected | |
| | | * to send something to the local process, or non-zero if the local pro | |
| | | cess | |
| | | * will send something to the remote process. | |
| | | * \item An integer representing the MPI process number of the local proc | |
| | | ess. | |
| | | * \end{enumerate} | |
| | | * | |
| | | * The fields are: | |
| | | * \begin{description} | |
| | | * \item[\texttt{INT4 msg}] An integer code specifying to the receiver what | |
| | | * type of operation is to be taken. | |
| | | * \item[\texttt{INT4 send}] A boolean that is non-zero if the originator | |
| | | * of the message will be sending something to the recipiant of the messa | |
| | | ge | |
| | | * in a subsequent communication, or zero if the recipiant of the message | |
| | | * is expected to send something to the originator of the message. | |
| | | * \item[\texttt{INT4 source}] The MPI process number of the originator of | |
| | | the | |
| | | * message. | |
| | | * \end{description} | |
| | | * | |
| | | * </lalLaTeX> | |
| | | */ | |
| | | | |
| | | typedef struct | |
| | | tagExchParams | |
| | | { | |
| | | INT4 send; | |
| | | INT4 numObjects; | |
| | | INT4 partnerProcNum; | |
| | | INT4 myProcNum; | |
| | | INT4 exchObjectType; | |
| | | MPI_Comm mpiComm; | |
| | | } | |
| | | ExchParams; | |
| | | | |
| | | typedef struct | |
| | | tagInitExchParams | |
| | | { | |
| | | INT4 myProcNum; | |
| | | MPI_Comm mpiComm; | |
| | | } | |
| | | InitExchParams; | |
| | | | |
| | | /* | |
| | | * <lalLaTeX> | |
| | | * | |
| | | * \subsubsection*{Structures \texttt{ExchParams} and \texttt{InitExchParam | |
| | | s}} | |
| | | * \idx[Type]{ExchParams} | |
| | | * \idx[Type]{InitExchParams} | |
| | | * | |
| | | * These structures are used in the \verb+Exch+-type routines. The structu | |
| | | re | |
| | | * \verb+InitExchParams+ are the parameters used in initializing an exchang | |
| | | e | |
| | | * protocol using \verb+LALInitializeExchange+. The fields are: | |
| | | * \begin{description} | |
| | | * \item[\texttt{INT4 myProcNum}] The MPI process number of the local pro | |
| | | cess. | |
| | | * \item[\texttt{MPI\_Comm mpiComm}] The MPI communicator. | |
| | | * \end{description} | |
| | | * | |
| | | * The structure \verb+ExchParams+ is created by \verb+LALInitializeExchang | |
| | | e()+, | |
| | | * destroyed by \verb+LALFinalizeExchange()+, and serves as the parameter f | |
| | | or | |
| | | * the various \verb+LALExchange+$\langle\textit{type}\rangle$ functions. | |
| | | It | |
| | | * is also required as the input to \verb+LALInitializeExchange()+ for the | |
| | | * originator of the exchange request. The fields are: | |
| | | * \begin{description} | |
| | | * \item[\texttt{INT4 send}] A code that indicates whether this process i | |
| | | s | |
| | | * sending (non-zero) or recieving (zero). The process that initialize | |
| | | s | |
| | | * the exchange chooses whether it will send in the subsequent exchange | |
| | | s | |
| | | * (non-zero value for the \verb+send+ field of the input | |
| | | * \verb+ExchParams+), or receive (zero value). | |
| | | * \item[\texttt{INT4 numObjects}] The (maximum) number of objects to be | |
| | | * exchanged. (The partners in the exchange may have some mechanism to | |
| | | * decide to terminate the exchange early, e.g., by exchanging a negati | |
| | | ve | |
| | | * integer.) | |
| | | * \item[\texttt{INT4 partnerProcNum}] The MPI process number of the part | |
| | | ner | |
| | | * in the exchange. | |
| | | * \item[\texttt{INT4 myProcNum}] The MPI process number of the local pro | |
| | | cess. | |
| | | * \item[\texttt{INT4 exchObjectType}] An integer code representing the t | |
| | | ype | |
| | | * of object that will be excanged. | |
| | | * \item[\texttt{MPI\_Comm mpiComm}] The MPI communicator. | |
| | | * \end{description} | |
| | | * | |
| | | * </lalLaTeX> | |
| | | */ | |
| | | | |
| | | /* | |
| | | * <lalLaTeX> | |
| | | * \vfill{\footnotesize\input{CommHV}} | |
| | | * \newpage\input{SendRecvC} | |
| | | * \newpage\input{ExchangeC} | |
| | | * \newpage\input{SendRecvTestC} | |
| | | * \newpage\input{ExchangeTestC} | |
| | | * </lalLaTeX> | |
| | | */ | |
| | | | |
| | | void | |
| | | LALMPISendMsg( | |
| | | LALStatus *status, | |
| | | MPIMessage *msg, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| void | | void | |
|
| LALMPIExportEnvironment ( | | LALMPIRecvMsg( | |
| LALStatus *status, | | LALStatus *status, | |
| const CHAR *env, | | MPIMessage *msg, | |
| INT4 myId | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPIDebug ( | | LALMPISendCHAR( | |
| LALStatus *status, | | LALStatus *status, | |
| MPIDebugParams *params | | CHAR *element, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPIKillScript ( | | LALMPIRecvCHAR( | |
| LALStatus *status, | | LALStatus *status, | |
|
| MPIId *id | | CHAR *element, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPISendMsg ( | | LALMPISendINT2( | |
| LALStatus *status, | | LALStatus *status, | |
| MPIMessage *msg, | | INT2 *element, | |
| INT4 dest | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvINT2( | |
| | | LALStatus *status, | |
| | | INT2 *element, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPIRecvMsg ( | | LALMPISendINT4( | |
| LALStatus *status, | | LALStatus *status, | |
| MPIMessage *msg | | INT4 *element, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPISendCHARVector ( | | LALMPIRecvINT4( | |
| LALStatus *status, | | LALStatus *status, | |
| | | INT4 *element, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendINT8( | |
| | | LALStatus *status, | |
| | | INT8 *element, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvINT8( | |
| | | LALStatus *status, | |
| | | INT8 *element, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendUINT2( | |
| | | LALStatus *status, | |
| | | UINT2 *element, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvUINT2( | |
| | | LALStatus *status, | |
| | | UINT2 *element, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendUINT4( | |
| | | LALStatus *status, | |
| | | UINT4 *element, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvUINT4( | |
| | | LALStatus *status, | |
| | | UINT4 *element, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendUINT8( | |
| | | LALStatus *status, | |
| | | UINT8 *element, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvUINT8( | |
| | | LALStatus *status, | |
| | | UINT8 *element, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendREAL4( | |
| | | LALStatus *status, | |
| | | REAL4 *element, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvREAL4( | |
| | | LALStatus *status, | |
| | | REAL4 *element, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendREAL8( | |
| | | LALStatus *status, | |
| | | REAL8 *element, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvREAL8( | |
| | | LALStatus *status, | |
| | | REAL8 *element, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendCOMPLEX8( | |
| | | LALStatus *status, | |
| | | COMPLEX8 *element, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvCOMPLEX8( | |
| | | LALStatus *status, | |
| | | COMPLEX8 *element, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendCOMPLEX16( | |
| | | LALStatus *status, | |
| | | COMPLEX16 *element, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvCOMPLEX16( | |
| | | LALStatus *status, | |
| | | COMPLEX16 *element, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendCHARVector( | |
| | | LALStatus *status, | |
| CHARVector *vector, | | CHARVector *vector, | |
|
| INT4 dest | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPIRecvCHARVector ( | | LALMPIRecvCHARVector( | |
| LALStatus *status, | | LALStatus *status, | |
| CHARVector *vector, | | CHARVector *vector, | |
|
| INT4 source | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPISendINT2Vector ( | | LALMPISendINT2Vector( | |
| LALStatus *status, | | LALStatus *status, | |
| INT2Vector *vector, | | INT2Vector *vector, | |
|
| INT4 dest | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPIRecvINT2Vector ( | | LALMPIRecvINT2Vector( | |
| LALStatus *status, | | LALStatus *status, | |
| INT2Vector *vector, | | INT2Vector *vector, | |
|
| INT4 source | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPISendREAL4Vector ( | | LALMPISendINT4Vector( | |
| LALStatus *status, | | LALStatus *status, | |
| | | INT4Vector *vector, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvINT4Vector( | |
| | | LALStatus *status, | |
| | | INT4Vector *vector, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendINT8Vector( | |
| | | LALStatus *status, | |
| | | INT8Vector *vector, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvINT8Vector( | |
| | | LALStatus *status, | |
| | | INT8Vector *vector, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendUINT2Vector( | |
| | | LALStatus *status, | |
| | | UINT2Vector *vector, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvUINT2Vector( | |
| | | LALStatus *status, | |
| | | UINT2Vector *vector, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendUINT4Vector( | |
| | | LALStatus *status, | |
| | | UINT4Vector *vector, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvUINT4Vector( | |
| | | LALStatus *status, | |
| | | UINT4Vector *vector, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendUINT8Vector( | |
| | | LALStatus *status, | |
| | | UINT8Vector *vector, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvUINT8Vector( | |
| | | LALStatus *status, | |
| | | UINT8Vector *vector, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendREAL4Vector( | |
| | | LALStatus *status, | |
| REAL4Vector *vector, | | REAL4Vector *vector, | |
|
| INT4 dest | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPIRecvREAL4Vector ( | | LALMPIRecvREAL4Vector( | |
| LALStatus *status, | | LALStatus *status, | |
| REAL4Vector *vector, | | REAL4Vector *vector, | |
|
| INT4 source | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendREAL8Vector( | |
| | | LALStatus *status, | |
| | | REAL8Vector *vector, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvREAL8Vector( | |
| | | LALStatus *status, | |
| | | REAL8Vector *vector, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPISendCOMPLEX8Vector ( | | LALMPISendCOMPLEX8Vector( | |
| LALStatus *status, | | LALStatus *status, | |
| COMPLEX8Vector *vector, | | COMPLEX8Vector *vector, | |
|
| INT4 dest | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPIRecvCOMPLEX8Vector ( | | LALMPIRecvCOMPLEX8Vector( | |
| LALStatus *status, | | LALStatus *status, | |
| COMPLEX8Vector *vector, | | COMPLEX8Vector *vector, | |
|
| INT4 source | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendCOMPLEX16Vector( | |
| | | LALStatus *status, | |
| | | COMPLEX16Vector *vector, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPISendINT2TimeSeries ( | | LALMPIRecvCOMPLEX16Vector( | |
| LALStatus *status, | | LALStatus *status, | |
| | | COMPLEX16Vector *vector, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendINT2TimeSeries( | |
| | | LALStatus *status, | |
| INT2TimeSeries *series, | | INT2TimeSeries *series, | |
|
| INT4 dest | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPIRecvINT2TimeSeries ( | | LALMPIRecvINT2TimeSeries( | |
| LALStatus *status, | | LALStatus *status, | |
| INT2TimeSeries *series, | | INT2TimeSeries *series, | |
|
| INT4 source | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPISendREAL4TimeSeries ( | | LALMPISendINT4TimeSeries( | |
| LALStatus *status, | | LALStatus *status, | |
| | | INT4TimeSeries *series, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvINT4TimeSeries( | |
| | | LALStatus *status, | |
| | | INT4TimeSeries *series, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendINT8TimeSeries( | |
| | | LALStatus *status, | |
| | | INT8TimeSeries *series, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvINT8TimeSeries( | |
| | | LALStatus *status, | |
| | | INT8TimeSeries *series, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendUINT2TimeSeries( | |
| | | LALStatus *status, | |
| | | UINT2TimeSeries *series, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvUINT2TimeSeries( | |
| | | LALStatus *status, | |
| | | UINT2TimeSeries *series, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendUINT4TimeSeries( | |
| | | LALStatus *status, | |
| | | UINT4TimeSeries *series, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvUINT4TimeSeries( | |
| | | LALStatus *status, | |
| | | UINT4TimeSeries *series, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendUINT8TimeSeries( | |
| | | LALStatus *status, | |
| | | UINT8TimeSeries *series, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvUINT8TimeSeries( | |
| | | LALStatus *status, | |
| | | UINT8TimeSeries *series, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendREAL4TimeSeries( | |
| | | LALStatus *status, | |
| REAL4TimeSeries *series, | | REAL4TimeSeries *series, | |
|
| INT4 dest | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPIRecvREAL4TimeSeries ( | | LALMPIRecvREAL4TimeSeries( | |
| LALStatus *status, | | LALStatus *status, | |
| REAL4TimeSeries *series, | | REAL4TimeSeries *series, | |
|
| INT4 source | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendREAL8TimeSeries( | |
| | | LALStatus *status, | |
| | | REAL8TimeSeries *series, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPISendCOMPLEX8TimeSeries ( | | LALMPIRecvREAL8TimeSeries( | |
| LALStatus *status, | | LALStatus *status, | |
| | | REAL8TimeSeries *series, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendCOMPLEX8TimeSeries( | |
| | | LALStatus *status, | |
| COMPLEX8TimeSeries *series, | | COMPLEX8TimeSeries *series, | |
|
| INT4 dest | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPIRecvCOMPLEX8TimeSeries ( | | LALMPIRecvCOMPLEX8TimeSeries( | |
| LALStatus *status, | | LALStatus *status, | |
| COMPLEX8TimeSeries *series, | | COMPLEX8TimeSeries *series, | |
|
| INT4 source | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendCOMPLEX16TimeSeries( | |
| | | LALStatus *status, | |
| | | COMPLEX16TimeSeries *series, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvCOMPLEX16TimeSeries( | |
| | | LALStatus *status, | |
| | | COMPLEX16TimeSeries *series, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendINT2FrequencySeries( | |
| | | LALStatus *status, | |
| | | INT2FrequencySeries *series, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvINT2FrequencySeries( | |
| | | LALStatus *status, | |
| | | INT2FrequencySeries *series, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendINT4FrequencySeries( | |
| | | LALStatus *status, | |
| | | INT4FrequencySeries *series, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvINT4FrequencySeries( | |
| | | LALStatus *status, | |
| | | INT4FrequencySeries *series, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendINT8FrequencySeries( | |
| | | LALStatus *status, | |
| | | INT8FrequencySeries *series, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvINT8FrequencySeries( | |
| | | LALStatus *status, | |
| | | INT8FrequencySeries *series, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendUINT2FrequencySeries( | |
| | | LALStatus *status, | |
| | | UINT2FrequencySeries *series, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvUINT2FrequencySeries( | |
| | | LALStatus *status, | |
| | | UINT2FrequencySeries *series, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendUINT4FrequencySeries( | |
| | | LALStatus *status, | |
| | | UINT4FrequencySeries *series, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvUINT4FrequencySeries( | |
| | | LALStatus *status, | |
| | | UINT4FrequencySeries *series, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendUINT8FrequencySeries( | |
| | | LALStatus *status, | |
| | | UINT8FrequencySeries *series, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPISendREAL4FrequencySeries ( | | LALMPIRecvUINT8FrequencySeries( | |
| LALStatus *status, | | LALStatus *status, | |
| | | UINT8FrequencySeries *series, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendREAL4FrequencySeries( | |
| | | LALStatus *status, | |
| REAL4FrequencySeries *series, | | REAL4FrequencySeries *series, | |
|
| INT4 dest | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPIRecvREAL4FrequencySeries ( | | LALMPIRecvREAL4FrequencySeries( | |
| LALStatus *status, | | LALStatus *status, | |
| REAL4FrequencySeries *series, | | REAL4FrequencySeries *series, | |
|
| INT4 source | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendREAL8FrequencySeries( | |
| | | LALStatus *status, | |
| | | REAL8FrequencySeries *series, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvREAL8FrequencySeries( | |
| | | LALStatus *status, | |
| | | REAL8FrequencySeries *series, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPISendCOMPLEX8FrequencySeries ( | | LALMPISendCOMPLEX8FrequencySeries( | |
| LALStatus *status, | | LALStatus *status, | |
| COMPLEX8FrequencySeries *series, | | COMPLEX8FrequencySeries *series, | |
|
| INT4 dest | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| ); | | ); | |
| | | | |
| void | | void | |
|
| LALMPIRecvCOMPLEX8FrequencySeries ( | | LALMPIRecvCOMPLEX8FrequencySeries( | |
| LALStatus *status, | | LALStatus *status, | |
| COMPLEX8FrequencySeries *series, | | COMPLEX8FrequencySeries *series, | |
|
| INT4 source | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPISendCOMPLEX16FrequencySeries( | |
| | | LALStatus *status, | |
| | | COMPLEX16FrequencySeries *series, | |
| | | INT4 dest, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALMPIRecvCOMPLEX16FrequencySeries( | |
| | | LALStatus *status, | |
| | | COMPLEX16FrequencySeries *series, | |
| | | INT4 source, | |
| | | MPI_Comm mpiComm | |
| | | ); | |
| | | | |
| | | void | |
| | | LALInitializeExchange( | |
| | | LALStatus *status, | |
| | | ExchParams **exchParamsOut, | |
| | | ExchParams *exchParamsInp, | |
| | | InitExchParams *params | |
| | | ); | |
| | | | |
| | | void | |
| | | LALFinalizeExchange( | |
| | | LALStatus *status, | |
| | | ExchParams **exchParams | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeCHAR( | |
| | | LALStatus *status, | |
| | | CHAR *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeINT2( | |
| | | LALStatus *status, | |
| | | INT2 *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeINT4( | |
| | | LALStatus *status, | |
| | | INT4 *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeINT8( | |
| | | LALStatus *status, | |
| | | INT8 *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeUINT2( | |
| | | LALStatus *status, | |
| | | UINT2 *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeUINT4( | |
| | | LALStatus *status, | |
| | | UINT4 *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeUINT8( | |
| | | LALStatus *status, | |
| | | UINT8 *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeREAL4( | |
| | | LALStatus *status, | |
| | | REAL4 *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeREAL8( | |
| | | LALStatus *status, | |
| | | REAL8 *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeCOMPLEX8( | |
| | | LALStatus *status, | |
| | | COMPLEX8 *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeCOMPLEX16( | |
| | | LALStatus *status, | |
| | | COMPLEX16 *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeCHARVector( | |
| | | LALStatus *status, | |
| | | CHARVector *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeINT2Vector( | |
| | | LALStatus *status, | |
| | | INT2Vector *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeINT4Vector( | |
| | | LALStatus *status, | |
| | | INT4Vector *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeINT8Vector( | |
| | | LALStatus *status, | |
| | | INT8Vector *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeUINT2Vector( | |
| | | LALStatus *status, | |
| | | UINT2Vector *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeUINT4Vector( | |
| | | LALStatus *status, | |
| | | UINT4Vector *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeUINT8Vector( | |
| | | LALStatus *status, | |
| | | UINT8Vector *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeREAL4Vector( | |
| | | LALStatus *status, | |
| | | REAL4Vector *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeREAL8Vector( | |
| | | LALStatus *status, | |
| | | REAL8Vector *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeCOMPLEX8Vector( | |
| | | LALStatus *status, | |
| | | COMPLEX8Vector *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeCOMPLEX16Vector( | |
| | | LALStatus *status, | |
| | | COMPLEX16Vector *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeINT2TimeSeries( | |
| | | LALStatus *status, | |
| | | INT2TimeSeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeINT4TimeSeries( | |
| | | LALStatus *status, | |
| | | INT4TimeSeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeINT8TimeSeries( | |
| | | LALStatus *status, | |
| | | INT8TimeSeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeUINT2TimeSeries( | |
| | | LALStatus *status, | |
| | | UINT2TimeSeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeUINT4TimeSeries( | |
| | | LALStatus *status, | |
| | | UINT4TimeSeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeUINT8TimeSeries( | |
| | | LALStatus *status, | |
| | | UINT8TimeSeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeREAL4TimeSeries( | |
| | | LALStatus *status, | |
| | | REAL4TimeSeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeREAL8TimeSeries( | |
| | | LALStatus *status, | |
| | | REAL8TimeSeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeCOMPLEX8TimeSeries( | |
| | | LALStatus *status, | |
| | | COMPLEX8TimeSeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeCOMPLEX16TimeSeries( | |
| | | LALStatus *status, | |
| | | COMPLEX16TimeSeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeINT2FrequencySeries( | |
| | | LALStatus *status, | |
| | | INT2FrequencySeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeINT4FrequencySeries( | |
| | | LALStatus *status, | |
| | | INT4FrequencySeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeINT8FrequencySeries( | |
| | | LALStatus *status, | |
| | | INT8FrequencySeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeUINT2FrequencySeries( | |
| | | LALStatus *status, | |
| | | UINT2FrequencySeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeUINT4FrequencySeries( | |
| | | LALStatus *status, | |
| | | UINT4FrequencySeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeUINT8FrequencySeries( | |
| | | LALStatus *status, | |
| | | UINT8FrequencySeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeREAL4FrequencySeries( | |
| | | LALStatus *status, | |
| | | REAL4FrequencySeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeREAL8FrequencySeries( | |
| | | LALStatus *status, | |
| | | REAL8FrequencySeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeCOMPLEX8FrequencySeries( | |
| | | LALStatus *status, | |
| | | COMPLEX8FrequencySeries *object, | |
| | | ExchParams *exchParms | |
| | | ); | |
| | | | |
| | | void | |
| | | LALExchangeCOMPLEX16FrequencySeries( | |
| | | LALStatus *status, | |
| | | COMPLEX16FrequencySeries *object, | |
| | | ExchParams *exchParms | |
| ); | | ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
|
| | | #endif /* LAL_MPI_ENABLED */ | |
| | | | |
| #endif /* _COMM_H */ | | #endif /* _COMM_H */ | |
| | | | |
End of changes. 57 change blocks. |
| 112 lines changed or deleted | | 1122 lines changed or added | |
|
| Date.h | | Date.h | |
|
| /*----------------------------------------------------------------------- | | /* <lalVerbatim file="DateHV"> | |
| * | | | |
| * File Name: Date.h | | Author: David Chin <dwchin@umich.edu> +1-734-730-1274 | |
| * | | $Id: Date.h,v 1.31 2001/12/08 21:28:38 dwchin Exp $ | |
| * Author: David Chin <dwchin@umich.edu> | | | |
| * | | </lalVerbatim> */ | |
| * Revision: $Id: Date.h,v 1.2 2000/07/23 01:12:54 jolien Exp $ | | | |
| * | | /* <lalLaTeX> | |
| *----------------------------------------------------------------------- | | | |
| * | | \section{Header \texttt{Date.h}} | |
| * NAME | | \label{s:Date.h} | |
| * Date.h | | | |
| * | | Provides routines for manipulating date and time information. | |
| * SYNOPSIS | | | |
| * #include "Date.h" | | \subsection*{Synopsis} | |
| * | | \begin{verbatim} | |
| * DESCRIPTION | | #include <lal/Date.h> | |
| * Data type definitions for date and time manipulation. | | \end{verbatim} | |
| * Function prototypes for date and time manipulation functions. | | | |
| * | | This header covers routines for manipulating date and time | |
| * DIAGNOSTICS | | information. The various time systems are discussed in~\cite{esaa:1992}. | |
| * | | | |
| *----------------------------------------------------------------------- | | </lalLaTeX> */ | |
| */ | | | |
| | | | |
| #ifndef _DATE_H | | #ifndef _DATE_H | |
| #define _DATE_H | | #define _DATE_H | |
| | | | |
|
| | | /* the following two preprocessor defines are to include the prototypes for | |
| | | * gmtime_r() and asctime_r() from /usr/include/time.h | |
| | | * HOWEVER, they do no good if -ansi is used in gcc: warnings are generated | |
| | | * that the prototypes have not been seen */ | |
| | | | |
| | | /* HP-UX and Solaris */ | |
| #ifndef _REENTRANT | | #ifndef _REENTRANT | |
| # define _REENTRANT | | # define _REENTRANT | |
| #endif | | #endif | |
| | | | |
|
| | | #ifndef _POSIX_PTHREAD_SEMANTICS | |
| | | # define _POSIX_PTHREAD_SEMANTICS | |
| | | #endif | |
| | | | |
| | | /* Linux */ | |
| | | #ifndef __USE_POSIX | |
| | | # define __USE_POSIX | |
| | | #endif | |
| | | | |
| #include <stdio.h> | | #include <stdio.h> | |
| #include <stdlib.h> | | #include <stdlib.h> | |
|
| | | | |
| #include <time.h> | | #include <time.h> | |
| | | | |
|
| #include "LALRCSID.h" | | #include <lal/LALRCSID.h> | |
| | | | |
|
| #include "LALConstants.h" | | #include <lal/LALConstants.h> | |
| #include "LALAtomicDatatypes.h" | | #include <lal/LALAtomicDatatypes.h> | |
| #include "LALDatatypes.h" | | #include <lal/LALDatatypes.h> | |
| #include "LALStatusMacros.h" | | #include <lal/LALStatusMacros.h> | |
| #include "LALStdlib.h" | | #include <lal/LALStdlib.h> | |
| | | | |
| | | #include <lal/DetectorSite.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
|
| extern "C" { | | extern "C" | |
| | | { | |
| #endif | | #endif | |
| | | | |
|
| NRCSID (DATEH, "$Id: Date.h,v 1.2 2000/07/23 01:12:54 jolien Exp $"); | | NRCSID (DATEH, "$Id: Date.h,v 1.31 2001/12/08 21:28:38 dwchin Exp $"); | |
| | | | |
|
| /* | | /* <lalLaTeX> | |
| * Julian.c | | \subsection*{Error conditions} | |
| */ | | </lalLaTeX> */ | |
| #define JULIAN_ENULLINPUT 1 | | | |
| #define JULIAN_ENULLOUTPUT 2 | | | |
| #define JULIAN_EDATETOOEARLY 3 | | | |
| | | | |
| #define JULIAN_MSGENULLINPUT "Input is NULL" | | | |
| #define JULIAN_MSGENULLOUTPUT "Output is NULL" | | | |
| #define JULIAN_MSGEDATETOOEARLY "Date too early: Julian Day can only be com | | | |
| puted for dates >= 1900-Mar" | | | |
| | | | |
|
| /* | | /* <lalErrTable> */ | |
| * UtoGPS.c | | #define DATEH_ENULLINPUT 1 | |
| */ | | #define DATEH_ENULLOUTPUT 2 | |
| #define UTOGPS_ENULLINPUT 1 | | #define DATEH_EDATETOOEARLY 3 | |
| #define UTOGPS_ENULLOUTPUT 2 | | #define DATEH_ERANGEGPSABS 4 | |
| | | #define DATEH_EBUFFTOOSMALL 5 | |
| | | #define DATEH_EASCTIMEFAIL 6 | |
| | | #define DATEH_EGPSDATETOOEARLY 7 | |
| | | | |
|
| #define UTOGPS_MSGENULLINPUT "Input is NULL" | | #define DATEH_MSGENULLINPUT "Input is NULL" | |
| #define UTOGPS_MSGENULLOUTPUT "Output is NULL" | | #define DATEH_MSGENULLOUTPUT "Output is NULL" | |
| | | #define DATEH_MSGEDATETOOEARLY "Date too early: Julian Day can only be comp | |
| | | uted for dates >= 1900-03-01" | |
| | | #define DATEH_MSGERANGEGPSABS "Input time out of range: only able to accura | |
| | | tely convert times between 1980-Jan-06 00:00:00 UTC (GPS 0) and 2002-Mar-31 | |
| | | 23:59:00 UTC (GPS 701654353)" | |
| | | #define DATEH_MSGEBUFFTOOSMALL "Output timestamp string too small: min. siz | |
| | | e = 26" | |
| | | #define DATEH_MSGEASCTIMEFAIL "asctimeUNDERSCOREr() failed" | |
| | | #define DATEH_MSGEGPSDATETOOEARLY "Date too early: GPS time only defined fo | |
| | | r times on or after 1980-Jan-06 00:00:00 UTC" | |
| | | | |
|
| /* | | /* </lalErrTable> | |
| * Utime.c | | | |
| */ | | | |
| #define UTIME_ENULLINPUT 1 | | | |
| #define UTIME_ENULLOUTPUT 2 | | | |
| #define UTIME_ERANGE 3 | | | |
| | | | |
| #define UTIME_MSGENULLINPUT "Input is NULL" | | | |
| #define UTIME_MSGENULLOUTPUT "Output is NULL" | | | |
| #define UTIME_MSGERANGE "Input time out of range: 0 <= utc_seconds <= 94668 | | | |
| 4823" | | | |
| | | | |
|
| /* | | <lalLaTeX> | |
| * DateString.c | | | |
| */ | | | |
| #define DATESTRING_ENULLINPUT 1 | | | |
| #define DATESTRING_ENULLOUTPUT 2 | | | |
| #define DATESTRING_EBUFFTOOSMALL 3 | | | |
| | | | |
| #define DATESTRING_MSGENULLINPUT "Input is NULL" | | | |
| #define DATESTRING_MSGENULLOUTPUT "Output is NULL" | | | |
| #define DATESTRING_MSGEBUFFTOOSMALL "Output timestamp string too small: min | | | |
| . size = 26" | | | |
| | | | |
|
| /* | | \subsection*{Structures} | |
| * LMST1.c | | | |
| */ | | | |
| #define LMST1_ENULLINPUT 1 | | | |
| #define LMST1_ENULLOUTPUT 2 | | | |
| | | | |
|
| #define GMST1_ENULLINPUT 1 | | </lalLaTeX> */ | |
| #define GMST1_ENULLOUTPUT 2 | | | |
| | | | |
|
| #define LMST1_MSGENULLINPUT "Input is NULL" | | /* <lalLaTeX> | |
| #define LMST1_MSGENULLOUTPUT "Output is NULL" | | | |
| | | | |
|
| #define GMST1_MSGENULLINPUT "Input is NULL" | | \vfill{\footnotesize\input{DateHV}} | |
| #define GMST1_MSGENULLOUTPUT "Output is NULL" | | | |
| | | | |
| #define MST_SEC 0 | | | |
| #define MST_HRS 1 | | | |
| #define MST_DEG 2 | | | |
| #define MST_RAD 3 | | | |
| | | | |
|
| /* | | </lalLaTeX> */ | |
| * SecsToLALDate.c | | | |
| */ | | /* <lalLaTeX> | |
| #define SECSTOLALDATE_ENULLOUTPUT 1 | | | |
| | | \subsection*{Types} | |
| | | | |
| | | \subsubsection*{Enumeration \texttt{LALMSTUnits}} | |
| | | \idx[Type]{LALMSTUnits} | |
| | | | |
| | | This enumerated type is used as a parameter for Mean Sidereal Time | |
| | | routines to specify the units in which to return the Mean Sidereal | |
| | | Time. The allowed values are: | |
| | | | |
| | | \medskip\noindent | |
| | | \begin{tabular}{ll} | |
| | | \verb+MST_SEC+ & arc-seconds \\ | |
| | | \verb+MST_HRS+ & arc-hours (\textit{i.e.} units of Right Ascension)\\ | |
| | | \verb+MST_DEG+ & degrees \\ | |
| | | \verb+MST_RAD+ & radians | |
| | | \end{tabular} | |
| | | \bigskip | |
| | | | |
| | | </lalLaTeX> */ | |
| | | | |
| | | typedef enum | |
| | | { | |
| | | MST_SEC, /* arc seconds */ | |
| | | MST_HRS, /* arc hours (i.e. units of Right Ascension) */ | |
| | | MST_DEG, /* degrees */ | |
| | | MST_RAD /* radians */ | |
| | | } LALMSTUnits; | |
| | | | |
| | | /* <lalLaTeX> | |
| | | \subsubsection*{Enumeration \texttt{LALLeapSecAccuracy}} | |
| | | \idx[Type]{LALLeapSecAccuracy} | |
| | | | |
| | | This enumerated type is used as a parameter for \texttt{LALGPStoUTC()} and | |
| | | \texttt{LALUTCtoGPS()} to specify if complete accuracy is required in use | |
| | | of leap seconds. The allowed values are: | |
| | | | |
| | | \medskip\noindent | |
| | | \begin{tabular}{ll} | |
| | | \verb+LALLEAPSEC_LOOSE+ & may miss leap seconds \\ | |
| | | \verb+LALLEAPSEC_STRICT+ & require all leap seconds | |
| | | \end{tabular} | |
| | | \bigskip | |
| | | | |
| | | If strict accuracy is selected, the code will \texttt{ABORT} if leap second | |
| | | data is not current. Otherwise, a warning will be printed, and the code | |
| | | will continue execution. | |
| | | | |
| | | </lalLaTeX> */ | |
| | | typedef enum | |
| | | { | |
| | | LALLEAPSEC_LOOSE, | |
| | | LALLEAPSEC_STRICT | |
| | | } LALLeapSecAccuracy; | |
| | | | |
| | | /* <lalLaTeX> | |
| | | | |
|
| #define SECSTOLALDATE_MSGENULLOUTPUT "Output is NULL" | | \subsubsection*{Structure \texttt{LALUnixDate}} | |
| | | \idx[Type]{LALUnixDate} | |
| | | | |
|
| /* The standard Unix tm structure */ | | This structure is just the standard Unix \texttt{tm} structure. We shall | |
| | | {\em always} ignore the daylight savings time field, \verb+tm_isdst+. | |
| | | | |
| | | </lalLaTeX> */ | |
| | | | |
| | | /* | |
| | | * The standard Unix tm structure | |
| | | */ | |
| typedef struct | | typedef struct | |
| tm | | tm | |
| LALUnixDate; | | LALUnixDate; | |
| | | | |
|
| /* This time object is exactly like LIGOTimeGPS, except for the name */ | | /* <lalLaTeX> | |
| typedef struct | | | |
| tagLIGOTimeUnix | | \subsubsection{Structure \texttt{LALTimeInterval}} | |
| { | | \idx[Type]{LALTimeInterval} | |
| INT4 unixSeconds; | | | |
| INT4 unixNanoSeconds; | | This structure is used for storing intervals of \texttt{LIGOTimeGPS} | |
| } | | and \texttt{LIGOTimeUnix} times. The fields are: | |
| LIGOTimeUnix; | | | |
| | | \begin{description} | |
| | | \item{\texttt{INT4 seconds}} Integral part of the time interval | |
| | | \item{\texttt{INT8 nanoSeconds}} Residual nanoseconds (\textit{i.e.} | |
| | | fractional part, in nanoseconds) | |
| | | \end{description} | |
| | | | |
|
| /* Encode timezone information */ | | </lalLaTeX> */ | |
| | | | |
| | | /* | |
| | | * This time object is for time intervals, i.e. no reference epoch implied | |
| | | */ | |
| typedef struct | | typedef struct | |
|
| tagLALTimezone | | tagLALTimeInterval | |
| { | | { | |
|
| INT4 secondsWest; /* seconds West of UTC */ | | INT4 seconds; | |
| INT4 dst; /* Daylight Savings Time correction to apply */ | | INT8 nanoSeconds; | |
| } | | } | |
|
| LALTimezone; | | LALTimeInterval; | |
| | | | |
| | | /* <lalLaTeX> | |
| | | | |
| | | \subsubsection{Structure \texttt{LALDate}} | |
| | | \idx[Type]{LALDate} | |
| | | | |
|
| /* Date and time structure */ | | This structure is an extension of \texttt{LALUnixDate} to include residual | |
| | | nanosecond information. The fields are: | |
| | | | |
| | | \begin{description} | |
| | | \item{\texttt{LALUnixDate unixDate}} Unix date in \texttt{struct tm} | |
| | | format | |
| | | \item{\texttt{INT4 residualNanoSeconds}} Residual nanoseconds | |
| | | \end{description} | |
| | | </lalLaTeX> */ | |
| | | | |
| | | /* | |
| | | * Date and time structure | |
| | | */ | |
| typedef struct | | typedef struct | |
| tagLALDate | | tagLALDate | |
| { | | { | |
| LALUnixDate unixDate; | | LALUnixDate unixDate; | |
| INT4 residualNanoSeconds; /* residual nanoseconds */ | | INT4 residualNanoSeconds; /* residual nanoseconds */ | |
|
| LALTimezone timezone; /* timezone information */ | | | |
| } | | } | |
| LALDate; | | LALDate; | |
| | | | |
|
| | | /* <lalLaTeX> | |
| | | | |
| | | \subsubsection{Structure \texttt{LALPlaceAndGPS}} | |
| | | \idx[Type]{LALPlaceAndGPS} | |
| | | | |
| | | This structure stores pointers to a \texttt{LALDetector} and a | |
| | | \texttt{LIGOTimeGPS}. Its sole purpose is to aggregate these | |
| | | structures for passing to functions. The fields are: | |
| | | | |
| | | \begin{description} | |
| | | \item{\verb+LALDetector *p_detector+} Pointer to a detector | |
| | | \item{\verb+LIGOTimeGPS *p_gps+} Pointer to a GPS time structure | |
| | | \end{description} | |
| | | | |
| | | </lalLaTeX> */ | |
| | | | |
| /* | | /* | |
|
| * 9. Functions Declarations (i.e., prototypes). | | * Place and time structures | |
| */ | | */ | |
|
| void LALJulianDay (LALStatus*, INT4*, const LALDate*); | | /* First, with GPS */ | |
| void LALModJulianDay(LALStatus*, REAL8*, const LALDate*); | | typedef struct | |
| void LALJulianDate(LALStatus*, REAL8*, const LALDate*); | | tagLALPlaceAndGPS | |
| void LALModJulianDate(LALStatus*, REAL8*, const LALDate*); | | { | |
| void LALUtoGPS(LALStatus*, LIGOTimeGPS*, const LIGOTimeUnix*); | | LALDetector *p_detector; /* pointer to a detector */ | |
| void LALGPStoU(LALStatus*, LIGOTimeUnix*, const LIGOTimeGPS*); | | LIGOTimeGPS *p_gps; /* pointer to GPS time */ | |
| void LALUtime(LALStatus*, LALDate*, const LIGOTimeUnix*); | | } | |
| void LALDateString(LALStatus*, CHARVector*, const LALDate*); | | LALPlaceAndGPS; | |
| void LALGMST1(LALStatus*, REAL8*, const LALDate*, INT4); | | | |
| void LALLMST1(LALStatus*, REAL8*, const LALDate*, REAL8, INT4); | | /* <lalLaTeX> | |
| void LALSecsToLALDate(LALStatus*, LALDate*, REAL8); | | | |
| | | \subsubsection{Structure \texttt{LALPlaceAndDate}} | |
| | | \idx[Type]{LALPlaceAndDate} | |
| | | | |
| | | Like \texttt{LALPlaceAndGPS}, this structure aggregates a pointer to a | |
| | | detector and a pointer to a date. This is another convenience | |
| | | structure, used in calling \texttt{LALLMST1()}. The fields are: | |
| | | | |
| | | \begin{description} | |
| | | \item{\verb+LALDetector *p_detector+} Pointer to a detector | |
| | | \item{\verb+LALDate *p_date+} Pointer to a date | |
| | | \end{description} | |
| | | | |
| | | </lalLaTeX> */ | |
| | | | |
| | | /* Second, with Date-Time */ | |
| | | typedef struct | |
| | | tagLALPlaceAndDate | |
| | | { | |
| | | LALDetector *p_detector; /* pointer to a detector */ | |
| | | LALDate *p_date; /* pointer to a date */ | |
| | | } | |
| | | LALPlaceAndDate; | |
| | | | |
| | | /* | |
| | | * Function prototypes | |
| | | */ | |
| | | | |
| | | /* <lalLaTeX> | |
| | | \newpage\input{JulianC} | |
| | | </lalLaTeX> */ | |
| | | | |
| | | void LALJulianDay(LALStatus *status, | |
| | | INT4 *jDay, | |
| | | const LALDate *date); | |
| | | | |
| | | void LALJulianDate (LALStatus *status, | |
| | | REAL8 *jDateOut, | |
| | | const LALDate *date); | |
| | | | |
| | | void LALModJulianDate (LALStatus *status, | |
| | | REAL8 *modJDate, | |
| | | const LALDate *date); | |
| | | | |
| | | /* <lalLaTeX> | |
| | | \newpage\input{DateStringC} | |
| | | </lalLaTeX> */ | |
| | | | |
| | | void LALDateString (LALStatus *status, | |
| | | CHARVector *timestamp, | |
| | | const LALDate *date); | |
| | | | |
| | | /* <lalLaTeX> | |
| | | \newpage\input{LMST1C} | |
| | | </lalLaTeX> */ | |
| | | | |
| | | void LALGMST1 (LALStatus *status, | |
| | | REAL8 *gmst, /* output - GMST1 */ | |
| | | const LALDate *date, /* input - date and time */ | |
| | | LALMSTUnits outunits); /* GMST1 units */ | |
| | | | |
| | | void LALGPStoGMST1( LALStatus *status, | |
| | | REAL8 *gmst, /* output - GMST1 */ | |
| | | const LIGOTimeGPS *gps, /* input - GPS time */ | |
| | | LALMSTUnits outunits); /* GMST1 units */ | |
| | | | |
| | | void LALLMST1 (LALStatus *status, | |
| | | REAL8 *lmst, /* output - LMST1 */ | |
| | | const LALPlaceAndDate *placeAndDate, /* input - | |
| | | location | |
| | | and date */ | |
| | | LALMSTUnits outunits); /* LMST1 units */ | |
| | | | |
| | | void LALGPStoLMST1( LALStatus *status, | |
| | | REAL8 *lmst, /* output - LMST1 */ | |
| | | const LALPlaceAndGPS *placeAndGps, /* input - | |
| | | location and | |
| | | GPS */ | |
| | | LALMSTUnits outunits); /* LMST1 units | |
| | | */ | |
| | | | |
| | | /* <lalLaTeX> | |
| | | \newpage\input{SecsToLALDateC} | |
| | | </lalLaTeX> */ | |
| | | | |
| | | void LALSecsToLALDate(LALStatus*, | |
| | | LALDate*, | |
| | | REAL8); | |
| | | | |
| | | /* <lalLaTeX> | |
| | | \newpage\input{GPStoUTCC} | |
| | | </lalLaTeX> */ | |
| | | void | |
| | | LALGPStoUTC (LALStatus *status, | |
| | | LALDate *pUtcDate, | |
| | | const LIGOTimeGPS *pGpsTime, | |
| | | const LALLeapSecAccuracy *pAccuracy); | |
| | | | |
| | | void | |
| | | LALUTCtoGPS (LALStatus *status, | |
| | | LIGOTimeGPS *pGpsTime, | |
| | | const LALDate *pUtcDate, | |
| | | const LALLeapSecAccuracy *pAccuracy); | |
| | | | |
| | | /* The following is from S.J. Berukoff, included at his request */ | |
| | | /* <lalLaTeX> | |
| | | \newpage\input{GPStoFloatC} | |
| | | </lalLaTeX> */ | |
| | | void LALGPStoFloat (LALStatus *, | |
| | | REAL8 *, | |
| | | LIGOTimeGPS *); | |
| | | | |
| | | void LALFloatToGPS(LALStatus *, | |
| | | LIGOTimeGPS *, | |
| | | REAL8 *); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif /* _DATE_H */ | | #endif /* _DATE_H */ | |
| | | | |
End of changes. 30 change blocks. |
| 121 lines changed or deleted | | 330 lines changed or added | |
|
| IIRFilter.h | | IIRFilter.h | |
| /************************************ <lalVerbatim file="IIRFilterHV"> | | /************************************ <lalVerbatim file="IIRFilterHV"> | |
| Author: Creighton, T. D. | | Author: Creighton, T. D. | |
|
| $Id: IIRFilter.h,v 1.4 2000/07/23 01:15:14 jolien Exp $ | | $Id: IIRFilter.h,v 1.8 2001/08/21 04:19:53 jolien Exp $ | |
| ************************************* </lalVerbatim> */ | | **************************************************** </lalVerbatim> */ | |
| | | | |
|
| /* <lalLaTeX> | | /********************************************************** <lalLaTeX> | |
| | | | |
| \section{Header \texttt{IIRFilter.h}} | | \section{Header \texttt{IIRFilter.h}} | |
| \label{s:IIRFilter.h} | | \label{s:IIRFilter.h} | |
| | | | |
| Provides routines to make and apply IIR filters. | | Provides routines to make and apply IIR filters. | |
| | | | |
| \subsection*{Synopsis} | | \subsection*{Synopsis} | |
| \begin{verbatim} | | \begin{verbatim} | |
|
| #include "IIRFilter.h" | | #include <lal/IIRFilter.h> | |
| \end{verbatim} | | \end{verbatim} | |
| | | | |
| \noindent This header covers routines that create, destroy, and apply | | \noindent This header covers routines that create, destroy, and apply | |
| generic time-domain filters, given by objects of type | | generic time-domain filters, given by objects of type | |
| \verb@<datatype>IIRFilter@, where \verb@<datatype>@ is either | | \verb@<datatype>IIRFilter@, where \verb@<datatype>@ is either | |
| \verb@REAL4@ or \verb@REAL8@. | | \verb@REAL4@ or \verb@REAL8@. | |
| | | | |
| An IIR (Infinite Impulse Response) filter is a generalized linear | | An IIR (Infinite Impulse Response) filter is a generalized linear | |
| causal time-domain filter, in which the filter output $y_n=y(t_n)$ at | | causal time-domain filter, in which the filter output $y_n=y(t_n)$ at | |
| any sampled time $t_n=t_0+n\Delta t$ is a linear combination of the | | any sampled time $t_n=t_0+n\Delta t$ is a linear combination of the | |
| | | | |
| skipping to change at line 65 | | skipping to change at line 65 | |
| feeding data point by point to the filter, the filter needs only | | feeding data point by point to the filter, the filter needs only | |
| ``remember'' the previous $M$ or $N$ (whichever is larger) values of | | ``remember'' the previous $M$ or $N$ (whichever is larger) values of | |
| $w$, rather than remembering the previous $M$ values of $x$ \emph{and} | | $w$, rather than remembering the previous $M$ values of $x$ \emph{and} | |
| the previous $N$ values of $y$. Second, when filtering a large stored | | the previous $N$ values of $y$. Second, when filtering a large stored | |
| data vector, the filter response can be computed in place: one first | | data vector, the filter response can be computed in place: one first | |
| runs forward through the vector replacing $x$ with $w$, and then | | runs forward through the vector replacing $x$ with $w$, and then | |
| backward replacing $w$ with $y$. | | backward replacing $w$ with $y$. | |
| | | | |
| Although the IIR filters in these routines are explicitly real, one | | Although the IIR filters in these routines are explicitly real, one | |
| can consider formally their complex response. A sinusoidal input can | | can consider formally their complex response. A sinusoidal input can | |
|
| thus be written as $x_n=X\exp(2\pi ifn\Delta t)=z^n$, where $X$ is a | | thus be written as $x_n=X\exp(2\pi ifn\Delta t)=Xz^n$, where $X$ is a | |
| complex amplitude and $z=\exp(2\pi if\Delta t)$ is a complex | | complex amplitude and $z=\exp(2\pi if\Delta t)$ is a complex | |
| parametrization of the frequency. By linearity, the output must also | | parametrization of the frequency. By linearity, the output must also | |
|
| be sinusoidal: $y_m=Y\exp(2\pi ifm\Delta t)=z^m$. Putting these into | | be sinusoidal: $y_m=Y\exp(2\pi ifm\Delta t)=Yz^m$. Putting these into | |
| the bilinear equation, one can easily compute the filter's complex | | the bilinear equation, one can easily compute the filter's complex | |
| transfer function: | | transfer function: | |
| $$ | | $$ | |
| T(z) = \frac{Y}{X} = \frac{\sum_{k=0}^M c_k z^{-k}} | | T(z) = \frac{Y}{X} = \frac{\sum_{k=0}^M c_k z^{-k}} | |
| {1 - \sum_{l=1}^N d_l z^{-l}} | | {1 - \sum_{l=1}^N d_l z^{-l}} | |
| $$ | | $$ | |
| This can be readily converted to and from the ``zeros, poles, gain'' | | This can be readily converted to and from the ``zeros, poles, gain'' | |
| representation of a filter, which expresses $T(z)$ as a factored | | representation of a filter, which expresses $T(z)$ as a factored | |
| rational function of $z$. | | rational function of $z$. | |
| | | | |
| It should also be noted that, in the routines covered by this header, | | It should also be noted that, in the routines covered by this header, | |
| I have adopted the convention of including a redundant recursive | | I have adopted the convention of including a redundant recursive | |
| coefficient $d_0$, in order to make the indexing more intuitive. For | | coefficient $d_0$, in order to make the indexing more intuitive. For | |
| formal correctness $d_0$ should be set to $-1$, although the filtering | | formal correctness $d_0$ should be set to $-1$, although the filtering | |
| routines never actually use this coefficient. | | routines never actually use this coefficient. | |
| | | | |
|
| </lalLaTeX> */ | | ******************************************************* </lalLaTeX> */ | |
| | | | |
| #ifndef _IIRFILTER_H | | #ifndef _IIRFILTER_H | |
| #define _IIRFILTER_H | | #define _IIRFILTER_H | |
| | | | |
|
| #include "LALStdlib.h" | | #include <lal/LALStdlib.h> | |
| #include "ZPGFilter.h" | | #include <lal/ZPGFilter.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
|
| | | #pragma } | |
| #endif | | #endif | |
| | | | |
|
| NRCSID(IIRFILTERH,"$Id: IIRFilter.h,v 1.4 2000/07/23 01:15:14 jolien Exp $" | | NRCSID(IIRFILTERH,"$Id: IIRFilter.h,v 1.8 2001/08/21 04:19:53 jolien Exp $" | |
| ); | | ); | |
| | | | |
| /* <lalLaTeX> | | | |
| | | | |
|
| | | /********************************************************** <lalLaTeX> | |
| \subsection*{Error conditions} | | \subsection*{Error conditions} | |
|
| | | ****************************************** </lalLaTeX><lalErrTable> */ | |
| %\begin{tabular}{|c|l|l|} | | #define IIRFILTERH_ENUL 1 | |
| %\hline | | #define IIRFILTERH_EOUT 2 | |
| %status & status & Explanation \\ | | #define IIRFILTERH_EMEM 3 | |
| % code & description & \\ | | #define IIRFILTERH_EPAIR 4 | |
| %\hline | | | |
| %\tt 1 & \tt Null pointer & Missing a required pointer. | | #define IIRFILTERH_MSGENUL "Unexpected null pointer in arguments" | |
| \\ | | #define IIRFILTERH_MSGEOUT "Output handle points to a non-null pointer" | |
| %\tt 2 & \tt Output already exists & Can't allocate to a non-null pointe | | #define IIRFILTERH_MSGEMEM "Memory allocation error" | |
| r. \\ | | #define IIRFILTERH_MSGEPAIR "Input has unpaired nonreal poles or zeros" | |
| %\tt 3 & \tt Memory allocation error & Could not allocate memory. | | /******************************************** </lalErrTable><lalLaTeX> | |
| \\ | | | |
| %\tt 4 & \tt Input has unpaired & For real filters, complex poles or | | \subsection*{Types} | |
| \\ | | | |
| % & \tt nonreal poles or zeros & zeros must come in conjugate pairs. | | \subsubsection*{Structure \texttt{<datatype>IIRFilter}} | |
| \\ | | \idx[Type]{REAL4IIRFilter} | |
| %\hline | | \idx[Type]{REAL8IIRFilter} | |
| %\end{tabular} | | | |
| | | This structure stores the direct and recursive filter coefficients, as | |
| LALStatus codes are represented by the symbol | | well as the history of the auxiliary sequence $w$. \verb@<datatype>@ | |
| \verb@IIRFILTERH_E@\textit{name}. LALStatus descriptions are represented | | may be \verb@REAL4@ or \verb@REAL8@. The length of the history vector | |
| by the symbol \verb@IIRFILTERH_MSGE@\textit{name}. | | gives the order of the filter. The fields are: | |
| | | | |
| \begin{center} | | | |
| \begin{tabular}{|lcp{4.5in}|} | | | |
| \hline | | | |
| \it name & code & description \\ | | | |
| \hline | | | |
| \tt NUL & 1 & \vspace{-1.4ex}\tt "Arguments contain an unexpected null poi | | | |
| nter" \\ | | | |
| \tt OUT & 2 & \vspace{-1.4ex}\tt "Output already exists; cannot allocate m | | | |
| emory to a non-null pointer" \\ | | | |
| \tt MEM & 3 & \vspace{-1.4ex}\tt "Memory allocation failed" \\ | | | |
| \tt PAIR & 4 & \vspace{-1.4ex}\tt "Input contains nonreal poles or zeros th | | | |
| at do not have complex conjugate pairs" \\ | | | |
| \hline | | | |
| \end{tabular} | | | |
| \end{center} | | | |
| | | | |
| </lalLaTeX> */ | | | |
| | | | |
| /* <lalVerbati***> */ | | | |
| /* Missing a required pointer. */ | | | |
| #define IIRFILTER_ENUL 1 | | | |
| #define IIRFILTER_MSGENUL "Null pointer" | | | |
| | | | |
| /* Can't allocate to a non-null pointer. */ | | | |
| #define IIRFILTER_EOUT 2 | | | |
| #define IIRFILTER_MSGEOUT "Output already exists" | | | |
| | | | |
| /* Could not allocate memory. */ | | | |
| #define IIRFILTER_EMEM 3 | | | |
| #define IIRFILTER_MSGEMEM "Memory allocation error" | | | |
| | | | |
| /* For real filters, complex poles or zeros must come in conjugate pairs. * | | | |
| / | | | |
| #define IIRFILTER_EPAIR 4 | | | |
| #define IIRFILTER_MSGEPAIR "Input has unpaired nonreal poles or zeros" | | | |
| /* </lalVerbati***> */ | | | |
| | | | |
| /* <lalLaTeX> | | | |
| | | | |
| \subsection*{Structures} | | | |
| \begin{verbatim} | | | |
| <datatype>IIRFilter | | | |
| \end{verbatim} | | | |
| \index{\verb&REAL4IIRFilter&} | | | |
| \index{\verb&REAL8IIRFilter&} | | | |
| | | | |
| \noindent This structure stores the direct and recursive filter | | | |
| coefficients, as well as the history of the auxiliary sequence $w$. | | | |
| \verb@<datatype>@ may be \verb@REAL4@ or \verb@REAL8@. The length of | | | |
| the history vector gives the order of the filter. The fields are: | | | |
| | | | |
| \begin{description} | | \begin{description} | |
| \item[\texttt{CHAR *name}] A user-assigned name. | | \item[\texttt{CHAR *name}] A user-assigned name. | |
| | | | |
|
| | | \item[\texttt{REAL8 deltaT}] The sampling time interval of the filter. | |
| | | If $\leq0$, it will be ignored (i.e.\ it will be taken from the data | |
| | | stream). | |
| | | | |
| \item[\texttt{<datatype>Vector *directCoef}] The direct filter | | \item[\texttt{<datatype>Vector *directCoef}] The direct filter | |
| coefficients. | | coefficients. | |
| | | | |
| \item[\texttt{<datatype>Vector *recursCoef}] The recursive filter | | \item[\texttt{<datatype>Vector *recursCoef}] The recursive filter | |
| coefficients. | | coefficients. | |
| | | | |
| \item[\texttt{<datatype>Vector *history}] The previous values of $w$. | | \item[\texttt{<datatype>Vector *history}] The previous values of $w$. | |
| \end{description} | | \end{description} | |
| | | | |
|
| </lalLaTeX> */ | | ******************************************************* </lalLaTeX> */ | |
| | | | |
| typedef struct tagREAL4IIRFilter{ | | typedef struct tagREAL4IIRFilter{ | |
| CHAR *name; /* User assigned name. */ | | CHAR *name; /* User assigned name. */ | |
|
| | | REAL8 deltaT; /* Sampling time interval. */ | |
| 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; | |
| | | | |
| typedef struct tagREAL8IIRFilter{ | | typedef struct tagREAL8IIRFilter{ | |
| CHAR *name; /* User assigned name. */ | | CHAR *name; /* User assigned name. */ | |
|
| | | REAL8 deltaT; /* Sampling time interval. */ | |
| REAL8Vector *directCoef; /* The direct filter coefficients. */ | | REAL8Vector *directCoef; /* The direct filter coefficients. */ | |
| REAL8Vector *recursCoef; /* The recursive filter coefficients. */ | | REAL8Vector *recursCoef; /* The recursive filter coefficients. */ | |
| REAL8Vector *history; /* The previous values of w. */ | | REAL8Vector *history; /* The previous values of w. */ | |
| } REAL8IIRFilter; | | } REAL8IIRFilter; | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| \vfill{\footnotesize\input{IIRFilterHV}} | | \vfill{\footnotesize\input{IIRFilterHV}} | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
| | | | |
| /* Function prototypes. */ | | /* Function prototypes. */ | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| \newpage\input{CreateIIRFilterC} | | \newpage\input{CreateIIRFilterC} | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
|
| void LALCreateREAL4IIRFilter(LALStatus *stat, | | void | |
| REAL4IIRFilter **output, | | LALCreateREAL4IIRFilter( LALStatus *stat, | |
| COMPLEX8ZPGFilter *input); | | REAL4IIRFilter **output, | |
| | | COMPLEX8ZPGFilter *input ); | |
| void LALCreateREAL8IIRFilter(LALStatus *stat, | | | |
| REAL8IIRFilter **output, | | void | |
| COMPLEX16ZPGFilter *input); | | LALCreateREAL8IIRFilter( LALStatus *stat, | |
| | | REAL8IIRFilter **output, | |
| | | COMPLEX16ZPGFilter *input ); | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| \newpage\input{DestroyIIRFilterC} | | \newpage\input{DestroyIIRFilterC} | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
|
| void LALDestroyREAL4IIRFilter(LALStatus *stat, | | void | |
| REAL4IIRFilter **input); | | LALDestroyREAL4IIRFilter( LALStatus *stat, | |
| | | REAL4IIRFilter **input ); | |
| void LALDestroyREAL8IIRFilter(LALStatus *stat, | | | |
| REAL8IIRFilter **input); | | void | |
| | | LALDestroyREAL8IIRFilter( LALStatus *stat, | |
| | | REAL8IIRFilter **input ); | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| \newpage\input{IIRFilterC} | | \newpage\input{IIRFilterC} | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
|
| void LALIIRFilterREAL4(LALStatus *stat, | | void | |
| REAL4 *output, | | LALIIRFilterREAL4( LALStatus *stat, | |
| REAL4 input, | | REAL4 *output, | |
| REAL4IIRFilter *filter); | | REAL4 input, | |
| | | REAL4IIRFilter *filter ); | |
| void LALIIRFilterREAL8(LALStatus *stat, | | | |
| REAL8 *output, | | void | |
| REAL8 input, | | LALIIRFilterREAL8( LALStatus *stat, | |
| REAL8IIRFilter *filter); | | REAL8 *output, | |
| | | REAL8 input, | |
| | | REAL8IIRFilter *filter ); | |
| | | | |
|
| REAL4 LALSIIRFilter(REAL4 x, REAL4IIRFilter *filter); | | REAL4 | |
| | | LALSIIRFilter( REAL4 x, REAL4IIRFilter *filter ); | |
| | | | |
|
| REAL8 LALDIIRFilter(REAL8 x, REAL8IIRFilter *filter); | | REAL8 | |
| | | LALDIIRFilter( REAL8 x, REAL8IIRFilter *filter ); | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| \newpage\input{IIRFilterVectorC} | | \newpage\input{IIRFilterVectorC} | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
|
| void LALIIRFilterREAL4Vector(LALStatus *stat, | | void | |
| REAL4Vector *vector, | | LALIIRFilterREAL4Vector( LALStatus *stat, | |
| REAL4IIRFilter *filter); | | REAL4Vector *vector, | |
| | | REAL4IIRFilter *filter ); | |
| void LALIIRFilterREAL8Vector(LALStatus *stat, | | | |
| REAL8Vector *vector, | | void | |
| REAL8IIRFilter *filter); | | LALIIRFilterREAL8Vector( LALStatus *stat, | |
| | | REAL8Vector *vector, | |
| | | REAL8IIRFilter *filter ); | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| \newpage\input{IIRFilterVectorRC} | | \newpage\input{IIRFilterVectorRC} | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
|
| void LALIIRFilterREAL4VectorR(LALStatus *stat, | | void | |
| REAL4Vector *vector, | | LALIIRFilterREAL4VectorR( LALStatus *stat, | |
| REAL4IIRFilter *filter); | | REAL4Vector *vector, | |
| | | REAL4IIRFilter *filter ); | |
| void LALIIRFilterREAL8VectorR(LALStatus *stat, | | | |
| REAL8Vector *vector, | | void | |
| REAL8IIRFilter *filter); | | LALIIRFilterREAL8VectorR( LALStatus *stat, | |
| | | REAL8Vector *vector, | |
| | | REAL8IIRFilter *filter ); | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| \newpage\input{IIRFilterTestC} | | \newpage\input{IIRFilterTestC} | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
|
| | | #pragma { | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif /* _IIRFILTER_H */ | | #endif /* _IIRFILTER_H */ | |
| | | | |
End of changes. 23 change blocks. |
| 124 lines changed or deleted | | 92 lines changed or added | |
|
| LALConstants.h | | LALConstants.h | |
| /********************************* <lalVerbatim file="LALConstantsHV"> | | /********************************* <lalVerbatim file="LALConstantsHV"> | |
| Author: Creighton, T. D. | | Author: Creighton, T. D. | |
|
| $Id: LALConstants.h,v 1.4 2000/06/03 21:38:59 jolien Exp $ | | $Id: LALConstants.h,v 1.9 2001/08/21 04:19:52 jolien Exp $ | |
| ********************************** </lalVerbatim> */ | | ********************************** </lalVerbatim> */ | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| | | | |
| \section{Header \texttt{LALConstants.h}} | | \section{Header \texttt{LALConstants.h}} | |
| \label{s:LALConstants.h} | | \label{s:LALConstants.h} | |
| | | | |
| Provides standard numerical constants for LAL. | | Provides standard numerical constants for LAL. | |
| | | | |
| \subsection*{Synopsis} | | \subsection*{Synopsis} | |
| \begin{verbatim} | | \begin{verbatim} | |
|
| #include "LALConstants.h" | | #include <lal/LALConstants.h> | |
| \end{verbatim} | | \end{verbatim} | |
| | | | |
| \noindent This header defines a number of useful numerical constants | | \noindent This header defines a number of useful numerical constants | |
| for use in LAL routines. These constants come in three basic | | for use in LAL routines. These constants come in three basic | |
| flavours: arithmetic and mathematical constants, fundamental (or | | flavours: arithmetic and mathematical constants, fundamental (or | |
| defined) physical constants, and measured astrophysical and | | defined) physical constants, and measured astrophysical and | |
| cosmological parameters. | | cosmological parameters. | |
| | | | |
| Note that, unlike the other headers in the \verb@std@ package, this | | Note that, unlike the other headers in the \verb@std@ package, this | |
| header is \emph{not} included automatically by the header | | header is \emph{not} included automatically by the header | |
| \verb@LALStdlib.h@. Include it explicitly if you need any of these | | \verb@LALStdlib.h@. Include it explicitly if you need any of these | |
| constants. | | constants. | |
| | | | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
| | | | |
| #ifndef _LALCONSTANTS_H | | #ifndef _LALCONSTANTS_H | |
| #define _LALCONSTANTS_H | | #define _LALCONSTANTS_H | |
| | | | |
|
| #include "LALRCSID.h" | | #include <lal/LALRCSID.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
|
| NRCSID (LALCONSTANTSH, "$Id: LALConstants.h,v 1.4 2000/06/03 21:38:59 jolie
n Exp $"); | | NRCSID (LALCONSTANTSH, "$Id: LALConstants.h,v 1.9 2001/08/21 04:19:52 jolie
n Exp $"); | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| | | | |
| \subsection*{Mathematical constants} | | \subsection*{Mathematical constants} | |
|
| | | \idx[Constant]{LAL\_REAL4\_MANT} | |
| | | \idx[Constant]{LAL\_REAL4\_MAX} | |
| | | \idx[Constant]{LAL\_REAL4\_MIN} | |
| | | \idx[Constant]{LAL\_REAL4\_EPS} | |
| | | \idx[Constant]{LAL\_REAL8\_MANT} | |
| | | \idx[Constant]{LAL\_REAL8\_MAX} | |
| | | \idx[Constant]{LAL\_REAL8\_MIN} | |
| | | \idx[Constant]{LAL\_REAL8\_EPS} | |
| | | \idx[Constant]{LAL\_E} | |
| | | \idx[Constant]{LAL\_LOG2E} | |
| | | \idx[Constant]{LAL\_LOG10E} | |
| | | \idx[Constant]{LAL\_LN2} | |
| | | \idx[Constant]{LAL\_LN10} | |
| | | \idx[Constant]{LAL\_SQRT2} | |
| | | \idx[Constant]{LAL\_SQRT1\_2} | |
| | | \idx[Constant]{LAL\_GAMMA} | |
| | | \idx[Constant]{LAL\_PI} | |
| | | \idx[Constant]{LAL\_TWOPI} | |
| | | \idx[Constant]{LAL\_PI\_2} | |
| | | \idx[Constant]{LAL\_PI\_4} | |
| | | \idx[Constant]{LAL\_1\_PI} | |
| | | \idx[Constant]{LAL\_2\_PI} | |
| | | \idx[Constant]{LAL\_2\_SQRTPI} | |
| | | \idx[Constant]{LAL\_PI\_180} | |
| | | \idx[Constant]{LAL\_180\_PI} | |
| | | | |
| 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. | |
| | | | |
| \begin{center} | | \begin{center} | |
| \begin{tabular}{|lll|} | | \begin{tabular}{|lll|} | |
| \hline | | \hline | |
| Name & Value & Description \\ | | Name & Value & Description \\ | |
| \hline | | \hline | |
| | | | |
| skipping to change at line 122 | | skipping to change at line 147 | |
| \tt LAL\_SQRT2 & 1.4142135623730950488016887242096981 & $\sqrt{2}$ \\ | | \tt LAL\_SQRT2 & 1.4142135623730950488016887242096981 & $\sqrt{2}$ \\ | |
| \tt LAL\_SQRT1\_2 & 0.7071067811865475244008443621048490 & $1/\sqrt{2}$ \\ | | \tt LAL\_SQRT1\_2 & 0.7071067811865475244008443621048490 & $1/\sqrt{2}$ \\ | |
| \tt LAL\_GAMMA & 0.5772156649015328606065120900824024 & $\gamma$ \\ | | \tt LAL\_GAMMA & 0.5772156649015328606065120900824024 & $\gamma$ \\ | |
| \tt LAL\_PI & 3.1415926535897932384626433832795029 & $\pi$ \\ | | \tt LAL\_PI & 3.1415926535897932384626433832795029 & $\pi$ \\ | |
| \tt LAL\_TWOPI & 6.2831853071795864769252867665590058 & $2\pi$ \\ | | \tt LAL\_TWOPI & 6.2831853071795864769252867665590058 & $2\pi$ \\ | |
| \tt LAL\_PI\_2 & 1.5707963267948966192313216916397514 & $\pi/2$ \\ | | \tt LAL\_PI\_2 & 1.5707963267948966192313216916397514 & $\pi/2$ \\ | |
| \tt LAL\_PI\_4 & 0.7853981633974483096156608458198757 & $\pi/4$ \\ | | \tt LAL\_PI\_4 & 0.7853981633974483096156608458198757 & $\pi/4$ \\ | |
| \tt LAL\_1\_PI & 0.3183098861837906715377675267450287 & $1/\pi$ \\ | | \tt LAL\_1\_PI & 0.3183098861837906715377675267450287 & $1/\pi$ \\ | |
| \tt LAL\_2\_PI & 0.6366197723675813430755350534900574 & $2/\pi$ \\ | | \tt LAL\_2\_PI & 0.6366197723675813430755350534900574 & $2/\pi$ \\ | |
| \tt LAL\_2\_SQRTPI & 1.1283791670955125738961589031215452 & $2/\sqrt{\pi}$
\\ | | \tt LAL\_2\_SQRTPI & 1.1283791670955125738961589031215452 & $2/\sqrt{\pi}$
\\ | |
|
| | | \tt LAL\_PI\_180 & 1.7453292519943295769236907684886127$\times10^{-2}$ & | |
| | | $\pi/180$ \\ | |
| | | \tt LAL\_180\_PI & 57.295779513082320876798154814105170 & $180/\pi$ \\ | |
| \hline | | \hline | |
| \end{tabular} | | \end{tabular} | |
| \end{center} | | \end{center} | |
| | | | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
| | | | |
| #define LAL_E 2.7182818284590452353602874713526625L /* e */ | | #define LAL_E 2.7182818284590452353602874713526625L /* e */ | |
| #define LAL_LOG2E 1.4426950408889634073599246810018922L /* log_2 e */ | | #define LAL_LOG2E 1.4426950408889634073599246810018922L /* log_2 e */ | |
| #define LAL_LOG10E 0.4342944819032518276511289189166051L /* log_10 e */ | | #define LAL_LOG10E 0.4342944819032518276511289189166051L /* log_10 e */ | |
| #define LAL_LN2 0.6931471805599453094172321214581766L /* log_e 2 */ | | #define LAL_LN2 0.6931471805599453094172321214581766L /* log_e 2 */ | |
| | | | |
| skipping to change at line 144 | | skipping to change at line 172 | |
| #define LAL_SQRT1_2 0.7071067811865475244008443621048490L /* 1/sqrt(2) *
/ | | #define LAL_SQRT1_2 0.7071067811865475244008443621048490L /* 1/sqrt(2) *
/ | |
| #define LAL_GAMMA 0.5772156649015328606065120900824024L /* gamma */ | | #define LAL_GAMMA 0.5772156649015328606065120900824024L /* gamma */ | |
| /* Assuming we're not near a black hole or in Tennessee... */ | | /* Assuming we're not near a black hole or in Tennessee... */ | |
| #define LAL_PI 3.1415926535897932384626433832795029L /* pi */ | | #define LAL_PI 3.1415926535897932384626433832795029L /* pi */ | |
| #define LAL_TWOPI 6.2831853071795864769252867665590058L /* 2*pi */ | | #define LAL_TWOPI 6.2831853071795864769252867665590058L /* 2*pi */ | |
| #define LAL_PI_2 1.5707963267948966192313216916397514L /* pi/2 */ | | #define LAL_PI_2 1.5707963267948966192313216916397514L /* pi/2 */ | |
| #define LAL_PI_4 0.7853981633974483096156608458198757L /* pi/4 */ | | #define LAL_PI_4 0.7853981633974483096156608458198757L /* pi/4 */ | |
| #define LAL_1_PI 0.3183098861837906715377675267450287L /* 1/pi */ | | #define LAL_1_PI 0.3183098861837906715377675267450287L /* 1/pi */ | |
| #define LAL_2_PI 0.6366197723675813430755350534900574L /* 2/pi */ | | #define LAL_2_PI 0.6366197723675813430755350534900574L /* 2/pi */ | |
| #define LAL_2_SQRTPI 1.1283791670955125738961589031215452L /* 2/sqrt(pi)
*/ | | #define LAL_2_SQRTPI 1.1283791670955125738961589031215452L /* 2/sqrt(pi)
*/ | |
|
| | | #define LAL_PI_180 1.7453292519943295769236907684886127e-2L /* pi/180 */ | |
| | | #define LAL_180_PI 57.295779513082320876798154814105170L /* 180/pi */ | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| | | | |
| \subsection*{Physical constants} | | \subsection*{Physical constants} | |
|
| | | \idx[Constant]{LAL\_C\_SI} | |
| | | \idx[Constant]{LAL\_EPSILON0\_SI} | |
| | | \idx[Constant]{LAL\_MU0\_SI} | |
| | | \idx[Constant]{LAL\_GEARTH\_SI} | |
| | | \idx[Constant]{LAL\_PATM\_SI} | |
| | | \idx[Constant]{LAL\_G\_SI} | |
| | | \idx[Constant]{LAL\_H\_SI} | |
| | | \idx[Constant]{LAL\_HBAR\_SI} | |
| | | \idx[Constant]{LAL\_MPL\_SI} | |
| | | \idx[Constant]{LAL\_LPL\_SI} | |
| | | \idx[Constant]{LAL\_TPL\_SI} | |
| | | \idx[Constant]{LAL\_K\_SI} | |
| | | \idx[Constant]{LAL\_R\_SI} | |
| | | \idx[Constant]{LAL\_MOL} | |
| | | \idx[Constant]{LAL\_BWIEN\_SI} | |
| | | \idx[Constant]{LAL\_SIGMA\_SI} | |
| | | \idx[Constant]{LAL\_AMU\_SI} | |
| | | \idx[Constant]{LAL\_MP\_SI} | |
| | | \idx[Constant]{LAL\_ME\_SI} | |
| | | \idx[Constant]{LAL\_QP\_SI} | |
| | | \idx[Constant]{LAL\_ALPHA} | |
| | | \idx[Constant]{LAL\_RE\_SI} | |
| | | \idx[Constant]{LAL\_LAMBDAE\_SI} | |
| | | \idx[Constant]{LAL\_AB\_SI} | |
| | | \idx[Constant]{LAL\_MUB\_SI} | |
| | | \idx[Constant]{LAL\_MUN\_SI} | |
| | | | |
| The following physical constants are defined to have exact values. | | The following physical constants are defined to have exact values. | |
| The values of $c$ and $g$ are taken from~\cite{Barnet:1996}, | | The values of $c$ and $g$ are taken from~\cite{Barnet:1996}, | |
| $p_\mathrm{atm}$ is from~\cite{Lang:1992}, while $\epsilon_0$ and | | $p_\mathrm{atm}$ is from~\cite{Lang:1992}, while $\epsilon_0$ and | |
| $\mu_0$ are computed from $c$ using exact formulae. They are given in | | $\mu_0$ are computed from $c$ using exact formulae. They are given in | |
| the SI units shown. | | the SI units shown. | |
| | | | |
| \begin{center} | | \begin{center} | |
| \begin{tabular}{|lll|} | | \begin{tabular}{|lll|} | |
| \hline | | \hline | |
| | | | |
| skipping to change at line 262 | | skipping to change at line 318 | |
| #define LAL_ALPHA 7.297354677e-3 /* Fine structure constant, dimensionless
*/ | | #define LAL_ALPHA 7.297354677e-3 /* Fine structure constant, dimensionless
*/ | |
| #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 */ | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| | | | |
| \subsection*{Astrophysical parameters} | | \subsection*{Astrophysical parameters} | |
|
| | | \idx[Constant]{LAL\_REARTH\_SI} | |
| | | \idx[Constant]{LAL\_AWGS84\_SI} | |
| | | \idx[Constant]{LAL\_BWGS84\_SI} | |
| | | \idx[Constant]{LAL\_MEARTH\_SI} | |
| | | \idx[Constant]{LAL\_IEARTH} | |
| | | \idx[Constant]{LAL\_EEARTH} | |
| | | \idx[Constant]{LAL\_RSUN\_SI} | |
| | | \idx[Constant]{LAL\_MSUN\_SI} | |
| | | \idx[Constant]{LAL\_MRSUN\_SI} | |
| | | \idx[Constant]{LAL\_MTSUN\_SI} | |
| | | \idx[Constant]{LAL\_LSUN\_SI} | |
| | | \idx[Constant]{LAL\_AU\_SI} | |
| | | \idx[Constant]{LAL\_PC\_SI} | |
| | | \idx[Constant]{LAL\_YRTROP\_SI} | |
| | | \idx[Constant]{LAL\_YRSID\_SI} | |
| | | \idx[Constant]{LAL\_DAYSID\_SI} | |
| | | \idx[Constant]{LAL\_LYR\_SI} | |
| | | \idx[Constant]{LAL\_H0\_SI} | |
| | | \idx[Constant]{LAL\_H0FAC\_SI} | |
| | | \idx[Constant]{LAL\_RHOC\_SI} | |
| | | \idx[Constant]{LAL\_RHOCFAC\_SI} | |
| | | \idx[Constant]{LAL\_TCBR\_SI} | |
| | | \idx[Constant]{LAL\_VCBR\_SI} | |
| | | \idx[Constant]{LAL\_RHOCBR\_SI} | |
| | | \idx[Constant]{LAL\_NCBR\_SI} | |
| | | \idx[Constant]{LAL\_SCBR\_SI} | |
| | | | |
| 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~\cite{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~\cite{Lang:1992}. All values are | | Earth's orbit, which are taken from~\cite{Lang:1992}. All values are | |
| given in the SI units shown. | | given in the SI units shown. | |
| | | | |
| \begin{center} | | \begin{center} | |
| \begin{tabular}{|lll|} | | \begin{tabular}{|lll|} | |
| \hline | | \hline | |
| Name & Value & Description \\ | | Name & Value & Description \\ | |
| \hline | | \hline | |
| \tt LAL\_REARTH\_SI & $6.378140\times10^6\,\mathrm{m}$ & | | \tt LAL\_REARTH\_SI & $6.378140\times10^6\,\mathrm{m}$ & | |
| Earth equatorial radius \\ | | Earth equatorial radius \\ | |
|
| | | \tt LAL\_AWGS84\_SI & $6.378137\times10^6\,\mathrm{m}$ & | |
| | | Semimajor axis of WGS-84 Reference Ellipsoid \\ | |
| | | \tt LAL\_BWGS84\_SI & $6.356752314\times10^6\,\mathrm{m}$ & | |
| | | Semiminor axis of WGS-84 Reference Ellipsoid \\ | |
| \tt LAL\_MEARTH\_SI & $5.97370\times10^{24}\,\mathrm{kg}$ & Earth mass \\ | | \tt LAL\_MEARTH\_SI & $5.97370\times10^{24}\,\mathrm{kg}$ & Earth mass \\ | |
| \tt LAL\_IEARTH & $0.409092804\,\mathrm{rad}$ & | | \tt LAL\_IEARTH & $0.409092804\,\mathrm{rad}$ & | |
| Obliquity of the ecliptic (2000) \\ | | Obliquity of the ecliptic (2000) \\ | |
| \tt LAL\_EEARTH & 0.0167 & Earth orbital eccentricity \\ | | \tt LAL\_EEARTH & 0.0167 & Earth orbital eccentricity \\ | |
| \tt LAL\_RSUN\_SI & $6.960\times10^8\,\mathrm{m}$ & Solar equatorial radi
us\\ | | \tt LAL\_RSUN\_SI & $6.960\times10^8\,\mathrm{m}$ & Solar equatorial radi
us\\ | |
| \tt LAL\_MSUN\_SI & $1.98892\times10^{30}\,\mathrm{kg}$ & Solar mass \\ | | \tt LAL\_MSUN\_SI & $1.98892\times10^{30}\,\mathrm{kg}$ & Solar mass \\ | |
| \tt LAL\_MRSUN\_SI & $1.47662504\times10^3\,\mathrm{m}$ & | | \tt LAL\_MRSUN\_SI & $1.47662504\times10^3\,\mathrm{m}$ & | |
| Geometrized solar mass (length) \\ | | Geometrized solar mass (length) \\ | |
| \tt LAL\_MTSUN\_SI & $4.92549095\times10^{-6}\,\mathrm{s}$ & | | \tt LAL\_MTSUN\_SI & $4.92549095\times10^{-6}\,\mathrm{s}$ & | |
| Geometrized solar mass (time) \\ | | Geometrized solar mass (time) \\ | |
| | | | |
| skipping to change at line 302 | | skipping to change at line 388 | |
| \tt LAL\_DAYSID\_SI & $86\,164.09053\,\mathrm{s}$ & Mean sidereal day \\ | | \tt LAL\_DAYSID\_SI & $86\,164.09053\,\mathrm{s}$ & Mean sidereal day \\ | |
| \tt LAL\_LYR\_SI & $9.46052817\times10^{15}\,\mathrm{m}$ & | | \tt LAL\_LYR\_SI & $9.46052817\times10^{15}\,\mathrm{m}$ & | |
| $c\times$tropical year (1994) \\ | | $c\times$tropical year (1994) \\ | |
| \hline | | \hline | |
| \end{tabular} | | \end{tabular} | |
| \end{center} | | \end{center} | |
| | | | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
| | | | |
| #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 Reference | |
| | | Ellipsoid, m */ | |
| | | #define LAL_BWGS84_SI 6.356752314e6 /* Semiminor axis of WGS-84 Reference | |
| | | 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), radians
*/ | | #define LAL_IEARTH 0.409092804 /* Earth inclination (2000), radians
*/ | |
| #define LAL_EEARTH 0.0167 /* Earth orbital eccentricity */ | | #define LAL_EEARTH 0.0167 /* Earth orbital eccentricity */ | |
| #define LAL_RSUN_SI 6.960e8 /* Solar equatorial radius, m */ | | #define LAL_RSUN_SI 6.960e8 /* Solar equatorial radius, m */ | |
| #define LAL_MSUN_SI 1.98892e30 /* Solar mass, kg */ | | #define LAL_MSUN_SI 1.98892e30 /* Solar mass, kg */ | |
| #define LAL_MRSUN_SI 1.47662504e3 /* Geometrized solar mass, m */ | | #define LAL_MRSUN_SI 1.47662504e3 /* Geometrized solar mass, m */ | |
| #define LAL_MTSUN_SI 4.92549095e-6 /* Geometrized solar mass, s */ | | #define LAL_MTSUN_SI 4.92549095e-6 /* Geometrized solar mass, s */ | |
| #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 */ | |
| | | | |
End of changes. 11 change blocks. |
| 4 lines changed or deleted | | 94 lines changed or added | |
|
| LALDatatypes.h | | LALDatatypes.h | |
| /********************************* <lalVerbatim file="LALDatatypesHV"> | | /********************************* <lalVerbatim file="LALDatatypesHV"> | |
|
| Author: Finn, L. S. | | Author: J. D. E. Creighton, T. D. Creighton | |
| $Id: LALDatatypes.h,v 1.8 2000/07/23 01:14:34 jolien Exp $ | | $Id: LALDatatypes.h,v 1.11 2001/12/01 22:09:43 jolien Exp $ | |
| ********************************** </lalVerbatim> */ | | ********************************** </lalVerbatim> */ | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| | | | |
| \section{Header \texttt{LALDatatypes.h}} | | \section{Header \texttt{LALDatatypes.h}} | |
| \label{s:LALDatatypes.h} | | \label{s:LALDatatypes.h} | |
| | | | |
| Provides the basic LAL datatypes. | | Provides the basic LAL datatypes. | |
| | | | |
| \subsection*{Synopsis} | | \subsection*{Synopsis} | |
| \begin{verbatim} | | \begin{verbatim} | |
|
| #include "LALDatatypes.h" | | #include <lal/LALDatatypes.h> | |
| \end{verbatim} | | \end{verbatim} | |
| | | | |
| \noindent This header defines the standard data types and data | | \noindent This header defines the standard data types and data | |
| structures that are used throughout LAL. They fall into three general | | structures that are used throughout LAL. They fall into three general | |
| categories: \emph{primitive} datatypes, \emph{aggregates} of primitive | | categories: \emph{primitive} datatypes, \emph{aggregates} of primitive | |
| datatypes, and \emph{structured} datatypes. The LAL status structure | | datatypes, and \emph{structured} datatypes. The LAL status structure | |
| is a special case of a structured datatype that is used in every | | is a special case of a structured datatype that is used in every | |
| standard LAL function. | | standard LAL function. | |
| | | | |
| This header file is automatically included by the header | | This header file is automatically included by the header | |
| | | | |
| skipping to change at line 38 | | skipping to change at line 38 | |
| following section. | | following section. | |
| | | | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
| | | | |
| #ifndef _LALDATATYPES_H | | #ifndef _LALDATATYPES_H | |
| #define _LALDATATYPES_H | | #define _LALDATATYPES_H | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| \newpage\input{LALAtomicDatatypesH} | | \newpage\input{LALAtomicDatatypesH} | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
|
| #include "LALAtomicDatatypes.h" | | #include <lal/LALAtomicDatatypes.h> | |
| #include "LALRCSID.h" | | #include <lal/LALRCSID.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
|
| NRCSID (LALDATATYPESH, "$Id: LALDatatypes.h,v 1.8 2000/07/23 01:14:34 jolie
n Exp $"); | | NRCSID (LALDATATYPESH, "$Id: LALDatatypes.h,v 1.11 2001/12/01 22:09:43 joli
en Exp $"); | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| \newpage | | \newpage | |
| \subsection{Aggregate datatypes} | | \subsection{Aggregate datatypes} | |
| \label{ss:aggregate-datatypes} | | \label{ss:aggregate-datatypes} | |
| | | | |
| These datatypes store arbitrarily large sets or collections of | | These datatypes store arbitrarily large sets or collections of | |
| primitive datatypes. At this level there is no physical | | primitive datatypes. At this level there is no physical | |
| interpretation assigned to the objects (such as names or units); the | | interpretation assigned to the objects (such as names or units); the | |
| aggregate datatypes simply collect and arrange the primitive | | aggregate datatypes simply collect and arrange the primitive | |
| | | | |
| skipping to change at line 603 | | skipping to change at line 603 | |
| { | | { | |
| INT4 gpsSeconds; | | INT4 gpsSeconds; | |
| INT4 gpsNanoSeconds; | | INT4 gpsNanoSeconds; | |
| } | | } | |
| LIGOTimeGPS; | | LIGOTimeGPS; | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| | | | |
| \vspace{2ex} | | \vspace{2ex} | |
| \begin{verbatim} | | \begin{verbatim} | |
|
| | | LALUnit | |
| | | \end{verbatim} | |
| | | This structure stores units in the mksA system (plus Kelvin, Strain, | |
| | | and ADC Count). It also stores an overall power-of-ten scaling factor. | |
| | | The fields are: | |
| | | \begin{description} | |
| | | \item[\texttt{INT2 powerOfTen}] The power $p$ of ten scaling factor. | |
| | | \item[\texttt{INT2 unitNumerator[LALNumUnits]}] Array of unit numerators, | |
| | | $N_i$, $i=0\ldots\textrm{LALNumUnits}-1$. | |
| | | \item[\texttt{INT2 unitDenominatorMinusOne[LALNumUnits]}] Array of unit | |
| | | denominators-minus-one, $D_i$, $i=0\ldots\textrm{LALNumUnits}-1$. | |
| | | \end{description} | |
| | | Thus, the units are given by | |
| | | \begin{equation} | |
| | | 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{K}^{N_4/(1+D_4)}\times\textrm{strain}^{N_5/(1+D_5)} | |
| | | \times\textrm{count}^{N_6/(1+D_6)} | |
| | | \end{equation} | |
| | | The indexes of the units can be specified using the constants | |
| | | \texttt{LALUnitIndexMeter}, | |
| | | \texttt{LALUnitIndexKiloGram}, | |
| | | \texttt{LALUnitIndexSecond}, | |
| | | \texttt{LALUnitIndexAmpere}, | |
| | | \texttt{LALUnitIndexKelvin}, | |
| | | \texttt{LALUnitIndexStrain}, | |
| | | \texttt{LALUnitIndexADCCount}, | |
| | | while \texttt{LALNumUnits} is the total number of units. | |
| | | | |
| | | </lalLaTeX> */ | |
| | | | |
| | | enum | |
| | | { | |
| | | LALUnitIndexMeter, | |
| | | LALUnitIndexKiloGram, | |
| | | LALUnitIndexSecond, | |
| | | LALUnitIndexAmpere, | |
| | | LALUnitIndexKelvin, | |
| | | LALUnitIndexStrain, | |
| | | LALUnitIndexADCCount, | |
| | | LALNumUnits | |
| | | }; | |
| | | | |
| | | typedef struct | |
| | | tagLALUnit | |
| | | { | |
| | | INT2 powerOfTen; | |
| | | INT2 unitNumerator[LALNumUnits]; | |
| | | UINT2 unitDenominatorMinusOne[LALNumUnits]; | |
| | | } | |
| | | LALUnit; | |
| | | | |
| | | /* <lalLaTeX> | |
| | | | |
| | | \vspace{2ex} | |
| | | \begin{verbatim} | |
| <datatype>TimeSeries | | <datatype>TimeSeries | |
| \end{verbatim} | | \end{verbatim} | |
| This structure represents a sequence of data of type \verb@<datatype>@ | | This structure represents a sequence of data of type \verb@<datatype>@ | |
| (where \verb@<datatype>@ can be any primitive datatype), sampled over | | (where \verb@<datatype>@ can be any primitive datatype), sampled over | |
| uniform time intervals $t_0, t_0+\Delta t, \ldots , t_0+l\Delta t$. | | uniform time intervals $t_0, t_0+\Delta t, \ldots , t_0+l\Delta t$. | |
| Essentially this is a \verb@<datatype>Sequence@ with extra fields | | Essentially this is a \verb@<datatype>Sequence@ with extra fields | |
| defining the sample times and the type of data being sampled. The raw | | defining the sample times and the type of data being sampled. The raw | |
| data may also have been \emph{heterodyned}; that is, multiplied by a | | data may also have been \emph{heterodyned}; that is, multiplied by a | |
| sinusoid of some frequency $f_0$, low-pass filtered, and resampled, in | | sinusoid of some frequency $f_0$, low-pass filtered, and resampled, in | |
| order to extract the behaviour in a small bandwidth about $f_0$. The | | order to extract the behaviour in a small bandwidth about $f_0$. The | |
| fields are: | | fields are: | |
| \begin{description} | | \begin{description} | |
|
| \item[\texttt{CHAR *name}] The name of the data series (i.e.\ the type | | \item[\texttt{CHAR name[LALNameLength]}] The name of the data series (i.e.\ | |
| of data being sampled). | | the type of data being sampled). | |
| \item[\texttt{LIGOTimeGPS epoch}] The start time $t_0$ of the data | | \item[\texttt{LIGOTimeGPS epoch}] The start time $t_0$ of the data | |
| series. | | series. | |
| \item[\texttt{REAL8 deltaT}] The sampling interval $\Delta t$, in | | \item[\texttt{REAL8 deltaT}] The sampling interval $\Delta t$, in | |
| seconds. | | seconds. | |
| \item[\texttt{REAL8 f0}] The heterodyning frequency $f_0$, in hertz. | | \item[\texttt{REAL8 f0}] The heterodyning frequency $f_0$, in hertz. | |
|
| \item[\texttt{CHARVector *sampleUnits}] The physical units of the | | \item[\texttt{LALUnit sampleUnits}] The physical units of the | |
| quantity being sampled. | | quantity being sampled. | |
| \item[\texttt{<datatype>Sequence *data}] The sequence of sampled data. | | \item[\texttt{<datatype>Sequence *data}] The sequence of sampled data. | |
| \end{description} | | \end{description} | |
| | | | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
| | | | |
|
| | | enum { LALNameLength = 64 }; | |
| | | | |
| typedef struct | | typedef struct | |
| tagINT2TimeSeries | | tagINT2TimeSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| INT2Sequence *data; | | INT2Sequence *data; | |
| } | | } | |
| INT2TimeSeries; | | INT2TimeSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagUINT2TimeSeries | | tagUINT2TimeSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| UINT2Sequence *data; | | UINT2Sequence *data; | |
| } | | } | |
| UINT2TimeSeries; | | UINT2TimeSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagINT4TimeSeries | | tagINT4TimeSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| INT4Sequence *data; | | INT4Sequence *data; | |
| } | | } | |
| INT4TimeSeries; | | INT4TimeSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagUINT4TimeSeries | | tagUINT4TimeSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| UINT4Sequence *data; | | UINT4Sequence *data; | |
| } | | } | |
| UINT4TimeSeries; | | UINT4TimeSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagINT8TimeSeries | | tagINT8TimeSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| INT8Sequence *data; | | INT8Sequence *data; | |
| } | | } | |
| INT8TimeSeries; | | INT8TimeSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagUINT8TimeSeries | | tagUINT8TimeSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| UINT8Sequence *data; | | UINT8Sequence *data; | |
| } | | } | |
| UINT8TimeSeries; | | UINT8TimeSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagREAL4TimeSeries | | tagREAL4TimeSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| REAL4Sequence *data; | | REAL4Sequence *data; | |
| } | | } | |
| REAL4TimeSeries; | | REAL4TimeSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagREAL8TimeSeries | | tagREAL8TimeSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| REAL8Sequence *data; | | REAL8Sequence *data; | |
| } | | } | |
| REAL8TimeSeries; | | REAL8TimeSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagCOMPLEX8TimeSeries | | tagCOMPLEX8TimeSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| COMPLEX8Sequence *data; | | COMPLEX8Sequence *data; | |
| } | | } | |
| COMPLEX8TimeSeries; | | COMPLEX8TimeSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagCOMPLEX16TimeSeries | | tagCOMPLEX16TimeSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| COMPLEX16Sequence *data; | | COMPLEX16Sequence *data; | |
| } | | } | |
| COMPLEX16TimeSeries; | | COMPLEX16TimeSeries; | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| | | | |
| \vspace{2ex} | | \vspace{2ex} | |
| \begin{verbatim} | | \begin{verbatim} | |
| <datatype>TimeVectorSeries | | <datatype>TimeVectorSeries | |
| \end{verbatim} | | \end{verbatim} | |
| Like \verb@<datatype>TimeSeries@, above, except that the sampled data | | Like \verb@<datatype>TimeSeries@, above, except that the sampled data | |
| are of type type \verb@<datatype>Vector@ (where \verb@<datatype>@ can | | are of type type \verb@<datatype>Vector@ (where \verb@<datatype>@ can | |
| be any primitive datatype). The fields are: | | be any primitive datatype). The fields are: | |
| \begin{description} | | \begin{description} | |
|
| \item[\texttt{CHAR *name}] The name of the data series (i.e.\ the type | | \item[\texttt{CHAR name[LALNameLength]}] The name of the data series (i.e.\ | |
| of data being sampled). | | the type of data being sampled). | |
| \item[\texttt{LIGOTimeGPS epoch}] The start time of the data series. | | \item[\texttt{LIGOTimeGPS epoch}] The start time of the data series. | |
| \item[\texttt{REAL8 deltaT}] The sampling interval, in seconds. | | \item[\texttt{REAL8 deltaT}] The sampling interval, in seconds. | |
| \item[\texttt{REAL8 f0}] The heterodyning frequency, in hertz. | | \item[\texttt{REAL8 f0}] The heterodyning frequency, in hertz. | |
|
| \item[\texttt{CHARVector *sampleUnits}] The physical units of the | | \item[\texttt{LALUnit sampleUnits}] The physical units of the | |
| quantity being sampled. | | quantity being sampled. | |
| \item[\texttt{<datatype>VectorSequence *data}] The sequence of sampled | | \item[\texttt{<datatype>VectorSequence *data}] The sequence of sampled | |
| data. | | data. | |
| \end{description} | | \end{description} | |
| | | | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
| | | | |
| typedef struct | | typedef struct | |
| tagINT2TimeVectorSeries | | tagINT2TimeVectorSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| INT2VectorSequence *data; | | INT2VectorSequence *data; | |
| } | | } | |
| INT2TimeVectorSeries; | | INT2TimeVectorSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagUINT2TimeVectorSeries | | tagUINT2TimeVectorSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| UINT2VectorSequence *data; | | UINT2VectorSequence *data; | |
| } | | } | |
| UINT2TimeVectorSeries; | | UINT2TimeVectorSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagINT4TimeVectorSeries | | tagINT4TimeVectorSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| INT4VectorSequence *data; | | INT4VectorSequence *data; | |
| } | | } | |
| INT4TimeVectorSeries; | | INT4TimeVectorSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagUINT4TimeVectorSeries | | tagUINT4TimeVectorSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| UINT4VectorSequence *data; | | UINT4VectorSequence *data; | |
| } | | } | |
| UINT4TimeVectorSeries; | | UINT4TimeVectorSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagINT8TimeVectorSeries | | tagINT8TimeVectorSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| INT8VectorSequence *data; | | INT8VectorSequence *data; | |
| } | | } | |
| INT8TimeVectorSeries; | | INT8TimeVectorSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagUINT8TimeVectorSeries | | tagUINT8TimeVectorSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| UINT8VectorSequence *data; | | UINT8VectorSequence *data; | |
| } | | } | |
| UINT8TimeVectorSeries; | | UINT8TimeVectorSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagREAL4TimeVectorSeries | | tagREAL4TimeVectorSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| REAL4VectorSequence *data; | | REAL4VectorSequence *data; | |
| } | | } | |
| REAL4TimeVectorSeries; | | REAL4TimeVectorSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagREAL8TimeVectorSeries | | tagREAL8TimeVectorSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| REAL8VectorSequence *data; | | REAL8VectorSequence *data; | |
| } | | } | |
| REAL8TimeVectorSeries; | | REAL8TimeVectorSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagCOMPLEX8TimeVectorSeries | | tagCOMPLEX8TimeVectorSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| COMPLEX8VectorSequence *data; | | COMPLEX8VectorSequence *data; | |
| } | | } | |
| COMPLEX8TimeVectorSeries; | | COMPLEX8TimeVectorSeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagCOMPLEX16TimeVectorSeries | | tagCOMPLEX16TimeVectorSeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| COMPLEX16VectorSequence *data; | | COMPLEX16VectorSequence *data; | |
| } | | } | |
| COMPLEX16TimeVectorSeries; | | COMPLEX16TimeVectorSeries; | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| | | | |
| \vspace{2ex} | | \vspace{2ex} | |
| \begin{verbatim} | | \begin{verbatim} | |
| <datatype>TimeArraySeries | | <datatype>TimeArraySeries | |
| \end{verbatim} | | \end{verbatim} | |
| Like \verb@<datatype>TimeSeries@, above, except that the sampled data | | Like \verb@<datatype>TimeSeries@, above, except that the sampled data | |
| are of type type \verb@<datatype>Array@ (where \verb@<datatype>@ can | | are of type type \verb@<datatype>Array@ (where \verb@<datatype>@ can | |
| be any primitive datatype). The fields are: | | be any primitive datatype). The fields are: | |
| \begin{description} | | \begin{description} | |
|
| \item[\texttt{CHAR *name}] The name of the data series (i.e.\ the type | | \item[\texttt{CHAR name[LALNameLength]}] The name of the data series (i.e.\ | |
| of data being sampled). | | the type of data being sampled). | |
| \item[\texttt{LIGOTimeGPS epoch}] The start time of the data series. | | \item[\texttt{LIGOTimeGPS epoch}] The start time of the data series. | |
| \item[\texttt{REAL8 deltaT}] The sampling interval, in seconds. | | \item[\texttt{REAL8 deltaT}] The sampling interval, in seconds. | |
| \item[\texttt{REAL8 f0}] The heterodyning frequency, in hertz. | | \item[\texttt{REAL8 f0}] The heterodyning frequency, in hertz. | |
|
| \item[\texttt{CHARVector *sampleUnits}] The physical units of the | | \item[\texttt{LALUnit sampleUnits}] The physical units of the | |
| quantity being sampled. | | quantity being sampled. | |
| \item[\texttt{<datatype>ArraySequence *data}] The sequence of sampled | | \item[\texttt{<datatype>ArraySequence *data}] The sequence of sampled | |
| data. | | data. | |
| \end{description} | | \end{description} | |
| | | | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
| | | | |
| typedef struct | | typedef struct | |
| tagINT2TimeArraySeries | | tagINT2TimeArraySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| INT2ArraySequence *data; | | INT2ArraySequence *data; | |
| } | | } | |
| INT2TimeArraySeries; | | INT2TimeArraySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagUINT2TimeArraySeries | | tagUINT2TimeArraySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| UINT2ArraySequence *data; | | UINT2ArraySequence *data; | |
| } | | } | |
| UINT2TimeArraySeries; | | UINT2TimeArraySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagINT4TimeArraySeries | | tagINT4TimeArraySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| INT4ArraySequence *data; | | INT4ArraySequence *data; | |
| } | | } | |
| INT4TimeArraySeries; | | INT4TimeArraySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagUINT4TimeArraySeries | | tagUINT4TimeArraySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| UINT4ArraySequence *data; | | UINT4ArraySequence *data; | |
| } | | } | |
| UINT4TimeArraySeries; | | UINT4TimeArraySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagINT8TimeArraySeries | | tagINT8TimeArraySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| INT8ArraySequence *data; | | INT8ArraySequence *data; | |
| } | | } | |
| INT8TimeArraySeries; | | INT8TimeArraySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagUINT8TimeArraySeries | | tagUINT8TimeArraySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| UINT8ArraySequence *data; | | UINT8ArraySequence *data; | |
| } | | } | |
| UINT8TimeArraySeries; | | UINT8TimeArraySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagREAL4TimeArraySeries | | tagREAL4TimeArraySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| REAL4ArraySequence *data; | | REAL4ArraySequence *data; | |
| } | | } | |
| REAL4TimeArraySeries; | | REAL4TimeArraySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagREAL8TimeArraySeries | | tagREAL8TimeArraySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| REAL8ArraySequence *data; | | REAL8ArraySequence *data; | |
| } | | } | |
| REAL8TimeArraySeries; | | REAL8TimeArraySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagCOMPLEX8TimeArraySeries | | tagCOMPLEX8TimeArraySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| COMPLEX8ArraySequence *data; | | COMPLEX8ArraySequence *data; | |
| } | | } | |
| COMPLEX8TimeArraySeries; | | COMPLEX8TimeArraySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagCOMPLEX16TimeArraySeries | | tagCOMPLEX16TimeArraySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| REAL8 f0; | | REAL8 f0; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| COMPLEX16ArraySequence *data; | | COMPLEX16ArraySequence *data; | |
| } | | } | |
| COMPLEX16TimeArraySeries; | | COMPLEX16TimeArraySeries; | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| | | | |
| \vspace{2ex} | | \vspace{2ex} | |
| \begin{verbatim} | | \begin{verbatim} | |
| <datatype>FrequencySeries | | <datatype>FrequencySeries | |
| \end{verbatim} | | \end{verbatim} | |
| This structure represents a frequency spectrum of data of type | | This structure represents a frequency spectrum of data of type | |
| \verb@<datatype>@ (where \verb@<datatype>@ can be any primitive | | \verb@<datatype>@ (where \verb@<datatype>@ can be any primitive | |
| datatype), sampled over uniform frequency intervals $f_0, f_0+\Delta | | datatype), sampled over uniform frequency intervals $f_0, f_0+\Delta | |
| f, \ldots , f_0+l\Delta f$. Essentially this is a | | f, \ldots , f_0+l\Delta f$. Essentially this is a | |
| \verb@<datatype>Sequence@ with extra fields defining the sample | | \verb@<datatype>Sequence@ with extra fields defining the sample | |
| frequencies, the timestamp of the spectrum, and the type of data being | | frequencies, the timestamp of the spectrum, and the type of data being | |
| sampled. The fields are: | | sampled. The fields are: | |
| \begin{description} | | \begin{description} | |
|
| \item[\texttt{CHAR *name}] The name of the data series (i.e.\ the type | | \item[\texttt{CHAR name[LALNameLength]}] The name of the data series (i.e.\ | |
| of data being sampled). | | the type of data being sampled). | |
| \item[\texttt{LIGOTimeGPS epoch}] The start time of the \emph{time} | | \item[\texttt{LIGOTimeGPS epoch}] The start time of the \emph{time} | |
| series from which the spectrum was calculated. | | series from which the spectrum was calculated. | |
| \item[\texttt{REAL8 f0}] The lowest frequency $f_0$ being sampled, in | | \item[\texttt{REAL8 f0}] The lowest frequency $f_0$ being sampled, in | |
| hertz. | | hertz. | |
| \item[\texttt{REAL8 deltaF}] The frequency sampling interval $\Delta | | \item[\texttt{REAL8 deltaF}] The frequency sampling interval $\Delta | |
| f$, in hertz. | | f$, in hertz. | |
|
| \item[\texttt{CHARVector *sampleUnits}] The physical units of the | | \item[\texttt{LALUnit sampleUnits}] The physical units of the | |
| quantity being sampled. | | quantity being sampled. | |
| \item[\texttt{<datatype>Sequence *data}] The sequence of sampled data. | | \item[\texttt{<datatype>Sequence *data}] The sequence of sampled data. | |
| \end{description} | | \end{description} | |
| | | | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
| | | | |
| typedef struct | | typedef struct | |
| tagINT2FrequencySeries | | tagINT2FrequencySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 f0; | | REAL8 f0; | |
| REAL8 deltaF; | | REAL8 deltaF; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| INT2Sequence *data; | | INT2Sequence *data; | |
| } | | } | |
| INT2FrequencySeries; | | INT2FrequencySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagUINT2FrequencySeries | | tagUINT2FrequencySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 f0; | | REAL8 f0; | |
| REAL8 deltaF; | | REAL8 deltaF; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| UINT2Sequence *data; | | UINT2Sequence *data; | |
| } | | } | |
| UINT2FrequencySeries; | | UINT2FrequencySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagINT4FrequencySeries | | tagINT4FrequencySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 f0; | | REAL8 f0; | |
| REAL8 deltaF; | | REAL8 deltaF; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| INT4Sequence *data; | | INT4Sequence *data; | |
| } | | } | |
| INT4FrequencySeries; | | INT4FrequencySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagUINT4FrequencySeries | | tagUINT4FrequencySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 f0; | | REAL8 f0; | |
| REAL8 deltaF; | | REAL8 deltaF; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| UINT4Sequence *data; | | UINT4Sequence *data; | |
| } | | } | |
| UINT4FrequencySeries; | | UINT4FrequencySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagINT8FrequencySeries | | tagINT8FrequencySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 f0; | | REAL8 f0; | |
| REAL8 deltaF; | | REAL8 deltaF; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| INT8Sequence *data; | | INT8Sequence *data; | |
| } | | } | |
| INT8FrequencySeries; | | INT8FrequencySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagUINT8FrequencySeries | | tagUINT8FrequencySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 f0; | | REAL8 f0; | |
| REAL8 deltaF; | | REAL8 deltaF; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| UINT8Sequence *data; | | UINT8Sequence *data; | |
| } | | } | |
| UINT8FrequencySeries; | | UINT8FrequencySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagREAL4FrequencySeries | | tagREAL4FrequencySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 f0; | | REAL8 f0; | |
| REAL8 deltaF; | | REAL8 deltaF; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| REAL4Sequence *data; | | REAL4Sequence *data; | |
| } | | } | |
| REAL4FrequencySeries; | | REAL4FrequencySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagREAL8FrequencySeries | | tagREAL8FrequencySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 f0; | | REAL8 f0; | |
| REAL8 deltaF; | | REAL8 deltaF; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| REAL8Sequence *data; | | REAL8Sequence *data; | |
| } | | } | |
| REAL8FrequencySeries; | | REAL8FrequencySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagCOMPLEX8FrequencySeries | | tagCOMPLEX8FrequencySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 f0; | | REAL8 f0; | |
| REAL8 deltaF; | | REAL8 deltaF; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| COMPLEX8Sequence *data; | | COMPLEX8Sequence *data; | |
| } | | } | |
| COMPLEX8FrequencySeries; | | COMPLEX8FrequencySeries; | |
| | | | |
| typedef struct | | typedef struct | |
| tagCOMPLEX16FrequencySeries | | tagCOMPLEX16FrequencySeries | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| LIGOTimeGPS epoch; | | LIGOTimeGPS epoch; | |
| REAL8 f0; | | REAL8 f0; | |
| REAL8 deltaF; | | REAL8 deltaF; | |
|
| CHARVector *sampleUnits; | | LALUnit sampleUnits; | |
| COMPLEX16Sequence *data; | | COMPLEX16Sequence *data; | |
| } | | } | |
| COMPLEX16FrequencySeries; | | COMPLEX16FrequencySeries; | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| | | | |
| \vspace{2ex} | | \vspace{2ex} | |
| \begin{verbatim} | | \begin{verbatim} | |
| <datatype>ZPGFilter | | <datatype>ZPGFilter | |
| \end{verbatim} | | \end{verbatim} | |
| | | | |
| skipping to change at line 1208 | | skipping to change at line 1266 | |
| $H(f)=g\times\prod_k(\zeta-z_k)/\prod_l(\zeta-p_l)$, where $z_k$ are | | $H(f)=g\times\prod_k(\zeta-z_k)/\prod_l(\zeta-p_l)$, where $z_k$ are | |
| the complex \emph{zeros}, $p_l$ are the complex \emph{poles}, and $g$ | | the complex \emph{zeros}, $p_l$ are the complex \emph{poles}, and $g$ | |
| is the complex \emph{gain} of the response function. Some common | | is the complex \emph{gain} of the response function. Some common | |
| complex frequency representations are the $z$-plane representation | | complex frequency representations are the $z$-plane representation | |
| $\zeta(f\Delta t)=\exp(2\pi if\Delta t)$, which maps the Nyquist | | $\zeta(f\Delta t)=\exp(2\pi if\Delta t)$, which maps the Nyquist | |
| interval $f\in[0,1/2\Delta t)$ onto the upper-half unit circle in | | interval $f\in[0,1/2\Delta t)$ onto the upper-half unit circle in | |
| $\zeta$, and the $w$-plane representation $\zeta(f\Delta t)=\tan(\pi | | $\zeta$, and the $w$-plane representation $\zeta(f\Delta t)=\tan(\pi | |
| f\Delta t)$, which maps the Nyquist interval onto the positive real | | f\Delta t)$, which maps the Nyquist interval onto the positive real | |
| axis in $\zeta$. The fields of \verb@<datatype>ZPGFilter@ are: | | axis in $\zeta$. The fields of \verb@<datatype>ZPGFilter@ are: | |
| \begin{description} | | \begin{description} | |
|
| \item[\texttt{CHAR *name}] The name of the filter or transfer | | \item[\texttt{CHAR name[LALNameLength]}] The name of the filter or transfer | |
| function. This should also mention its complex frequency | | function. This should also mention its complex frequency | |
| representation. | | representation. | |
| \item[\texttt{REAL8 deltaT}] The sampling time or reference timescale | | \item[\texttt{REAL8 deltaT}] The sampling time or reference timescale | |
| $\Delta t$ for the filter, in seconds. If zero, it will be treated as | | $\Delta t$ for the filter, in seconds. If zero, it will be treated as | |
| being equal to the sampling interval of the data being filtered. | | being equal to the sampling interval of the data being filtered. | |
| \item[\texttt{<datatype>Vector *zeros}] Pointer to a vector storing | | \item[\texttt{<datatype>Vector *zeros}] Pointer to a vector storing | |
| the zeros $z_k$ of the filter. | | the zeros $z_k$ of the filter. | |
| \item[\texttt{<datatype>Vector *poles}] Pointer to a vector storing | | \item[\texttt{<datatype>Vector *poles}] Pointer to a vector storing | |
| the poles $p_k$ of the filter. | | the poles $p_k$ of the filter. | |
| \item[\texttt{<datatype> gain}] The gain $g$ of the filter. | | \item[\texttt{<datatype> gain}] The gain $g$ of the filter. | |
| \end{description} | | \end{description} | |
| | | | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
| | | | |
| typedef struct | | typedef struct | |
| tagCOMPLEX8ZPGFilter | | tagCOMPLEX8ZPGFilter | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| COMPLEX8Vector *zeros; | | COMPLEX8Vector *zeros; | |
| COMPLEX8Vector *poles; | | COMPLEX8Vector *poles; | |
| COMPLEX8 gain; | | COMPLEX8 gain; | |
| } | | } | |
| COMPLEX8ZPGFilter; | | COMPLEX8ZPGFilter; | |
| | | | |
| typedef struct | | typedef struct | |
| tagCOMPLEX16ZPGFilter | | tagCOMPLEX16ZPGFilter | |
| { | | { | |
|
| CHAR *name; | | CHAR name[LALNameLength]; | |
| REAL8 deltaT; | | REAL8 deltaT; | |
| COMPLEX16Vector *zeros; | | COMPLEX16Vector *zeros; | |
| COMPLEX16Vector *poles; | | COMPLEX16Vector *poles; | |
| COMPLEX16 gain; | | COMPLEX16 gain; | |
| } | | } | |
| COMPLEX16ZPGFilter; | | COMPLEX16ZPGFilter; | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| \newpage | | \newpage | |
| \subsection{The LAL universal status structure \texttt{LALStatus}} | | \subsection{The LAL universal status structure \texttt{LALStatus}} | |
| | | | |
End of changes. 97 change blocks. |
| 101 lines changed or deleted | | 159 lines changed or added | |
|
| LALStatusMacros.h | | LALStatusMacros.h | |
| /****************************** <lalVerbatim file="LALStatusMacrosHV"> | | /****************************** <lalVerbatim file="LALStatusMacrosHV"> | |
| Author: Creighton, J. D. E. and Creighton, T. D. | | Author: Creighton, J. D. E. and Creighton, T. D. | |
|
| $Id: LALStatusMacros.h,v 1.13 2000/09/08 23:19:24 jolien Exp $ | | $Id: LALStatusMacros.h,v 1.22 2001/11/27 01:55:24 jolien Exp $ | |
| ******************************* </lalVerbatim> */ | | ******************************* </lalVerbatim> */ | |
| | | | |
| /* <lalLaTeX> | | /* <lalLaTeX> | |
| | | | |
| \section{Header \texttt{LALStatusMacros.h}} | | \section{Header \texttt{LALStatusMacros.h}} | |
| \label{s:LALStatusMacros.h} | | \label{s:LALStatusMacros.h} | |
| | | | |
| Provides macros for handling the LAL status structure. | | Provides macros for handling the LAL status structure. | |
| | | | |
| \subsection*{Synopsis} | | \subsection*{Synopsis} | |
| \begin{verbatim} | | \begin{verbatim} | |
|
| #include "LALStatusMacros.h" | | #include <lal/LALStatusMacros.h> | |
| \end{verbatim} | | \end{verbatim} | |
| | | | |
| \noindent This header provides macros and functions for tracking and | | \noindent This header provides macros and functions for tracking and | |
| reporting the runtime status of a program. The intent is | | reporting the runtime status of a program. The intent is | |
| simultaneously to standardize the error reporting, and to make the | | simultaneously to standardize the error reporting, and to make the | |
| reporting as transparent as possible to people coding individual | | reporting as transparent as possible to people coding individual | |
| routines. | | routines. | |
| | | | |
| \subsection{Status-reporting objects} | | \subsection{Status-reporting objects} | |
| \label{ss:status-reporting-objects} | | \label{ss:status-reporting-objects} | |
| | | | |
| LAL routines make use of two objects in reporting their current | | LAL routines make use of two objects in reporting their current | |
| status: the status structure \verb@LALStatus@, and the global integer | | status: the status structure \verb@LALStatus@, and the global integer | |
| \verb@lalDebugLevel@. These two objects are described in the following | | \verb@lalDebugLevel@. These two objects are described in the following | |
| sections. | | sections. | |
| | | | |
| \subsubsection{The \texttt{LALStatus} structure} | | \subsubsection{The \texttt{LALStatus} structure} | |
|
| | | \idx[Type]{LALStatus} | |
| | | | |
| LAL routines store their current execution status in a linked list of | | LAL routines store their current execution status in a linked list of | |
| structures of type \verb@LALStatus@, with each node in the list | | structures of type \verb@LALStatus@, with each node in the list | |
| representing a subroutine in the current calling sequence. The | | representing a subroutine in the current calling sequence. The | |
| \verb@LALStatus@ structure is described in Sec.~\ref{ss:status-structure} | | \verb@LALStatus@ structure is described in Sec.~\ref{ss:status-structure} | |
| of the header \verb@LALDatatypes.h@, but for completeness, we explain | | of the header \verb@LALDatatypes.h@, but for completeness, we explain | |
| its fields below: | | its fields below: | |
| \begin{description} | | \begin{description} | |
| \item[\texttt{INT4 statusCode}] A code indicating the exit status of a | | \item[\texttt{INT4 statusCode}] A code indicating the exit status of a | |
| function. 0 represents a normal exit. Negative values are reserved | | function. 0 represents a normal exit. Negative values are reserved | |
| | | | |
| skipping to change at line 109 | | skipping to change at line 110 | |
| \tt -8 & \vspace{-1.4ex}\tt DETATCHSTATUSPTR: null status pointer & | | \tt -8 & \vspace{-1.4ex}\tt DETATCHSTATUSPTR: null status pointer & | |
| The \verb@statusPtr@ field could not be deallocated at the end of all | | The \verb@statusPtr@ field could not be deallocated at the end of all | |
| subroutine calls; one of the subroutines must have lost it or set it | | subroutine calls; one of the subroutines must have lost it or set it | |
| to \verb@NULL@. \\ | | to \verb@NULL@. \\ | |
| | | | |
| \hline | | \hline | |
| \end{tabular} | | \end{tabular} | |
| \end{center} | | \end{center} | |
| | | | |
| \subsubsection{The \texttt{lalDebugLevel}} | | \subsubsection{The \texttt{lalDebugLevel}} | |
|
| | | \idx[Variable]{lalDebugLevel} | |
| | | | |
| The \verb@lalDebugLevel@ is a global variable, set at runtime, that | | The \verb@lalDebugLevel@ is a global variable, set at runtime, that | |
| determines how much and what kind of debugging information will be | | determines how much and what kind of debugging information will be | |
| reported. It is declared as an \verb@extern int@ in the header | | reported. It is declared as an \verb@extern int@ in the header | |
| \verb@LALStatusMacros.h@, and is therefore accessible in any standard | | \verb@LALStatusMacros.h@, and is therefore accessible in any standard | |
| LAL module that includes this header. Note, however, that it is | | LAL module that includes this header. Note, however, that it is | |
| declared to be of the C type \verb@int@, which is usually but not | | declared to be of the C type \verb@int@, which is usually but not | |
| always a 32-bit integer (on some systems it may only be 16 bits). | | always a 32-bit integer (on some systems it may only be 16 bits). | |
| | | | |
| The value of \verb@lalDebugLevel@ should be thought of not as a number, | | The value of \verb@lalDebugLevel@ should be thought of not as a number, | |
| | | | |
| skipping to change at line 159 | | skipping to change at line 161 | |
| is turned on by setting the corrsponding bit in \verb@lalDebugLevel@ to | | is turned on by setting the corrsponding bit in \verb@lalDebugLevel@ to | |
| 1, and is suppressed by setting the bit to 0. This header file | | 1, and is suppressed by setting the bit to 0. This header file | |
| \verb@#define@s flags with numerical values designed to switch on the | | \verb@#define@s flags with numerical values designed to switch on the | |
| appropriate bits. Combinations of bits can be switched on by | | appropriate bits. Combinations of bits can be switched on by | |
| combining these flags using the bitwise-\textit{or} operator, | | combining these flags using the bitwise-\textit{or} operator, | |
| \verb@|@. The flags are defined as follows: | | \verb@|@. The flags are defined as follows: | |
| | | | |
| \begin{center} | | \begin{center} | |
| \begin{tabular}{|lccl|} | | \begin{tabular}{|lccl|} | |
| \hline | | \hline | |
|
| Flag & Binary & Decimal & Meaning \\ | | Flag & Octal & Decimal & Meaning \\ | |
| \hline | | \hline | |
| \multicolumn{4}{|l|}{\it Primitive flags} \\ | | \multicolumn{4}{|l|}{\it Primitive flags} \\ | |
|
| \tt LALNDEBUG & 0\ldots00000 & 0 & No debugging or status messages \\ | | \tt LALNDEBUG & 000000 & 0 & No debugging or status messages \\ | |
| \tt LALERROR & 0\ldots00001 & 1 & Turn on error messages \\ | | \tt LALERROR & 000001 & 1 & Turn on error messages \\ | |
| \tt LALWARNING & 0\ldots00010 & 2 & Turn on warning messages \\ | | \tt LALWARNING & 000002 & 2 & Turn on warning messages \\ | |
| \tt LALINFO & 0\ldots00100 & 4 & Turn on info messages \\ | | \tt LALINFO & 000004 & 4 & Turn on info messages \\ | |
| \tt LALTRACE & 0\ldots01000 & 8 & Turn on tracing messages \\ | | \tt LALTRACE & 000010 & 8 & Turn on tracing messages \\ | |
| \tt LALMEMINFO & 0\ldots10000 & 16 & Turn on memory messages \\ | | \tt LALMEMINFO & 000020 & 16 & Turn on memory messages \\ | |
| \tt LALMEMDBG & 1\ldots00000 & $2^{N-1}$ & Turn on debugging without | | \tt LALNMEMDBG & 000040 & 32 & Turn off all memory debugging \\ | |
| messages \\ | | \tt LALNMEMPAD & 000100 & 64 & Turn off memory padding \\ | |
| | | \tt LALNMEMTRK & 000200 & 128 & Turn off memory tracking \\ | |
| | | \tt LALMEMDBG & 040000 & 16384 & Turn on memory debugging without message | |
| | | s \\ | |
| \multicolumn{4}{|l|}{\it Combination flags} \\ | | \multicolumn{4}{|l|}{\it Combination flags} \\ | |
|
| \tt LALMSGLVL1 & 0\ldots00001 & 1 & Error messages only \\ | | \tt LALMSGLVL1 & 000001 & 1 & Error messages only \\ | |
| \tt LALMSGLVL2 & 0\ldots00011 & 3 & Error and warning messages \\ | | \tt LALMSGLVL2 & 000003 & 3 & Error and warning messages \\ | |
| \tt LALMSGLVL3 & 0\ldots00111 & 7 & Error, warning, and info messages \\ | | \tt LALMSGLVL3 & 000007 & 7 & Error, warning, and info messages \\ | |
| \tt LALMEMTRACE & 0\ldots11000 & 24 & Memory and tracing messages \\ | | \tt LALMEMTRACE & 000030 & 24 & Memory and tracing messages \\ | |
| \tt LALALLDBG & 1\ldots11111 & $2^N-1$ & All messages and debugging \\ | | \tt LALALLDBG & 077437 & 32543 & All messages and debugging \\ | |
| \hline | | \hline | |
| \end{tabular} | | \end{tabular} | |
| \end{center} | | \end{center} | |
|
| | | \idx[Constant]{LALNDEBUG} | |
| | | \idx[Constant]{LALERROR} | |
| | | \idx[Constant]{LALWARNING} | |
| | | \idx[Constant]{LALINFO} | |
| | | \idx[Constant]{LALTRACE} | |
| | | \idx[Constant]{LALMEMINFO} | |
| | | \idx[Constant]{LALMEMNDBG} | |
| | | \idx[Constant]{LALMEMNPAD} | |
| | | \idx[Constant]{LALMEMNTRK} | |
| | | \idx[Constant]{LALMEMDBG} | |
| | | \idx[Constant]{LALMSGLVL1} | |
| | | \idx[Constant]{LALMSGLVL2} | |
| | | \idx[Constant]{LALMSGLVL3} | |
| | | \idx[Constant]{LALMEMTRACE} | |
| | | \idx[Constant]{LALALLDBG} | |
| | | | |
|
| Here $N$ is the number of bits in the statndard C type \verb@int@ on | | The most significant bit | |
| the particular system. The $N^\mathrm{th}$, or most significant, bit | | of \verb@lalDebugLevel@ has a special meaning in that it is not | |
| of \verb@lalDebugLevel@ has a special meaning, in that it is not | | | |
| associated with any type of status message. However, certain pieces | | associated with any type of status message. However, certain pieces | |
| of debugging or error-tracking code --- such as the memory leak | | of debugging or error-tracking code --- such as the memory leak | |
| detection code in \verb@LALMalloc.c@ --- do not write status messages | | detection code in \verb@LALMalloc.c@ --- do not write status messages | |
| and are not associated with a \verb@lalDebugLevel@ bit; instead, these | | and are not associated with a \verb@lalDebugLevel@ bit; instead, these | |
| pieces of code are turned on for \emph{any} nonzero value of | | pieces of code are turned on for \emph{any} nonzero value of | |
|
| \verb@lalDebugLevel@. Switching on only the $N^\mathrm{th}$ bit with | | \verb@lalDebugLevel@, unless the \verb@LALNMEMDBG@ bit is set. | |
| | | Switching on only the most significant bit with | |
| \verb@LALMEMDBG@ activates this code without turning on any other | | \verb@LALMEMDBG@ activates this code without turning on any other | |
| error reporting. | | error reporting. | |
| | | | |
| To turn debugging code on or off at compile time (rather than | | To turn debugging code on or off at compile time (rather than | |
| runtime), see Sec.~\ref{ss:compilation-flags}, below. | | runtime), see Sec.~\ref{ss:compilation-flags}, below. | |
| | | | |
| \subsection{Using the status tools} | | \subsection{Using the status tools} | |
| \label{ss:using-status-tools} | | \label{ss:using-status-tools} | |
| | | | |
| The following summarizes everything the common programmer needs to | | The following summarizes everything the common programmer needs to | |
| | | | |
| skipping to change at line 220 | | skipping to change at line 239 | |
| Since the function has no return code, it must report all errors or | | Since the function has no return code, it must report all errors or | |
| failure through the status structure. A function that is passed a | | failure through the status structure. A function that is passed a | |
| \verb@NULL@ pointer in place of the status pointer should terminate | | \verb@NULL@ pointer in place of the status pointer should terminate | |
| the program with a \verb@SIGABRT@ signal, as this is its only way to | | the program with a \verb@SIGABRT@ signal, as this is its only way to | |
| report the error. However, this is one of the few circumstances under | | report the error. However, this is one of the few circumstances under | |
| which a function sould deliberately raise a signal. In all other | | which a function sould deliberately raise a signal. In all other | |
| cases the error should be trapped, reported in the status structure, | | cases the error should be trapped, reported in the status structure, | |
| and control returned to the calling routine. | | and control returned to the calling routine. | |
| | | | |
| \subsubsection{Assigning an RCS \texttt{\$Id\$} string} | | \subsubsection{Assigning an RCS \texttt{\$Id\$} string} | |
|
| | | \idx{NRCSID()} | |
| | | | |
| Every source file should have a unique character string identifying | | Every source file should have a unique character string identifying | |
| that version of that file. The standard convention, for a file | | that version of that file. The standard convention, for a file | |
| \verb@MyFile.c@, is to declare a string \verb@MYFILEC@ at the top of | | \verb@MyFile.c@, is to declare a string \verb@MYFILEC@ at the top of | |
| the module using the macro \verb@NRCSID()@ (defined in the include | | the module using the macro \verb@NRCSID()@ (defined in the include | |
| file \verb@LALRCSID.h@): | | file \verb@LALRCSID.h@): | |
| | | | |
| \vspace{2ex} | | \vspace{2ex} | |
| \noindent\texttt{NRCSID( MYFILEC, \$Id\$ );} | | \noindent\texttt{NRCSID( MYFILEC, \$Id\$ );} | |
| \vspace{2ex} | | \vspace{2ex} | |
| | | | |
| \noindent where \texttt{\$Id\$} is expanded by RCS to give the full | | \noindent where \texttt{\$Id\$} is expanded by RCS to give the full | |
| name and version number of the source file. | | name and version number of the source file. | |
| | | | |
| \subsubsection{Initializing the status structure} | | \subsubsection{Initializing the status structure} | |
|
| | | \idx{INITSTATUS()} | |
| | | | |
| The first instruction in any function, after variable declarations, | | The first instruction in any function, after variable declarations, | |
| should be the macro \verb@INITSTATUS()@, which takes three arguments: | | should be the macro \verb@INITSTATUS()@, which takes three arguments: | |
| the function's status pointer, the function name (a string literal) | | the function's status pointer, the function name (a string literal) | |
| and the module's RCS \texttt{\$Id\$} string. | | and the module's RCS \texttt{\$Id\$} string. | |
| \begin{verbatim} | | \begin{verbatim} | |
| INITSTATUS( stat, "MyFunction", MYFILEC ); | | INITSTATUS( stat, "MyFunction", MYFILEC ); | |
| \end{verbatim} | | \end{verbatim} | |
| This macro checks that a valid status pointer has been passed to the | | This macro checks that a valid status pointer has been passed to the | |
| function, and if so, initializes the other fields to indicate (by | | function, and if so, initializes the other fields to indicate (by | |
| default) nominal execution. If \verb@stat@ is null, the macro causes | | default) nominal execution. If \verb@stat@ is null, the macro causes | |
| the program to terminate with a \verb@SIGABRT@ signal, as described | | the program to terminate with a \verb@SIGABRT@ signal, as described | |
| above. | | above. | |
| | | | |
| \subsubsection{Normal return from a function} | | \subsubsection{Normal return from a function} | |
|
| | | \idx{RETURN()} | |
| | | | |
| Upon completion, the function should issue the macro \verb@RETURN()@, | | Upon completion, the function should issue the macro \verb@RETURN()@, | |
| which takes one argument: the function's status pointer. | | which takes one argument: the function's status pointer. | |
| \begin{verbatim} | | \begin{verbatim} | |
| RETURN( stat ); | | RETURN( stat ); | |
| \end{verbatim} | | \end{verbatim} | |
| This takes the place of any return statements. If | | This takes the place of any return statements. If | |
| \verb@stat->statusCode@ is non-zero, the macro calls \verb@LALError()@ | | \verb@stat->statusCode@ is non-zero, the macro calls \verb@LALError()@ | |
| (see \verb@LALError.c@) to log \verb@stat->statusDescription@ and | | (see \verb@LALError.c@) to log \verb@stat->statusDescription@ and | |
| other information, depending on implementation and the value of | | other information, depending on implementation and the value of | |
| \verb@lalDebugLevel@. Typically \verb@RETURN()@ is used only for | | \verb@lalDebugLevel@. Typically \verb@RETURN()@ is used only for | |
| successful completion, with other macros \verb@ABORT()@, | | successful completion, with other macros \verb@ABORT()@, | |
| \verb@ASSERT()@, \verb@CHECKSTATUSPTR()@, and \verb@TRY()@ being used | | \verb@ASSERT()@, \verb@CHECKSTATUSPTR()@, and \verb@TRY()@ being used | |
| to report failure. However, it is possible for the programmer to | | to report failure. However, it is possible for the programmer to | |
| assign the fields of \verb@*stat@ by hand, and then issue | | assign the fields of \verb@*stat@ by hand, and then issue | |
| \verb@RETURN()@. | | \verb@RETURN()@. | |
| | | | |
| \subsubsection{Abnormal return from a function} | | \subsubsection{Abnormal return from a function} | |
|
| | | \idx{ABORT()} | |
| | | | |
| The standard method to terminate a function unsuccessfully is with the | | The standard method to terminate a function unsuccessfully is with the | |
| \verb@ABORT()@ macro, which takes three arguments: the status pointer, | | \verb@ABORT()@ macro, which takes three arguments: the status pointer, | |
| the status code, and the status description string. Normally the | | the status code, and the status description string. Normally the | |
| various error codes and descriptions will be constants defined in the | | various error codes and descriptions will be constants defined in the | |
| function's header file \verb@MyHeader.h@: | | function's header file \verb@MyHeader.h@: | |
| \begin{verbatim} | | \begin{verbatim} | |
| ABORT( stat, MYHEADERH_EMYERR, MYHEADERH_MSGEMYERR ); | | ABORT( stat, MYHEADERH_EMYERR, MYHEADERH_MSGEMYERR ); | |
| \end{verbatim} | | \end{verbatim} | |
| where the error code \verb@MYHEADERH_EMYERR@ and the error message | | where the error code \verb@MYHEADERH_EMYERR@ and the error message | |
| \verb@MYHEADERH_MSGEMYERR@ are defined in \verb@MyHeader.h@. This | | \verb@MYHEADERH_MSGEMYERR@ are defined in \verb@MyHeader.h@. This | |
| standard LAL naming convention for error messages prevents namespace | | standard LAL naming convention for error messages prevents namespace | |
| conflicts between different header files. Like \verb@RETURN()@, | | conflicts between different header files. Like \verb@RETURN()@, | |
| \verb@ABORT()@ correctly handles any status logging required by the | | \verb@ABORT()@ correctly handles any status logging required by the | |
| implementation and the \verb@lalDebugLevel@. Note that \verb@ABORT()@ | | implementation and the \verb@lalDebugLevel@. Note that \verb@ABORT()@ | |
| does \emph{not} raise a \verb@SIGABRT@ signal, but instead returns | | does \emph{not} raise a \verb@SIGABRT@ signal, but instead returns | |
| control to the calling routine. | | control to the calling routine. | |
| | | | |
| \subsubsection{Error checking within a function} | | \subsubsection{Error checking within a function} | |
|
| | | \idx{ASSERT()} | |
| | | | |
| Another way to indicate an unsuccessful termination is with the macro | | Another way to indicate an unsuccessful termination is with the macro | |
| \verb@ASSERT()@, which takes as arguments a test statement, a status | | \verb@ASSERT()@, which takes as arguments a test statement, a status | |
| pointer, a status code, and a status description. The statement | | pointer, a status code, and a status description. The statement | |
| \verb@ASSERT( assertion, ... );@ is in all ways equivalent to the | | \verb@ASSERT( assertion, ... );@ is in all ways equivalent to the | |
| statement \verb@if ( !assertion ) ABORT( ... );@, except on a failure | | statement \verb@if ( !assertion ) ABORT( ... );@, except on a failure | |
| the \verb@ASSERT()@ macro will also report the failed assertion. In | | the \verb@ASSERT()@ macro will also report the failed assertion. In | |
| the above example, one might have: | | the above example, one might have: | |
| \begin{verbatim} | | \begin{verbatim} | |
| ASSERT( assertion, stat, MYHEADERH_EMYERR, MYHEADERH_MSGEMYERR ); | | ASSERT( assertion, stat, MYHEADERH_EMYERR, MYHEADERH_MSGEMYERR ); | |
| | | | |
| skipping to change at line 317 | | skipping to change at line 341 | |
| Programmers should also be aware that using \verb@ASSERT()@ to exit a | | Programmers should also be aware that using \verb@ASSERT()@ to exit a | |
| function in normal runtime can have serious side effects. For | | function in normal runtime can have serious side effects. For | |
| example, it is an error to allocate dynamic memory to local variables | | example, it is an error to allocate dynamic memory to local variables | |
| in a function and then fail to free it before returning. Thus, if you | | in a function and then fail to free it before returning. Thus, if you | |
| have dynamically allocated memory, you cannot then use \verb@ASSERT()@ | | have dynamically allocated memory, you cannot then use \verb@ASSERT()@ | |
| for runtime error checking, as this does not permit you to free the | | for runtime error checking, as this does not permit you to free the | |
| memory before returning. Instead, you must explicitly check the | | memory before returning. Instead, you must explicitly check the | |
| assertion, and, if it fails, free the memory and call \verb@ABORT()@. | | assertion, and, if it fails, free the memory and call \verb@ABORT()@. | |
| | | | |
| \subsubsection{Calling subroutines} | | \subsubsection{Calling subroutines} | |
|
| | | \idx{ATTATCHSTATUSPTR()} | |
| | | \idx{DETATCHSTATUSPTR()} | |
| | | \idx{CHECKSTATUSPTR()} | |
| | | \idx[Macro]{TRY()} | |
| | | | |
| If the function is to call other LAL functions as subroutines, four | | If the function is to call other LAL functions as subroutines, four | |
| more macros are used to report possible errors arising in these | | more macros are used to report possible errors arising in these | |
| routines. The macros are \verb@ATTATCHSTATUSPTR()@, | | routines. The macros are \verb@ATTATCHSTATUSPTR()@, | |
| \verb@DETATCHSTATUSPTR()@, \verb@CHECKSTATUSPTR()@, and \verb@TRY()@. | | \verb@DETATCHSTATUSPTR()@, \verb@CHECKSTATUSPTR()@, and \verb@TRY()@. | |
| The usage of these macros is as follows. | | The usage of these macros is as follows. | |
| | | | |
| \begin{enumerate} | | \begin{enumerate} | |
| | | | |
| \item First, before any subroutines are called, the function must call | | \item First, before any subroutines are called, the function must call | |
| | | | |
| skipping to change at line 408 | | skipping to change at line 436 | |
| \verb@RETURN()@. This macro also sets the status code and the status | | \verb@RETURN()@. This macro also sets the status code and the status | |
| message to nominal values. | | message to nominal values. | |
| | | | |
| Additionally, if a function successfully works around an error | | Additionally, if a function successfully works around an error | |
| reported by a subroutine, it should call \verb@DETATCHSTATUSPTR()@ and | | reported by a subroutine, it should call \verb@DETATCHSTATUSPTR()@ and | |
| \verb@ATTATCHSTATUSPTR()@ to create a fresh status pointer before | | \verb@ATTATCHSTATUSPTR()@ to create a fresh status pointer before | |
| calling another subroutine. | | calling another subroutine. | |
| | | | |
| \end{enumerate} | | \end{enumerate} | |
| | | | |
|
| | | \subsubsection{Cleaning up after subroutine failure} | |
| | | \idx[Macro]{BEGINFAIL()} | |
| | | \idx[Macro]{ENDFAIL()} | |
| | | | |
| | | Although they are convenient, the \verb@TRY()@ and | |
| | | \verb@CHECKSTATUSPTR()@ macros have a serious drawback in that they | |
| | | may cause the calling function to return immediately. If the calling | |
| | | function had previously allocated any local memory storage, this | |
| | | memory will be cast adrift, with no means of accessing or subsequently | |
| | | freeing it (short of terminating the runtime process). Such a memory | |
| | | leak is a violation of the LAL function standard. | |
| | | | |
| | | The macros \verb@BEGINFAIL()@ and \verb@ENDFAIL()@ allow a function to | |
| | | test the return code of a subroutine, and, if that indicates a | |
| | | failure, to execute one or more ``cleanup'' instructions before itself | |
| | | returning. Each macro takes a single argument: the current function's | |
| | | status pointer. The macros must occur in matched pairs, and use the | |
| | | same syntax as a \verb@do ... while@ statement: they either span a | |
| | | single instruction, or a block of instructions enclosed in braces. | |
| | | | |
| | | For example, if a function had allocated memory to some pointer | |
| | | \verb@localPointer@, any subsequent call to a subroutine | |
| | | \verb@LALSubroutine()@ would take the following form: | |
| | | \begin{verbatim} | |
| | | LALSubroutine( stat->statusPtr, ... ); | |
| | | BEGINFAIL( stat ) | |
| | | LALFree( localPointer ); | |
| | | ENDFAIL( stat ); | |
| | | \end{verbatim} | |
| | | For another example, if a function had to create three vectors | |
| | | \verb@*vector1@, \verb@*vector2@, \verb@*vector3@, the allocation | |
| | | would look something like this: | |
| | | \begin{verbatim} | |
| | | TRY( LALSCreateVector( stat->statusPtr, &vector1, 100 ), stat ); | |
| | | | |
| | | LALSCreateVector( stat->statusPtr, &vector2, 100 ); | |
| | | BEGINFAIL( stat ) | |
| | | TRY( LALSDestroyVector( stat->statusPtr, &vector1 ), stat ); | |
| | | ENDFAIL( stat ); | |
| | | | |
| | | LALSCreateVector( stat->statusPtr, &vector3, 100 ); | |
| | | BEGINFAIL( stat ) { | |
| | | TRY( LALSDestroyVector( stat->statusPtr, &vector1 ), stat ); | |
| | | TRY( LALSDestroyVector( stat->statusPtr, &vector2 ), stat ); | |
| | | } ENDFAIL( stat ); | |
| | | \end{verbatim} | |
| | | As indicated above, the cleanup instructions can include calls to | |
| | | other LAL routines. The \verb@BEGINFAIL( stat )@ macro call first | |
| | | checks \verb@stat->statusPtr@ to see if a subroutine error has | |
| | | occured. If it has, the macro detaches and saves that pointer, then | |
| | | attaches a new \verb@stat->statusPtr@ to be used in calls to the | |
| | | cleanup routines. After the cleanup instructions have been executed, | |
| | | the \verb@ENDFAIL( stat )@ macro call reattaches the saved status | |
| | | pointer and returns with a subroutine error code. In this way, the | |
| | | returned status list indicates where the original failure occurred, | |
| | | rather than giving an uninformative report from the last cleanup | |
| | | routine. | |
| | | | |
| | | Of course a \emph{second} failure in one of the cleanup routines can | |
| | | cause serious problems. If the routine was called using a | |
| | | \verb@TRY()@ macro, it will force an immediate return from the calling | |
| | | function, with a status code and status list indicating how the cleanp | |
| | | routine failed. The original status list saved by \verb@BEGINFAIL()@ | |
| | | is lost. While this loss does constitute a memory leak, the failure | |
| | | of a cleanup routine in itself indicates that there are serious | |
| | | problems with the memory management. | |
| | | | |
| | | It is possible to nest \verb@BEGINFAIL()@\ldots\verb@ENDFAIL();@ | |
| | | blocks, but this is unlikely to serve any useful purpose. Once | |
| | | cleanup routines start to fail, it is probably beyond the scope of the | |
| | | LAL function to deal with the resulting memory leaks. | |
| | | | |
| \subsubsection{Issuing status messages} | | \subsubsection{Issuing status messages} | |
|
| | | \idx{LALError()} | |
| | | \idx{LALWarning()} | |
| | | \idx{LALInfo()} | |
| | | \idx{LALTrace()} | |
| | | \idx{REPORTSTATUS()} | |
| | | | |
| The module \verb@LALError.c@ defines the functions \verb@LALError()@, | | The module \verb@LALError.c@ defines the functions \verb@LALError()@, | |
| \verb@LALWarning()@, \verb@LALInfo()@, and \verb@LALTrace()@ to issue | | \verb@LALWarning()@, \verb@LALInfo()@, and \verb@LALTrace()@ to issue | |
| various types of status message. This is the preferred means of | | various types of status message. This is the preferred means of | |
| printing status messages, since each type of message can be activated | | printing status messages, since each type of message can be activated | |
| or suppressed by setting \verb@lalDebugLevel@ appropriately. In fact, | | or suppressed by setting \verb@lalDebugLevel@ appropriately. In fact, | |
| \verb@LALError()@ and \verb@LALTrace()@ are called automatically by | | \verb@LALError()@ and \verb@LALTrace()@ are called automatically by | |
| the status macros whenever they are required, so most LAL modules will | | the status macros whenever they are required, so most LAL modules will | |
| explicitly invoke only the \verb@LALWarning()@ and \verb@LALInfo()@ | | explicitly invoke only the \verb@LALWarning()@ and \verb@LALInfo()@ | |
| functions. | | functions. | |
| | | | |
| skipping to change at line 436 | | skipping to change at line 541 | |
| This macro iteratively prints the contents of \verb@stat@ and all | | This macro iteratively prints the contents of \verb@stat@ and all | |
| subsequent structures in the list to the error log. | | subsequent structures in the list to the error log. | |
| | | | |
| The action of \verb@REPORTSTATUS()@ is not suppressed by any value of | | The action of \verb@REPORTSTATUS()@ is not suppressed by any value of | |
| \verb@lalDebugLevel@. Therefore, as a rule, it should only be called by | | \verb@lalDebugLevel@. Therefore, as a rule, it should only be called by | |
| test programs, not by LAL routines intended for use in production | | test programs, not by LAL routines intended for use in production | |
| code. | | code. | |
| | | | |
| \subsubsection{Setting the initial \texttt{LALStatus} structure and | | \subsubsection{Setting the initial \texttt{LALStatus} structure and | |
| global \texttt{lalDebugLevel}} | | global \texttt{lalDebugLevel}} | |
|
| | | \idx[Type]{LALStatus} | |
| | | \idx[Variable]{lalDebugLevel} | |
| | | | |
| As mentioned above, any module including \verb@LALStatusMacros.h@ | | As mentioned above, any module including \verb@LALStatusMacros.h@ | |
| includes the global variable \verb@lalDebugLevel@ as an | | includes the global variable \verb@lalDebugLevel@ as an | |
| \verb@extern int@. At least one module in the final executable | | \verb@extern int@. At least one module in the final executable | |
| program must have a global \emph{declaration} of \verb@int lalDebugLevel@ | | program must have a global \emph{declaration} of \verb@int lalDebugLevel@ | |
| (not \verb@extern int@), and assign \verb@lalDebugLevel@ a value. In | | (not \verb@extern int@), and assign \verb@lalDebugLevel@ a value. In | |
| most cases \verb@lalDebugLevel@ will be declared in the module containing | | most cases \verb@lalDebugLevel@ will be declared in the module containing | |
| the \verb@main()@ function, and will be assigned a value on | | the \verb@main()@ function, and will be assigned a value on | |
| declaration or from command-line arguments to \verb@main()@. | | declaration or from command-line arguments to \verb@main()@. | |
| Alternatively, if the LAL functions are to be embedded in a non-LAL | | Alternatively, if the LAL functions are to be embedded in a non-LAL | |
| | | | |
| skipping to change at line 499 | | skipping to change at line 606 | |
| | | | |
| LAL provides two flags that can be used to exclude or modify debugging | | LAL provides two flags that can be used to exclude or modify debugging | |
| code at compile time. Although these flags are typically | | code at compile time. Although these flags are typically | |
| \verb@#define@d or \verb@#undef@ined globally and can affect many | | \verb@#define@d or \verb@#undef@ined globally and can affect many | |
| modules (notably modules in the \verb@support@ package), their primary | | modules (notably modules in the \verb@support@ package), their primary | |
| effect is on the debugging and status-reporting tools defined in this | | effect is on the debugging and status-reporting tools defined in this | |
| header. The two flags are named \verb@NDEBUG@ and \verb@NOLALMACROS@. | | header. The two flags are named \verb@NDEBUG@ and \verb@NOLALMACROS@. | |
| | | | |
| \subsubsection{The \texttt{NDEBUG} flag} | | \subsubsection{The \texttt{NDEBUG} flag} | |
| | | | |
|
| Setting the \verb@NDEBUG@ flag turns off debugging and error-reporting | | Setting the \verb@NDEBUG@ (or \verb@LAL_NDEBUG@) flag turns off debugging a | |
| code, in order to get condensed production-line programs. As far as | | nd | |
| error reporting is concerned, setting the \verb@NDEBUG@ flag at | | error-reporting code, in order to get condensed production-line programs. | |
| compile time is similar to setting \verb@lalDebugLevel@ equal to zero at | | As | |
| runtime, in that it suppresses all status messages and memory leak | | far as error reporting is concerned, setting the \verb@NDEBUG@ flag at comp | |
| detection. However, the \verb@NDEBUG@ flag accoplishes this by | | ile | |
| telling the compiler preprocessor to remove the relevant code from the | | time is similar to setting \verb@lalDebugLevel@ equal to zero at runtime, i | |
| object file, thus eliminating frequent and unnecessary tests on | | n | |
| \verb@lalDebugLevel@. | | that it suppresses all status messages and memory leak detection. However, | |
| | | the \verb@NDEBUG@ flag accoplishes this by telling the compiler preprocesso | |
| | | r | |
| | | to remove the relevant code from the object file, thus eliminating frequent | |
| | | and unnecessary tests on \verb@lalDebugLevel@. When debugging is turned of | |
| | | f, | |
| | | the global integer variable \verb@lalNoDebug@ is non-zero; otherwise it is | |
| | | zero. | |
| | | | |
| Compiling with the \verb@NDEBUG@ flag set also removes all | | Compiling with the \verb@NDEBUG@ flag set also removes all | |
| \verb@ASSERT()@ macros from the object code, in keeping with the | | \verb@ASSERT()@ macros from the object code, in keeping with the | |
| philosophy that \verb@ASSERT()@ statements should only be used to | | philosophy that \verb@ASSERT()@ statements should only be used to | |
| catch coding bugs, not runtime errors. | | catch coding bugs, not runtime errors. | |
| | | | |
| \subsubsection{The \texttt{NOLALMACROS} flag} | | \subsubsection{The \texttt{NOLALMACROS} flag} | |
| | | | |
| Setting the \verb@NOLALMACROS@ flag replaces the status-handling | | Setting the \verb@NOLALMACROS@ flag replaces the status-handling | |
| macros described above with actual functions that accomplish the same | | macros described above with actual functions that accomplish the same | |
| | | | |
| skipping to change at line 635 | | skipping to change at line 743 | |
| | | | |
| \newpage\subsection{Sample program: \texttt{LALPrimerTest.c}} | | \newpage\subsection{Sample program: \texttt{LALPrimerTest.c}} | |
| \vspace{3ex} | | \vspace{3ex} | |
| \input{LALPrimerTestC} | | \input{LALPrimerTestC} | |
| | | | |
| </lalLaTeX> */ | | </lalLaTeX> */ | |
| | | | |
| #ifndef _LALSTATUSMACROS_H | | #ifndef _LALSTATUSMACROS_H | |
| #define _LALSTATUSMACROS_H | | #define _LALSTATUSMACROS_H | |
| | | | |
|
| #include "LALConfig.h" | | #include <lal/LALConfig.h> | |
| | | #ifdef NDEBUG | |
| | | #ifndef LAL_NDEBUG | |
| | | #define LAL_NDEBUG | |
| | | #endif | |
| | | #endif | |
| | | | |
|
| #ifdef STDC_HEADERS | | #include <stdlib.h> | |
| #include <string.h> | | #include <string.h> | |
|
| #else | | | |
| #error "ERROR: non ansi standard headers" | | | |
| #endif | | | |
| | | | |
|
| #include "LALMalloc.h" | | #include <lal/LALMalloc.h> | |
| #include "LALDatatypes.h" | | #include <lal/LALDatatypes.h> | |
| #include "LALError.h" | | #include <lal/LALError.h> | |
| #include "LALRCSID.h" | | #include <lal/LALRCSID.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
|
| NRCSID (LALSTATUSMACROSH, "$Id: LALStatusMacros.h,v 1.13 2000/09/08 23:19:2
4 jolien Exp $"); | | NRCSID (LALSTATUSMACROSH, "$Id: LALStatusMacros.h,v 1.22 2001/11/27 01:55:2
4 jolien Exp $"); | |
| | | | |
| extern int lalDebugLevel; | | extern int lalDebugLevel; | |
|
| | | extern const int lalNoDebug; | |
| | | | |
| #ifndef NOLALMACROS | | #ifndef NOLALMACROS | |
| | | | |
| #define INITSTATUS( statusptr, funcname, id )
\ | | #define INITSTATUS( statusptr, funcname, id )
\ | |
| if ( (statusptr) )
\ | | if ( (statusptr) )
\ | |
| {
\ | | {
\ | |
| INT4 level = (statusptr)->level ;
\ | | INT4 level = (statusptr)->level ;
\ | |
| INT4 statp = (statusptr)->statusPtr ? 1 : 0 ;
\ | | INT4 statp = (statusptr)->statusPtr ? 1 : 0 ;
\ | |
|
| memset( (statusptr), 0, sizeof( LALStatus ) ); /* possible memory leak
*/ \ | | memset( (statusptr), 0, sizeof( LALStatus ) ); /* possible memory leak
*/ \ | |
| (statusptr)->level = level > 0 ? level : 1 ;
\ | | (statusptr)->level = level > 0 ? level : 1 ;
\ | |
| (statusptr)->Id = (id);
\ | | (statusptr)->Id = (id);
\ | |
| (statusptr)->function = (funcname);
\ | | (statusptr)->function = (funcname);
\ | |
| SETSTATUSFILELINE( statusptr );
\ | | SETSTATUSFILELINE( statusptr );
\ | |
| (void) LALTrace( statusptr, 0 );
\ | | (void) LALTrace( statusptr, 0 );
\ | |
| if ( statp )
\ | | if ( statp )
\ | |
| {
\ | | {
\ | |
| ABORT( statusptr, -2, "INITSTATUS: non-null status pointer" );
\ | | ABORT( statusptr, -2, "INITSTATUS: non-null status pointer" );
\ | |
| }
\ | | }
\ | |
| }
\ | | }
\ | |
| else
\ | | else
\ | |
|
| LALAbort( "Abort: function %s, file %s, line %d, %s\n" | | lalAbortHook( "Abort: function %s, file %s, line %d, %s\n" | |
| \ | | \ | |
| " Null status pointer passed to function\n", | | " Null status pointer passed to function\n", | |
| \ | | \ | |
| (funcname), __FILE__, __LINE__, (id) ) | | (funcname), __FILE__, __LINE__, (id) ) | |
| | | | |
| #define RETURN( statusptr )
\ | | #define RETURN( statusptr )
\ | |
| if ( 1 )
\ | | if ( 1 )
\ | |
| {
\ | | {
\ | |
| SETSTATUSFILELINE( statusptr );
\ | | SETSTATUSFILELINE( statusptr );
\ | |
| if ( (statusptr)->statusCode )
\ | | if ( (statusptr)->statusCode )
\ | |
| (void) LALError( statusptr, "RETURN:" );
\ | | (void) LALError( statusptr, "RETURN:" );
\ | |
| (void) LALTrace( statusptr, 1 );
\ | | (void) LALTrace( statusptr, 1 );
\ | |
| return;
\ | | return;
\ | |
| }
\ | | }
\ | |
|
| else | | else (void)(0) | |
| | | | |
| #define ATTATCHSTATUSPTR(statusptr)
\ | | #define ATTATCHSTATUSPTR(statusptr)
\ | |
| if ( !(statusptr)->statusPtr )
\ | | if ( !(statusptr)->statusPtr )
\ | |
| {
\ | | {
\ | |
|
| (statusptr)->statusPtr = (LALStatus *) LALCalloc( 1, sizeof( LALStatus
) ); \ | | (statusptr)->statusPtr = (LALStatus *)LALCalloc( 1, sizeof( LALStatus )
);\ | |
| if ( !(statusptr)->statusPtr )
\ | | if ( !(statusptr)->statusPtr )
\ | |
| {
\ | | {
\ | |
| ABORT( statusptr, -4, "ATTATCHSTATUSPTR: memory allocation error" );
\ | | ABORT( statusptr, -4, "ATTATCHSTATUSPTR: memory allocation error" );
\ | |
| }
\ | | }
\ | |
| (statusptr)->statusPtr->level = (statusptr)->level + 1;
\ | | (statusptr)->statusPtr->level = (statusptr)->level + 1;
\ | |
| }
\ | | }
\ | |
| else
\ | | else
\ | |
| ABORT( statusptr, -2, "ATTATCHSTATUSPTR: non-null status pointer" ) | | ABORT( statusptr, -2, "ATTATCHSTATUSPTR: non-null status pointer" ) | |
| | | | |
| #define DETATCHSTATUSPTR( statusptr )
\ | | #define DETATCHSTATUSPTR( statusptr )
\ | |
| | | | |
| skipping to change at line 723 | | skipping to change at line 834 | |
| #define ABORT( statusptr, code, mesg )
\ | | #define ABORT( statusptr, code, mesg )
\ | |
| if ( 1 )
\ | | if ( 1 )
\ | |
| {
\ | | {
\ | |
| if ( statusptr->statusPtr ) FREESTATUSPTR( statusptr );
\ | | if ( statusptr->statusPtr ) FREESTATUSPTR( statusptr );
\ | |
| SETSTATUS( statusptr, code, mesg );
\ | | SETSTATUS( statusptr, code, mesg );
\ | |
| if ( code )
\ | | if ( code )
\ | |
| (void) LALError( statusptr, "ABORT:" );
\ | | (void) LALError( statusptr, "ABORT:" );
\ | |
| (void) LALTrace( statusptr, 1 );
\ | | (void) LALTrace( statusptr, 1 );
\ | |
| return;
\ | | return;
\ | |
| }
\ | | }
\ | |
|
| else | | else (void)(0) | |
| | | | |
|
| #ifdef NDEBUG | | #ifdef LAL_NDEBUG | |
| #define ASSERT( assertion, statusptr, code, mesg ) | | #define ASSERT( assertion, statusptr, code, mesg ) | |
| #else | | #else | |
| #define ASSERT( assertion, statusptr, code, mesg )
\ | | #define ASSERT( assertion, statusptr, code, mesg )
\ | |
| if ( !(assertion) )
\ | | if ( !(assertion) )
\ | |
| {
\ | | {
\ | |
| if ( statusptr->statusPtr )
\ | | if ( statusptr->statusPtr )
\ | |
| FREESTATUSPTR( statusptr );
\ | | FREESTATUSPTR( statusptr );
\ | |
| SETSTATUS( statusptr, code, mesg );
\ | | SETSTATUS( statusptr, code, mesg );
\ | |
| (void) LALError( statusptr, "Assertion \"" #assertion "\" failed:" );
\ | | (void) LALError( statusptr, "Assertion \"" #assertion "\" failed:" );
\ | |
| (void) LALTrace( statusptr, 1 );
\ | | (void) LALTrace( statusptr, 1 );
\ | |
| return;
\ | | return;
\ | |
| }
\ | | }
\ | |
|
| else | | else (void)(0) | |
| #endif | | #endif | |
| | | | |
| #define TRY( func, statusptr )
\ | | #define TRY( func, statusptr )
\ | |
| if ( (func), (statusptr)->statusPtr->statusCode )
\ | | if ( (func), (statusptr)->statusPtr->statusCode )
\ | |
| {
\ | | {
\ | |
| SETSTATUS( statusptr, -1, "Recursive error" );
\ | | SETSTATUS( statusptr, -1, "Recursive error" );
\ | |
| (void) LALError( statusptr, "Function call \"" #func "\" failed:" );
\ | | (void) LALError( statusptr, "Function call \"" #func "\" failed:" );
\ | |
| (void) LALTrace( statusptr, 1 );
\ | | (void) LALTrace( statusptr, 1 );
\ | |
| return;
\ | | return;
\ | |
| }
\ | | }
\ | |
|
| else | | else (void)(0) | |
| | | | |
| #define CHECKSTATUSPTR( statusptr )
\ | | #define CHECKSTATUSPTR( statusptr )
\ | |
| if ( (statusptr)->statusPtr->statusCode )
\ | | if ( (statusptr)->statusPtr->statusCode )
\ | |
| {
\ | | {
\ | |
| SETSTATUS( statusptr, -1, "Recursive error" );
\ | | SETSTATUS( statusptr, -1, "Recursive error" );
\ | |
| (void) LALError( statusptr, "CHECKSTATUSPTR:" );
\ | | (void) LALError( statusptr, "CHECKSTATUSPTR:" );
\ | |
| (void) LALTrace( statusptr, 1 );
\ | | (void) LALTrace( statusptr, 1 );
\ | |
| return;
\ | | return;
\ | |
| }
\ | | }
\ | |
|
| else | | else (void)(0) | |
| | | | |
| #define FREESTATUSPTR( statusptr )
\ | | #define FREESTATUSPTR( statusptr )
\ | |
| do
\ | | do
\ | |
| {
\ | | {
\ | |
|
| LALStatus *next = (statusptr)->statusPtr->statusPtr;
\ | | LALStatus *next = (statusptr)->statusPtr->statusPtr;
\ | |
| LALFree( (statusptr)->statusPtr );
\ | | LALFree( (statusptr)->statusPtr );
\ | |
| (statusptr)->statusPtr = next;
\ | | (statusptr)->statusPtr = next;
\ | |
| }
\ | | }
\ | |
| while ( (statusptr)->statusPtr ) | | while ( (statusptr)->statusPtr ) | |
| | | | |
|
| #define SETSTATUSFILELINE( statusptr ) \ | | | |
| ( ( void ) ( (statusptr)->file = __FILE__, (statusptr)->line = __LINE__ ) | | | |
| ) | | | |
| | | | |
| #define SETSTATUS( statusptr, code, mesg ) | | | |
| \ | | | |
| ( SETSTATUSFILELINE( statusptr ), | | | |
| \ | | | |
| (statusptr)->statusDescription = (mesg), | | | |
| \ | | | |
| (statusptr)->statusCode = (code) ) | | | |
| | | | |
| #define REPORTSTATUS( statusptr )
\ | | #define REPORTSTATUS( statusptr )
\ | |
| do
\ | | do
\ | |
| {
\ | | {
\ | |
|
| LALStatus *ptr;
\ | | LALStatus *ptr;
\ | |
| for ( ptr = (statusptr); ptr; ptr = ptr->statusPtr )
\ | | for ( ptr = (statusptr); ptr; ptr = ptr->statusPtr )
\ | |
| {
\ | | {
\ | |
| LALPrintError( "\nLevel %i: %s\n", ptr->level, ptr->Id );
\ | | LALPrintError( "\nLevel %i: %s\n", ptr->level, ptr->Id );
\ | |
| if ( ptr->statusCode )
\ | | if ( ptr->statusCode )
\ | |
| {
\ | | {
\ | |
| LALPrintError( "\tStatus code %i: %s\n", ptr->statusCode,
\ | | LALPrintError( "\tStatus code %i: %s\n", ptr->statusCode,
\ | |
| ptr->statusDescription );
\ | | ptr->statusDescription );
\ | |
| }
\ | | }
\ | |
| else
\ | | else
\ | |
| {
\ | | {
\ | |
| | | | |
| skipping to change at line 816 | | skipping to change at line 919 | |
| | | | |
| #define ATTATCHSTATUSPTR( statusptr ) \ | | #define ATTATCHSTATUSPTR( statusptr ) \ | |
| if ( LALAttatchStatusPtr( statusptr, __FILE__, __LINE__ ) ) return | | if ( LALAttatchStatusPtr( statusptr, __FILE__, __LINE__ ) ) return | |
| | | | |
| #define DETATCHSTATUSPTR( statusptr ) \ | | #define DETATCHSTATUSPTR( statusptr ) \ | |
| if ( LALDetatchStatusPtr( statusptr, __FILE__, __LINE__ ) ) return | | if ( LALDetatchStatusPtr( statusptr, __FILE__, __LINE__ ) ) return | |
| | | | |
| #define ABORT( statusptr, code, mesg ) \ | | #define ABORT( statusptr, code, mesg ) \ | |
| if ( LALPrepareAbort( statusptr, code, mesg, __FILE__, __LINE__ ), 1 ) re
turn | | if ( LALPrepareAbort( statusptr, code, mesg, __FILE__, __LINE__ ), 1 ) re
turn | |
| | | | |
|
| #ifdef NDEBUG | | #ifdef LAL_NDEBUG | |
| #define ASSERT( assertion, statusptr, code, mesg ) | | #define ASSERT( assertion, statusptr, code, mesg ) | |
| #else | | #else | |
| #define ASSERT( assertion, statusptr, code, mesg )
\ | | #define ASSERT( assertion, statusptr, code, mesg )
\ | |
| if ( !(assertion) )
\ | | if ( !(assertion) )
\ | |
| {
\ | | {
\ | |
| LALPrepareAssertFail( statusptr, code, mesg,
\ | | LALPrepareAssertFail( statusptr, code, mesg,
\ | |
| "Assertion \"" #assertion "\" failed:",
\ | | "Assertion \"" #assertion "\" failed:",
\ | |
| __FILE__, __LINE__ );
\ | | __FILE__, __LINE__ );
\ | |
| return;
\ | | return;
\ | |
| }
\ | | }
\ | |
|
| else | | else (void)(0) | |
| #endif | | #endif | |
| | | | |
| #define TRY( func, statusptr )
\ | | #define TRY( func, statusptr )
\ | |
| do
\ | | do
\ | |
| {
\ | | {
\ | |
| (func);
\ | | (func);
\ | |
| if ( LALCheckStatusPtr( statusptr, "Function call \"" #func "\" failed:
", \ | | if ( LALCheckStatusPtr( statusptr, "Function call \"" #func "\" failed:
", \ | |
| __FILE__, __LINE__ ) )
\ | | __FILE__, __LINE__ ) )
\ | |
| return;
\ | | return;
\ | |
| }
\ | | }
\ | |
| while ( 0 ) | | while ( 0 ) | |
| | | | |
| #define CHECKSTATUSPTR( statusptr )
\ | | #define CHECKSTATUSPTR( statusptr )
\ | |
| if ( LALCheckStatusPtr( statusptr, "CHECKSTATUSPTR:", __FILE__, __LINE__
) )\ | | if ( LALCheckStatusPtr( statusptr, "CHECKSTATUSPTR:", __FILE__, __LINE__
) )\ | |
| return | | return | |
| | | | |
| #endif /* NOLALMACROS */ | | #endif /* NOLALMACROS */ | |
| | | | |
|
| | | /* these just have to be macros... */ | |
| | | | |
| | | #define BEGINFAIL( statusptr ) | |
| | | \ | |
| | | do { | |
| | | \ | |
| | | if ( !(statusptr) ) { | |
| | | \ | |
| | | ABORT( statusptr, -8, "BEGINFAIL: null status pointer" ); | |
| | | \ | |
| | | } | |
| | | \ | |
| | | if ( !( (statusptr)->statusPtr ) ) { | |
| | | \ | |
| | | ABORT( statusptr, -8, "BEGINFAIL: null status pointer pointer" ); | |
| | | \ | |
| | | } | |
| | | \ | |
| | | if ( (statusptr)->statusPtr->statusCode ) { | |
| | | \ | |
| | | LALStatus *statusPtrSave = (statusptr)->statusPtr; | |
| | | \ | |
| | | (statusptr)->statusPtr = NULL; | |
| | | \ | |
| | | ATTATCHSTATUSPTR( statusptr ); | |
| | | \ | |
| | | do | |
| | | | |
| | | #define ENDFAIL( statusptr ) | |
| | | \ | |
| | | while ( 0 ); | |
| | | \ | |
| | | DETATCHSTATUSPTR( statusptr ); | |
| | | \ | |
| | | (statusptr)->statusPtr = statusPtrSave; | |
| | | \ | |
| | | SETSTATUS( statusptr, -1, "Recursive error" ); | |
| | | \ | |
| | | (void) LALError( statusptr, "ENDFAIL:" ); | |
| | | \ | |
| | | (void) LALTrace( statusptr, 1 ); | |
| | | \ | |
| | | return; | |
| | | \ | |
| | | } | |
| | | \ | |
| | | } while ( 0 ) | |
| | | | |
| | | #define SETSTATUSFILELINE( statusptr ) \ | |
| | | ( ( void ) ( (statusptr)->file = __FILE__, (statusptr)->line = __LINE__ ) | |
| | | ) | |
| | | | |
| | | #define SETSTATUS( statusptr, code, mesg ) | |
| | | \ | |
| | | ( SETSTATUSFILELINE( statusptr ), | |
| | | \ | |
| | | (statusptr)->statusDescription = (mesg), | |
| | | \ | |
| | | (statusptr)->statusCode = (code) ) | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif /* _LALSTATUSMACROS_H */ | | #endif /* _LALSTATUSMACROS_H */ | |
| | | | |
End of changes. 41 change blocks. |
| 68 lines changed or deleted | | 234 lines changed or added | |
|
| Window.h | | Window.h | |
|
| /*----------------------------------------------------------------------- | | /*************************************************** <lalVerbatim file="Win | |
| * | | dowHV"> | |
| * File Name: Window.h | | Author:Bruce Allen | |
| * | | $Id: Window.h,v 1.10 2001/12/04 22:51:25 jolien Exp $ | |
| * Author: Allen, Bruce ballen@dirac.phys.uwm.edu | | **************************************************** </lalVerbatim> */ | |
| * | | /*************************************************** <lalLaTeX> | |
| * Revision: $Id: Window.h,v 1.4 2000/07/23 01:16:19 jolien Exp $ | | | |
| * | | \section{Header \texttt{Window.h}} | |
| *----------------------------------------------------------------------- | | \label{s:Window.h} | |
| * | | \idx[Constant]{Rectangular} | |
| * NAME | | \idx[Constant]{Hann} | |
| * Window.h | | \idx[Constant]{Welch} | |
| * | | \idx[Constant]{Bartlett} | |
| * SYNOPSIS | | \idx[Constant]{Parzen} | |
| * #include "Window.h" | | \idx[Constant]{Papoulis} | |
| * | | \index{Apodize} | |
| * DESCRIPTION | | \index{Taper} | |
| * Error codes, typedefs and prototypes required for use of the Window | | \index{Power Spectrum} | |
| * family of LAL functions | | \index{Bias in power spectrum} | |
| * | | \index{Spectral Estimation} | |
| * DIAGNOSTICS | | | |
| * | | This header file contains enums that define the different types | |
| *----------------------------------------------------------------------- | | of windows, and a parameter block which is used as input to | |
| */ | | the window-making function. This allows you to | |
| | | dreate a REAL4 vector structure containing a window (also called | |
| | | a taper, lag window, or apodization function). | |
| | | | |
| | | \subsection*{Synopsis} | |
| | | \begin{verbatim} | |
| | | #include <lal/Window.h> | |
| | | \end{verbatim} | |
| | | | |
| | | \noindent | |
| | | The routine prototyped in this header file | |
| | | creates REAL4 vector structure containing a window (also called | |
| | | a taper, lag window, or apodization function). The choices | |
| | | currently available are: | |
| | | \begin{itemize} | |
| | | \item Rectangular | |
| | | \item Hann | |
| | | \item Welch | |
| | | \item Bartlett | |
| | | \item Parzen | |
| | | \item Papoulis | |
| | | \item Hamming | |
| | | \end{itemize} | |
| | | It should be straighforward to add additional window functions if | |
| | | they are desired. | |
| | | | |
| | | The window functions are defined for $j=0,\cdots,N-1$ by the following | |
| | | formulae. Note that $N$ is the length of the vector. In these formulae, l | |
| | | et | |
| | | $x=2 \pi j/N$, and $y=|2j/N-1|$, | |
| | | \begin{eqnarray*} | |
| | | {\rm Rectangular:\ } w_j &=& 1 \\ | |
| | | {\rm Hann:\ } w_j &=& {1 \over 2} ( 1 - \cos x ) \\ | |
| | | {\rm Welch:\ } w_j &=& 1 - y^2 \\ | |
| | | {\rm Bartlett:\ } w_j &=& 1 - y \\ | |
| | | {\rm Parzen:\ } w_j &=& 1 - 6 y^2 + 6 y^3 {\rm\ if\ } y\le 1/2\\ | |
| | | &=& 2 (1-y)^3 {\rm\ if\ } y>1/2\\ | |
| | | {\rm Papoulis:\ } w_j &=& {1 \over \pi} \sin (\pi y ) + ( 1 - y ) \cos | |
| | | (\pi y )\\ | |
| | | {\rm Hamming:\ } w_j &=& 1-0.46 (1 + \cos x ) \\ | |
| | | \end{eqnarray*} | |
| | | | |
| | | These window functions are shown in Fig.~\ref{f:window} for $N=1024$. | |
| | | | |
| | | A couple of comments and warnings may be useful. First, the | |
| | | definitions given here are taken from {\it Numerical Recipes in C} \cite{nu | |
| | | mrec} and | |
| | | {\it Spectral Analysis for Physical Applications} \cite{pw}. | |
| | | The definitions of windows are {\it not standard}. In particular, | |
| | | some authors (e.g. J.G. Proakis and D.G. Manolakis, {\it Digital | |
| | | Signal Processing} \cite{pm}) and some standard computer applications (e.g. | |
| | | {\tt | |
| | | MatLab}) use definitions in which $N$ is replaced by $N-1$ in the | |
| | | definitions of $x$ and $y$, with $j$ covering the range | |
| | | $j=0,\cdots,N-1$. This has the advantage of making the window | |
| | | function ``more symmetric'', typically be appending an extra ``0'' to | |
| | | the end of the array. It has the disadvantage that it throws out more | |
| | | of your precious data. | |
| | | | |
| | | If you want to get a window function that agrees with either Proakis | |
| | | \& Manolakis, or with MatLab, just call {\tt LALWindow()} with length | |
| | | parameter $M-1$. Then create an array of length $M$, copy the | |
| | | $M-1$ elements of the array returned by {\tt LALWindow()}, into it, | |
| | | and finally copy the {\it first} element of the array returned by {\tt | |
| | | LALWindow()} into the last element of your new array. | |
| | | | |
| | | **********************************************************************</lal | |
| | | LaTeX> */ | |
| | | | |
| #ifndef _WINDOW_H | | #ifndef _WINDOW_H | |
| #define _WINDOW_H | | #define _WINDOW_H | |
| | | | |
|
| #include "LALDatatypes.h" | | #include <lal/LALDatatypes.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
|
| NRCSID (WINDOWH, "$Id: Window.h,v 1.4 2000/07/23 01:16:19 jolien Exp $"); | | NRCSID (WINDOWH, "$Id: Window.h,v 1.10 2001/12/04 22:51:25 jolien Exp $"); | |
| | | | |
|
| #define WINDOW_NULLPARAM 1 | | /********************************************************** <lalLaTeX> | |
| #define WINDOW_NULLVECTOR 2 | | \subsection*{Error conditions} | |
| #define WINDOW_EALLOCATE 4 | | *********************************************************** </lalLaTeX>*/ | |
| #define WINDOW_ELENGTH 8 | | /* <lalErrTable> */ | |
| #define WINDOW_TYPEUNKNOWN 16 | | #define WINDOWH_ENULLPARAM 1 | |
| #define WINDOW_NULLHANDLE 32 | | #define WINDOWH_ENULLVECTOR 2 | |
| #define WINDOW_WRONGLENGTH 64 | | #define WINDOWH_EEALLOCATE 4 | |
| #define WINDOW_NULLDATA 128 | | #define WINDOWH_EELENGTH 8 | |
| | | #define WINDOWH_ETYPEUNKNOWN 16 | |
| #define WINDOW_MSGNULLPARAM "null input parameter structure pointer" | | #define WINDOWH_ENULLHANDLE 32 | |
| #define WINDOW_MSGNULLVECTOR "null output vector pointer" | | #define WINDOWH_EWRONGLENGTH 64 | |
| #define WINDOW_MSGEALLOCATE "unable to allocate vector to store window" | | #define WINDOWH_ENULLDATA 128 | |
| #define WINDOW_MSGELENGTH "length of window is <=0, must be positive" | | | |
| #define WINDOW_MSGTYPEUNKNOWN "window is of unknown type" | | #define WINDOWH_MSGENULLPARAM "null input parameter structure pointer" | |
| #define WINDOW_MSGNULLHANDLE "input vector is null" | | #define WINDOWH_MSGENULLVECTOR "null output vector pointer" | |
| #define WINDOW_MSGWRONGLENGTH "input vector is the wrong length" | | #define WINDOWH_MSGEEALLOCATE "unable to allocate vector to store window | |
| #define WINDOW_MSGNULLDATA "data area of input vector is null" | | " | |
| | | #define WINDOWH_MSGEELENGTH "length of window is <=0, must be positive | |
| | | " | |
| | | #define WINDOWH_MSGETYPEUNKNOWN "window is of unknown type" | |
| | | #define WINDOWH_MSGENULLHANDLE "input vector is null" | |
| | | #define WINDOWH_MSGEWRONGLENGTH "input vector is the wrong length" | |
| | | #define WINDOWH_MSGENULLDATA "data area of input vector is null" | |
| | | /*********************************************************** </lalErrTabl | |
| | | e>*/ | |
| | | /*<lalLaTeX> | |
| | | | |
| | | \subsection*{Types} | |
| | | \subsubsection*{\texttt{enum WindowType}} | |
| | | \idx[Type]{WindowType} | |
| | | \idx[Constant]{WINDOWNAMELIST} | |
| | | | |
| | | This enum defines the different possible types of windows that can be gener | |
| | | ated. | |
| | | Any code should take into account that this list may grow if someone adds t | |
| | | heir | |
| | | favorite window to the list. {\bf WARNING:} additional window types must b | |
| | | e added just before | |
| | | \texttt{NumberWindowTypes} and after the existing window types. Note that | |
| | | since an enum by default gives integers starting at zero and incrementing | |
| | | by one, the enum \texttt{NumberWindowTypes} | |
| | | will always give the correct number of window types, even if the list is ex | |
| | | tended | |
| | | in the future. The definition of the enum is: | |
| | | \begin{verbatim} | |
| | | typedef enum {Rectangular, | |
| | | Hann, | |
| | | Welch, | |
| | | Bartlett, | |
| | | Parzen, | |
| | | Papoulis, | |
| | | Hamming, | |
| | | NumberWindowTypes} WindowType; | |
| | | \end{verbatim} | |
| | | For convenience, the following macro is also defined | |
| | | \begin{verbatim} | |
| | | #define WINDOWNAMELIST {"Rectangular","Hann","Welch","Bartlett","Parzen","P | |
| | | apoulis", | |
| | | "Hamming"} | |
| | | \end{verbatim} | |
| | | This string can be used to print out the name of any of the windows (see th | |
| | | e | |
| | | test program for an example of this). If a new window | |
| | | is added, be sure to put its name onto the end of the array. | |
| | | | |
|
| | | ***************************************************************************
</lalLaTeX> */ | |
| /* Define the types of available windows */ | | /* Define the types of available windows */ | |
| /* WARNING: additional window types must be added just before */ | | /* WARNING: additional window types must be added just before */ | |
| /* NumberWindowTypes, and after the existing window types */ | | /* NumberWindowTypes, and after the existing window types */ | |
|
| typedef enum | | | |
| { | | | |
| Rectangular,Hann,Welch,Bartlett,Parzen,Papoulis,Hamming, | | | |
| /* add any new window types just before this comment */ | | | |
| NumberWindowTypes | | | |
| } | | | |
| WindowType; | | | |
| | | | |
|
| | | typedef enum {Rectangular, | |
| | | Hann, | |
| | | Welch, | |
| | | Bartlett, | |
| | | Parzen, | |
| | | Papoulis, | |
| | | Hamming, | |
| | | /* add any new window types just before this comment */ | |
| | | NumberWindowTypes} WindowType; | |
| | | | |
| | | /* if you add new windows above, be sure to add a descriptive name below. | |
| | | */ | |
| #define WINDOWNAMELIST {"Rectangular","Hann","Welch","Bartlett","Parzen","P
apoulis","Hamming"} | | #define WINDOWNAMELIST {"Rectangular","Hann","Welch","Bartlett","Parzen","P
apoulis","Hamming"} | |
| | | | |
|
| typedef struct | | /************************************************************************** | |
| tagLALWindowParams | | *<lalLaTeX> | |
| { | | | |
| INT4 length; /* length of window */ | | | |
| WindowType type; /* type of window */ | | | |
| REAL8 sumofsquares; /* sum of window squared (returned) */ | | | |
| CHAR* windowname; /* pointer to a char string with win | | | |
| dow name */ | | | |
| } | | | |
| LALWindowParams; | | | |
| | | | |
|
| void LALWindow(LALStatus * ,REAL4Vector *, LALWindowParams *); | | \subsubsection*{\texttt{Structure LALWindowParams}} | |
| | | \idx[Type]{LALWindowParams} | |
| | | This structure stores the parameters used to call the window function. | |
| | | It is also used to return the sum of the vector squared. | |
| | | The structure is defined by | |
| | | \begin{verbatim} | |
| | | typedef struct tagLALWindowParams { | |
| | | INT4 length; <==> length of window (input) | |
| | | WindowType type; <==> type of window (input) | |
| | | REAL8 sumofsquares; <==> sum of window squared (output) | |
| | | CHAR* windowname; <==> pointer to a char string with window name | |
| | | (output) | |
| | | } LALWindowParams; | |
| | | \end{verbatim} | |
| | | The four fields are: | |
| | | \begin{description} | |
| | | \item[\texttt{INT4 length}] The length of the window. This is used as input | |
| | | . | |
| | | \item[\texttt{WindowType type}] The type of the window. This is used as inp | |
| | | ut. | |
| | | \item[\texttt{REAL8 sumofsquares}] The sum of the squares of the window vec | |
| | | tor. This is used as output. | |
| | | \item[\texttt{CHAR* windowname}] A pointer to a character string containing | |
| | | the window name. This is used as output. | |
| | | \end{description} | |
| | | | |
| | | *************************************************************************** | |
| | | </lalLaTeX> */ | |
| | | | |
| | | typedef struct tagLALWindowParams { | |
| | | INT4 length; /* length of window (input) */ | |
| | | WindowType type; /* type of window (input) */ | |
| | | REAL8 sumofsquares; /* sum of window squared (output) */ | |
| | | const CHAR* windowname; /* pointer to a char string with window name (o | |
| | | utput) */ | |
| | | } LALWindowParams; | |
| | | | |
| | | void LALWindow (LALStatus *, | |
| | | REAL4Vector *, | |
| | | LALWindowParams *); | |
| | | | |
| | | /************************************************************************** | |
| | | ** <lalLaTeX> | |
| | | \vfill{\footnotesize\input{WindowHV}} | |
| | | \newpage | |
| | | \input{WindowC} | |
| | | \newpage | |
| | | \input{WindowTestC} | |
| | | *************************************************************************** | |
| | | * </lalLaTeX> */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif /* _WINDOW_H */ | | #endif /* _WINDOW_H */ | |
| | | | |
End of changes. 9 change blocks. |
| 61 lines changed or deleted | | 222 lines changed or added | |
|