| LALDatatypes.h | | LALDatatypes.h | |
| | | | |
| skipping to change at line 27 | | skipping to change at line 27 | |
| * MA 02111-1307 USA | | * MA 02111-1307 USA | |
| */ | | */ | |
| | | | |
| // ---------- SEE LALDatatypes.dox for doxygen documentation ---------- | | // ---------- SEE LALDatatypes.dox for doxygen documentation ---------- | |
| | | | |
| #ifndef _LALDATATYPES_H | | #ifndef _LALDATATYPES_H | |
| #define _LALDATATYPES_H | | #define _LALDATATYPES_H | |
| | | | |
| #include <lal/LALAtomicDatatypes.h> | | #include <lal/LALAtomicDatatypes.h> | |
| | | | |
|
| /** \addtogroup LALDatatypes */ /*@{*/ | | /** \addtogroup LALDatatypes *//*@{ */ | |
| | | | |
| /* ---------- constants ---------- */ | | /* ---------- constants ---------- */ | |
| | | | |
| /** Type size constants, see \ref LALDatatypes for more details. */ | | /** Type size constants, see \ref LALDatatypes for more details. */ | |
|
| enum | | enum { | |
| { | | LAL_1_BYTE_TYPE_SIZE = 000, /**< One byte size 00 = 0 */ | |
| LAL_1_BYTE_TYPE_SIZE = 000, /**< One byte size 00 = 0 */ | | LAL_2_BYTE_TYPE_SIZE = 001, /**< Two byte size 01 = 1 */ | |
| LAL_2_BYTE_TYPE_SIZE = 001, /**< Two byte size 01 = 1 */ | | LAL_4_BYTE_TYPE_SIZE = 002, /**< Four byte size 010 = 2 */ | |
| LAL_4_BYTE_TYPE_SIZE = 002, /**< Four byte size 010 = 2 */ | | LAL_8_BYTE_TYPE_SIZE = 003, /**< Eight byte size 011 = 3 */ | |
| LAL_8_BYTE_TYPE_SIZE = 003, /**< Eight byte size 011 = 3 */ | | LAL_16_BYTE_TYPE_SIZE = 004, /**< Sixteen byte size 0100 = 4 */ | |
| LAL_16_BYTE_TYPE_SIZE = 004, /**< Sixteen byte size 0100 = 4 */ | | LAL_TYPE_SIZE_MASK = 007 /**< Type size mask 0111 = 7 */ | |
| LAL_TYPE_SIZE_MASK = 007 /**< Type size mask 0111 = 7 */ | | | |
| }; | | }; | |
| | | | |
| /** Type flag constants, see \ref LALDatatypes for more details. */ | | /** Type flag constants, see \ref LALDatatypes for more details. */ | |
|
| enum | | enum { | |
| { | | LAL_FLTPT_TYPE_FLAG = 010, /**< Floating-point (vs integer) type 0100 | |
| LAL_FLTPT_TYPE_FLAG = 010, /**< Floating-point (vs integer) type 0100 | | 0 = 8 */ | |
| 0 = 8 */ | | LAL_CMPLX_TYPE_FLAG = 020, /**< Complex (vs real) type 010000 = 16 * | |
| LAL_CMPLX_TYPE_FLAG = 020, /**< Complex (vs real) type 010000 = 16 * | | / | |
| / | | LAL_UNSGN_TYPE_FLAG = 040 /**< Unsigned (vs signed) type 0100000 = 3 | |
| LAL_UNSGN_TYPE_FLAG = 040 /**< Unsigned (vs signed) type 0100000 = 3 | | 2 */ | |
| 2 */ | | | |
| }; | | }; | |
| | | | |
| /** Type codes: use these type codes to identify a LAL atomic data type, se
e \ref LALDatatypes for more details. */ | | /** Type codes: use these type codes to identify a LAL atomic data type, se
e \ref LALDatatypes for more details. */ | |
|
| typedef enum | | typedef enum { | |
| { | | LAL_CHAR_TYPE_CODE = LAL_1_BYTE_TYPE_SIZE, /**< CHAR type code (0) */ | |
| LAL_CHAR_TYPE_CODE = LAL_1_BYTE_TYPE_SIZE, /**< CHAR type code (0) */ | | LAL_I2_TYPE_CODE = LAL_2_BYTE_TYPE_SIZE, /**< INT2 type code (1) */ | |
| LAL_I2_TYPE_CODE = LAL_2_BYTE_TYPE_SIZE, /**< INT2 type code (1) */ | | LAL_I4_TYPE_CODE = LAL_4_BYTE_TYPE_SIZE, /**< INT4 type code (2) */ | |
| LAL_I4_TYPE_CODE = LAL_4_BYTE_TYPE_SIZE, /**< INT4 type code (2) */ | | LAL_I8_TYPE_CODE = LAL_8_BYTE_TYPE_SIZE, /**< INT8 type code (3) */ | |
| LAL_I8_TYPE_CODE = LAL_8_BYTE_TYPE_SIZE, /**< INT8 type code (3) */ | | LAL_UCHAR_TYPE_CODE = LAL_1_BYTE_TYPE_SIZE | LAL_UNSGN_TYPE_FLAG, /** | |
| LAL_UCHAR_TYPE_CODE = LAL_1_BYTE_TYPE_SIZE | LAL_UNSGN_TYPE_FLAG, /** | | < UCHAR type code (32) */ | |
| < UCHAR type code (32) */ | | LAL_U2_TYPE_CODE = LAL_2_BYTE_TYPE_SIZE | LAL_UNSGN_TYPE_FLAG, /** | |
| LAL_U2_TYPE_CODE = LAL_2_BYTE_TYPE_SIZE | LAL_UNSGN_TYPE_FLAG, /** | | < UINT2 type code (33) */ | |
| < UINT2 type code (33) */ | | LAL_U4_TYPE_CODE = LAL_4_BYTE_TYPE_SIZE | LAL_UNSGN_TYPE_FLAG, /** | |
| LAL_U4_TYPE_CODE = LAL_4_BYTE_TYPE_SIZE | LAL_UNSGN_TYPE_FLAG, /** | | < UINT4 type code (34) */ | |
| < UINT4 type code (34) */ | | LAL_U8_TYPE_CODE = LAL_8_BYTE_TYPE_SIZE | LAL_UNSGN_TYPE_FLAG, /** | |
| LAL_U8_TYPE_CODE = LAL_8_BYTE_TYPE_SIZE | LAL_UNSGN_TYPE_FLAG, /** | | < UINT8 type code (35) */ | |
| < UINT8 type code (35) */ | | LAL_S_TYPE_CODE = LAL_4_BYTE_TYPE_SIZE | LAL_FLTPT_TYPE_FLAG, /** | |
| LAL_S_TYPE_CODE = LAL_4_BYTE_TYPE_SIZE | LAL_FLTPT_TYPE_FLAG, /** | | < REAL4 type code (18) */ | |
| < REAL4 type code (18) */ | | LAL_D_TYPE_CODE = LAL_8_BYTE_TYPE_SIZE | LAL_FLTPT_TYPE_FLAG, /** | |
| LAL_D_TYPE_CODE = LAL_8_BYTE_TYPE_SIZE | LAL_FLTPT_TYPE_FLAG, /** | | < REAL8 type code (19) */ | |
| < REAL8 type code (19) */ | | LAL_C_TYPE_CODE = LAL_8_BYTE_TYPE_SIZE | LAL_CMPLX_TYPE_FLAG | LAL_FLTP | |
| LAL_C_TYPE_CODE = LAL_8_BYTE_TYPE_SIZE | LAL_CMPLX_TYPE_FLAG | LAL_ | | T_TYPE_FLAG, /**< COMPLEX8 type code (27) */ | |
| FLTPT_TYPE_FLAG, /**< COMPLEX8 type code (27) */ | | LAL_Z_TYPE_CODE = LAL_16_BYTE_TYPE_SIZE | LAL_CMPLX_TYPE_FLAG | LAL_FLT | |
| LAL_Z_TYPE_CODE = LAL_16_BYTE_TYPE_SIZE | LAL_CMPLX_TYPE_FLAG | LAL | | PT_TYPE_FLAG /**< COMPLEX16 type code (28) */ | |
| _FLTPT_TYPE_FLAG /**< COMPLEX16 type code (28) */ | | } LALTYPECODE; | |
| } | | | |
| LALTYPECODE; | | | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
|
| | | #elif 0 | |
| | | } /* so that editors will match preceding brace */ | |
| #endif | | #endif | |
| | | | |
| /* ---------- Vector types ---------- */ | | /* ---------- Vector types ---------- */ | |
| | | | |
| /** Vector of type CHAR, see \ref ss_Vector for more details. */ | | /** Vector of type CHAR, see \ref ss_Vector for more details. */ | |
|
| typedef struct | | typedef struct tagCHARVector { | |
| tagCHARVector | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_1D(CHARVector, CHAR, data, UINT4, length)); | |
| #ifdef SWIG /* SWIG interface directives */ | | #endif /* SWIG */ | |
| SWIGLAL(1D_ARRAY(CHAR, data, UINT4, length)); | | UINT4 length; /**< Number of elements in array. */ | |
| #endif /* SWIG */ | | CHAR *data; /**< Pointer to the data array. */ | |
| UINT4 length; /**< Number of elements in array. */ | | } CHARVector; | |
| CHAR *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| CHARVector; | | | |
| | | | |
| /** Vector of type CHAR*, ie 'strings', see \ref ss_Vector for more details
. */ | | /** Vector of type CHAR*, ie 'strings', see \ref ss_Vector for more details
. */ | |
| typedef struct tagLALStringVector { | | typedef struct tagLALStringVector { | |
|
| #ifdef SWIG /* SWIG interface directives */ | | #ifdef SWIG /* SWIG interface directives */ | |
| SWIGLAL(1D_ARRAY(CHAR*, data, UINT4, length)); | | SWIGLAL(ARRAY_1D(LALStringVector, CHAR *, data, UINT4, length)); | |
| #endif /* SWIG */ | | #endif /* SWIG */ | |
|
| UINT4 length; /**< Number of elements in array. */ | | UINT4 length; /**< Number of elements in array. */ | |
| CHAR **data; /**< Pointer to the data array. */ | | CHAR **data; /**< Pointer to the data array. */ | |
| } LALStringVector; | | } LALStringVector; | |
| | | | |
| /** Vector of type INT2, see \ref ss_Vector for more details. */ | | /** Vector of type INT2, see \ref ss_Vector for more details. */ | |
|
| typedef struct | | typedef struct tagINT2Vector { | |
| tagINT2Vector | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_1D(INT2Vector, INT2, data, UINT4, length)); | |
| #ifdef SWIG /* SWIG interface directives */ | | #endif /* SWIG */ | |
| SWIGLAL(1D_ARRAY(INT2, data, UINT4, length)); | | UINT4 length; /**< Number of elements in array. */ | |
| #endif /* SWIG */ | | INT2 *data; /**< Pointer to the data array. */ | |
| UINT4 length; /**< Number of elements in array. */ | | } INT2Vector; | |
| INT2 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| INT2Vector; | | | |
| | | | |
| /** Vector of type UINT2, see \ref ss_Vector for more details. */ | | /** Vector of type UINT2, see \ref ss_Vector for more details. */ | |
|
| typedef struct | | typedef struct tagUINT2Vector { | |
| tagUINT2Vector | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_1D(UINT2Vector, UINT2, data, UINT4, length)); | |
| #ifdef SWIG /* SWIG interface directives */ | | #endif /* SWIG */ | |
| SWIGLAL(1D_ARRAY(UINT2, data, UINT4, length)); | | UINT4 length; /**< Number of elements in array. */ | |
| #endif /* SWIG */ | | UINT2 *data; /**< Pointer to the data array. */ | |
| UINT4 length; /**< Number of elements in array. */ | | } UINT2Vector; | |
| UINT2 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| UINT2Vector; | | | |
| | | | |
| /** Vector of type INT4, see \ref ss_Vector for more details. */ | | /** Vector of type INT4, see \ref ss_Vector for more details. */ | |
|
| typedef struct | | typedef struct tagINT4Vector { | |
| tagINT4Vector | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_1D(INT4Vector, INT4, data, UINT4, length)); | |
| #ifdef SWIG /* SWIG interface directives */ | | #endif /* SWIG */ | |
| SWIGLAL(1D_ARRAY(INT4, data, UINT4, length)); | | UINT4 length; /**< Number of elements in array. */ | |
| #endif /* SWIG */ | | INT4 *data; /**< Pointer to the data array. */ | |
| UINT4 length; /**< Number of elements in array. */ | | } INT4Vector; | |
| INT4 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| INT4Vector; | | | |
| | | | |
| /** Vector of type UINT4, see \ref ss_Vector for more details. */ | | /** Vector of type UINT4, see \ref ss_Vector for more details. */ | |
|
| typedef struct | | typedef struct tagUINT4Vector { | |
| tagUINT4Vector | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_1D(UINT4Vector, UINT4, data, UINT4, length)); | |
| #ifdef SWIG /* SWIG interface directives */ | | #endif /* SWIG */ | |
| SWIGLAL(1D_ARRAY(UINT4, data, UINT4, length)); | | UINT4 length; /**< Number of elements in array. */ | |
| #endif /* SWIG */ | | UINT4 *data; /**< Pointer to the data array. */ | |
| UINT4 length; /**< Number of elements in array. */ | | } UINT4Vector; | |
| UINT4 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| UINT4Vector; | | | |
| | | | |
| /** Vector of type INT8, see \ref ss_Vector for more details. */ | | /** Vector of type INT8, see \ref ss_Vector for more details. */ | |
|
| typedef struct | | typedef struct tagINT8Vector { | |
| tagINT8Vector | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_1D(INT8Vector, INT8, data, UINT4, length)); | |
| #ifdef SWIG /* SWIG interface directives */ | | #endif /* SWIG */ | |
| SWIGLAL(1D_ARRAY(INT8, data, UINT4, length)); | | UINT4 length; /**< Number of elements in array. */ | |
| #endif /* SWIG */ | | INT8 *data; /**< Pointer to the data array. */ | |
| UINT4 length; /**< Number of elements in array. */ | | } INT8Vector; | |
| INT8 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| INT8Vector; | | | |
| | | | |
| /** Vector of type UINT8, see \ref ss_Vector for more details. */ | | /** Vector of type UINT8, see \ref ss_Vector for more details. */ | |
|
| typedef struct | | typedef struct tagUINT8Vector { | |
| tagUINT8Vector | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_1D(UINT8Vector, UINT8, data, UINT4, length)); | |
| #ifdef SWIG /* SWIG interface directives */ | | #endif /* SWIG */ | |
| SWIGLAL(1D_ARRAY(UINT8, data, UINT4, length)); | | UINT4 length; /**< Number of elements in array. */ | |
| #endif /* SWIG */ | | UINT8 *data; /**< Pointer to the data array. */ | |
| UINT4 length; /**< Number of elements in array. */ | | } UINT8Vector; | |
| UINT8 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| UINT8Vector; | | | |
| | | | |
| /** Vector of type REAL4, see \ref ss_Vector for more details. */ | | /** Vector of type REAL4, see \ref ss_Vector for more details. */ | |
|
| typedef struct | | typedef struct tagREAL4Vector { | |
| tagREAL4Vector | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_1D(REAL4Vector, REAL4, data, UINT4, length)); | |
| #ifdef SWIG /* SWIG interface directives */ | | #endif /* SWIG */ | |
| SWIGLAL(1D_ARRAY(REAL4, data, UINT4, length)); | | UINT4 length; /**< Number of elements in array. */ | |
| #endif /* SWIG */ | | REAL4 *data; /**< Pointer to the data array. */ | |
| UINT4 length; /**< Number of elements in array. */ | | } REAL4Vector; | |
| REAL4 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| REAL4Vector; | | | |
| | | | |
| /** Vector of type REAL8, see \ref ss_Vector for more details. */ | | /** Vector of type REAL8, see \ref ss_Vector for more details. */ | |
|
| typedef struct tagREAL8Vector | | typedef struct tagREAL8Vector { | |
| { | | #ifdef SWIG /* SWIG interface directives */ | |
| #ifdef SWIG /* SWIG interface directives */ | | SWIGLAL(ARRAY_1D(REAL8Vector, REAL8, data, UINT4, length)); | |
| SWIGLAL(1D_ARRAY(REAL8, data, UINT4, length)); | | #endif /* SWIG */ | |
| #endif /* SWIG */ | | UINT4 length; /**< Number of elements in array. */ | |
| UINT4 length; /**< Number of elements in array. */ | | REAL8 *data; /**< Pointer to the data array. */ | |
| REAL8 *data; /**< Pointer to the data array. */ | | } REAL8Vector; | |
| } | | | |
| REAL8Vector; | | | |
| | | | |
| /** Vector of type COMPLEX8, see \ref ss_Vector for more details. */ | | /** Vector of type COMPLEX8, see \ref ss_Vector for more details. */ | |
|
| typedef struct tagCOMPLEX8Vector | | typedef struct tagCOMPLEX8Vector { | |
| { | | #ifdef SWIG /* SWIG interface directives */ | |
| #ifdef SWIG /* SWIG interface directives */ | | SWIGLAL(ARRAY_1D(COMPLEX8Vector, COMPLEX8, data, UINT4, length)); | |
| SWIGLAL(1D_ARRAY(COMPLEX8, data, UINT4, length)); | | #endif /* SWIG */ | |
| #endif /* SWIG */ | | UINT4 length; /**< Number of elements in array. */ | |
| UINT4 length; /**< Number of elements in array. */ | | COMPLEX8 *data; /**< Pointer to the data array. */ | |
| COMPLEX8 *data; /**< Pointer to the data array. */ | | } COMPLEX8Vector; | |
| } | | | |
| COMPLEX8Vector; | | | |
| | | | |
| /** Vector of type COMPLEX16, see \ref ss_Vector for more details. */ | | /** Vector of type COMPLEX16, see \ref ss_Vector for more details. */ | |
|
| typedef struct tagCOMPLEX16Vector | | typedef struct tagCOMPLEX16Vector { | |
| { | | #ifdef SWIG /* SWIG interface directives */ | |
| #ifdef SWIG /* SWIG interface directives */ | | SWIGLAL(ARRAY_1D(COMPLEX16Vector, COMPLEX16, data, UINT4, length)); | |
| SWIGLAL(1D_ARRAY(COMPLEX16, data, UINT4, length)); | | #endif /* SWIG */ | |
| #endif /* SWIG */ | | UINT4 length; /**< Number of elements in array. */ | |
| UINT4 length; /**< Number of elements in array. */ | | COMPLEX16 *data; /**< Pointer to the data array. */ | |
| COMPLEX16 *data; /**< Pointer to the data array. */ | | } COMPLEX16Vector; | |
| } | | | |
| COMPLEX16Vector; | | | |
| | | | |
|
| /* ---------- Array types ---------- */ | | /* ---------- Array types ---------- */ | |
| | | | |
| /** Multidimentional array of INT2, see \ref ss_Array for more details. */ | | /** Multidimentional array of INT2, see \ref ss_Array for more details. */ | |
|
| typedef struct | | typedef struct tagINT2Array { | |
| tagINT2Array | | UINT4Vector *dimLength; /**< Vector of array dimensions. */ | |
| { | | INT2 *data; /**< Pointer to the data array. */ | |
| UINT4Vector *dimLength; /**< Vector of array dimensions. */ | | } INT2Array; | |
| INT2 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| INT2Array; | | | |
| | | | |
| /** Multidimentional array of UINT2, see \ref ss_Array for more details. */ | | /** Multidimentional array of UINT2, see \ref ss_Array for more details. */ | |
|
| typedef struct | | typedef struct tagUINT2Array { | |
| tagUINT2Array | | UINT4Vector *dimLength; /**< Vector of array dimensions. */ | |
| { | | UINT2 *data; /**< Pointer to the data array. */ | |
| UINT4Vector *dimLength; /**< Vector of array dimensions. */ | | } UINT2Array; | |
| UINT2 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| UINT2Array; | | | |
| | | | |
| /** Multidimentional array of INT4, see \ref ss_Array for more details. */ | | /** Multidimentional array of INT4, see \ref ss_Array for more details. */ | |
|
| typedef struct | | typedef struct tagINT4Array { | |
| tagINT4Array | | UINT4Vector *dimLength; /**< Vector of array dimensions. */ | |
| { | | INT4 *data; /**< Pointer to the data array. */ | |
| UINT4Vector *dimLength; /**< Vector of array dimensions. */ | | } INT4Array; | |
| INT4 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| INT4Array; | | | |
| | | | |
| /** Multidimentional array of UINT4, see \ref ss_Array for more details. */ | | /** Multidimentional array of UINT4, see \ref ss_Array for more details. */ | |
|
| typedef struct | | typedef struct tagUINT4Array { | |
| tagUINT4Array | | UINT4Vector *dimLength; /**< Vector of array dimensions. */ | |
| { | | UINT4 *data; /**< Pointer to the data array. */ | |
| UINT4Vector *dimLength; /**< Vector of array dimensions. */ | | } UINT4Array; | |
| UINT4 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| UINT4Array; | | | |
| | | | |
| /** Multidimentional array of INT8, see \ref ss_Array for more details. */ | | /** Multidimentional array of INT8, see \ref ss_Array for more details. */ | |
|
| typedef struct | | typedef struct tagINT8Array { | |
| tagINT8Array | | UINT4Vector *dimLength; /**< Vector of array dimensions. */ | |
| { | | INT8 *data; /**< Pointer to the data array. */ | |
| UINT4Vector *dimLength; /**< Vector of array dimensions. */ | | } INT8Array; | |
| INT8 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| INT8Array; | | | |
| | | | |
| /** Multidimentional array of UINT8, see \ref ss_Array for more details. */ | | /** Multidimentional array of UINT8, see \ref ss_Array for more details. */ | |
|
| typedef struct | | typedef struct tagUINT8Array { | |
| tagUINT8Array | | UINT4Vector *dimLength; /**< Vector of array dimensions. */ | |
| { | | UINT8 *data; /**< Pointer to the data array. */ | |
| UINT4Vector *dimLength; /**< Vector of array dimensions. */ | | } UINT8Array; | |
| UINT8 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| UINT8Array; | | | |
| | | | |
| /** Multidimentional array of REAL4, see \ref ss_Array for more details. */ | | /** Multidimentional array of REAL4, see \ref ss_Array for more details. */ | |
|
| typedef struct | | typedef struct tagREAL4Array { | |
| tagREAL4Array | | UINT4Vector *dimLength; /**< Vector of array dimensions. */ | |
| { | | REAL4 *data; /**< Pointer to the data array. */ | |
| UINT4Vector *dimLength; /**< Vector of array dimensions. */ | | } REAL4Array; | |
| REAL4 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| REAL4Array; | | | |
| | | | |
| /** Multidimentional array of REAL8, see \ref ss_Array for more details. */ | | /** Multidimentional array of REAL8, see \ref ss_Array for more details. */ | |
|
| typedef struct | | typedef struct tagREAL8Array { | |
| tagREAL8Array | | UINT4Vector *dimLength; /**< Vector of array dimensions. */ | |
| { | | REAL8 *data; /**< Pointer to the data array. */ | |
| UINT4Vector *dimLength; /**< Vector of array dimensions. */ | | } REAL8Array; | |
| REAL8 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| REAL8Array; | | | |
| | | | |
| /** Multidimentional array of COMPLEX8, see \ref ss_Array for more details.
*/ | | /** Multidimentional array of COMPLEX8, see \ref ss_Array for more details.
*/ | |
|
| typedef struct | | typedef struct tagCOMPLEX8Array { | |
| tagCOMPLEX8Array | | UINT4Vector *dimLength; /**< Vector of array dimensions. */ | |
| { | | COMPLEX8 *data; /**< Pointer to the data array. */ | |
| UINT4Vector *dimLength; /**< Vector of array dimensions. */ | | } COMPLEX8Array; | |
| COMPLEX8 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| COMPLEX8Array; | | | |
| | | | |
| /** Multidimentional array of COMPLEX16, see \ref ss_Array for more details
. */ | | /** Multidimentional array of COMPLEX16, see \ref ss_Array for more details
. */ | |
|
| typedef struct | | typedef struct tagCOMPLEX16Array { | |
| tagCOMPLEX16Array | | UINT4Vector *dimLength; /**< Vector of array dimensions. */ | |
| { | | COMPLEX16 *data; /**< Pointer to the data array. */ | |
| UINT4Vector *dimLength; /**< Vector of array dimensions. */ | | } COMPLEX16Array; | |
| COMPLEX16 *data; /**< Pointer to the data array. */ | | | |
| } | | /* ---------- Sequence types ---------- */ | |
| COMPLEX16Array; | | | |
| | | typedef CHARVector CHARSequence; /**< See \ref ss_Sequence for docum | |
| | | entation */ | |
| | | typedef INT2Vector INT2Sequence; /**< See \ref ss_Sequence for docum | |
| | | entation */ | |
| | | typedef UINT2Vector UINT2Sequence; /**< See \ref ss_Sequence for docum | |
| | | entation */ | |
| | | typedef INT4Vector INT4Sequence; /**< See \ref ss_Sequence for docum | |
| | | entation */ | |
| | | typedef UINT4Vector UINT4Sequence; /**< See \ref ss_Sequence for docum | |
| | | entation */ | |
| | | typedef INT8Vector INT8Sequence; /**< See \ref ss_Sequence for docum | |
| | | entation */ | |
| | | typedef UINT8Vector UINT8Sequence; /**< See \ref ss_Sequence for docum | |
| | | entation */ | |
| | | typedef REAL4Vector REAL4Sequence; /**< See \ref ss_Sequence for docum | |
| | | entation */ | |
| | | typedef REAL8Vector REAL8Sequence; /**< See \ref ss_Sequence for docum | |
| | | entation */ | |
| | | typedef COMPLEX8Vector COMPLEX8Sequence; /**< See \ref ss_Sequence for docu | |
| | | mentation */ | |
| | | typedef COMPLEX16Vector COMPLEX16Sequence; /**< See \ref ss_Sequence for do | |
| | | cumentation */ | |
| | | | |
|
| /* ---------- Sequence types ---------- */ | | /* ---------- VectorSequence types ---------- */ | |
| | | | |
| typedef CHARVector CHARSequence; /**< See \ref ss_Sequence for docume | | | |
| ntation */ | | | |
| typedef INT2Vector INT2Sequence; /**< See \ref ss_Sequence for docume | | | |
| ntation */ | | | |
| typedef UINT2Vector UINT2Sequence; /**< See \ref ss_Sequence for docume | | | |
| ntation */ | | | |
| typedef INT4Vector INT4Sequence; /**< See \ref ss_Sequence for docume | | | |
| ntation */ | | | |
| typedef UINT4Vector UINT4Sequence; /**< See \ref ss_Sequence for docume | | | |
| ntation */ | | | |
| typedef INT8Vector INT8Sequence; /**< See \ref ss_Sequence for docume | | | |
| ntation */ | | | |
| typedef UINT8Vector UINT8Sequence; /**< See \ref ss_Sequence for docume | | | |
| ntation */ | | | |
| typedef REAL4Vector REAL4Sequence; /**< See \ref ss_Sequence for docume | | | |
| ntation */ | | | |
| typedef REAL8Vector REAL8Sequence; /**< See \ref ss_Sequence for docume | | | |
| ntation */ | | | |
| typedef COMPLEX8Vector COMPLEX8Sequence;/**< See \ref ss_Sequence for docu | | | |
| mentation */ | | | |
| typedef COMPLEX16Vector COMPLEX16Sequence;/**< See \ref ss_Sequence for doc | | | |
| umentation */ | | | |
| | | | |
| /* ---------- VectorSequence types ---------- */ | | | |
| | | | |
| /** Sequence of CHAR Vectors, see \ref ss_VectorSequence for more details.
*/ | | /** Sequence of CHAR Vectors, see \ref ss_VectorSequence for more details.
*/ | |
|
| typedef struct | | typedef struct tagCHARVectorSequence { | |
| tagCHARVectorSequence | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_2D(CHARVectorSequence, CHAR, data, UINT4, length, vectorL | |
| #ifdef SWIG /* SWIG interface directives */ | | ength)); | |
| SWIGLAL(2D_ARRAY(CHAR, data, UINT4, length, vectorLength)); | | #endif /* SWIG */ | |
| #endif /* SWIG */ | | UINT4 length; /**< The number \a l of vectors. */ | |
| UINT4 length; /**< The number \a l of vectors. */ | | UINT4 vectorLength; /**< The length \a n of each vector. */ | |
| UINT4 vectorLength; /**< The length \a n of each vector. */ | | CHAR *data; /**< Pointer to the data array. Element \a i of vector \a | |
| CHAR *data; /**< Pointer to the data array. Element \a i of vector \a j | | j is \c data[ \a jn + \a i \c ]. */ | |
| is \c data[ \a jn + \a i \c ]. */ | | } CHARVectorSequence; | |
| } | | | |
| CHARVectorSequence; | | | |
| | | | |
| /** Sequence of INT2 Vectors, see \ref ss_VectorSequence for more details.
*/ | | /** Sequence of INT2 Vectors, see \ref ss_VectorSequence for more details.
*/ | |
|
| typedef struct | | typedef struct tagINT2VectorSequence { | |
| tagINT2VectorSequence | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_2D(INT2VectorSequence, INT2, data, UINT4, length, vectorL | |
| #ifdef SWIG /* SWIG interface directives */ | | ength)); | |
| SWIGLAL(2D_ARRAY(INT2, data, UINT4, length, vectorLength)); | | #endif /* SWIG */ | |
| #endif /* SWIG */ | | UINT4 length; /**< The number \a l of vectors. */ | |
| UINT4 length; /**< The number \a l of vectors. */ | | UINT4 vectorLength; /**< The length \a n of each vector. */ | |
| UINT4 vectorLength; /**< The length \a n of each vector. */ | | INT2 *data; /**< Pointer to the data array. Element \a i of vector \a | |
| INT2 *data; /**< Pointer to the data array. Element \a i of vector \a j | | j is \c data[ \a jn + \a i \c ]. */ | |
| is \c data[ \a jn + \a i \c ]. */ | | } INT2VectorSequence; | |
| } | | | |
| INT2VectorSequence; | | | |
| | | | |
| /** Sequence of UINT2 Vectors, see \ref ss_VectorSequence for more details.
*/ | | /** Sequence of UINT2 Vectors, see \ref ss_VectorSequence for more details.
*/ | |
|
| typedef struct | | typedef struct tagUINT2VectorSequence { | |
| tagUINT2VectorSequence | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_2D(UINT2VectorSequence, UINT2, data, UINT4, length, vecto | |
| #ifdef SWIG /* SWIG interface directives */ | | rLength)); | |
| SWIGLAL(2D_ARRAY(UINT2, data, UINT4, length, vectorLength)); | | #endif /* SWIG */ | |
| #endif /* SWIG */ | | UINT4 length; /**< The number \a l of vectors. */ | |
| UINT4 length; /**< The number \a l of vectors. */ | | UINT4 vectorLength; /**< The length \a n of each vector. */ | |
| UINT4 vectorLength; /**< The length \a n of each vector. */ | | UINT2 *data; /**< Pointer to the data array. Element \a i of vector \a | |
| UINT2 *data; /**< Pointer to the data array. Element \a i of vector \a j | | j is \c data[ \a jn + \a i \c ]. */ | |
| is \c data[ \a jn + \a i \c ]. */ | | } UINT2VectorSequence; | |
| } | | | |
| UINT2VectorSequence; | | | |
| | | | |
| /** Sequence of INT4 Vectors, see \ref ss_VectorSequence for more details.
*/ | | /** Sequence of INT4 Vectors, see \ref ss_VectorSequence for more details.
*/ | |
|
| typedef struct | | typedef struct tagINT4VectorSequence { | |
| tagINT4VectorSequence | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_2D(INT4VectorSequence, INT4, data, UINT4, length, vectorL | |
| #ifdef SWIG /* SWIG interface directives */ | | ength)); | |
| SWIGLAL(2D_ARRAY(INT4, data, UINT4, length, vectorLength)); | | #endif /* SWIG */ | |
| #endif /* SWIG */ | | UINT4 length; /**< The number \a l of vectors. */ | |
| UINT4 length; /**< The number \a l of vectors. */ | | UINT4 vectorLength; /**< The length \a n of each vector. */ | |
| UINT4 vectorLength; /**< The length \a n of each vector. */ | | INT4 *data; /**< Pointer to the data array. Element \a i of vector \a | |
| INT4 *data; /**< Pointer to the data array. Element \a i of vector \a j | | j is \c data[ \a jn + \a i \c ]. */ | |
| is \c data[ \a jn + \a i \c ]. */ | | } INT4VectorSequence; | |
| } | | | |
| INT4VectorSequence; | | | |
| | | | |
| /** Sequence of UINT4 Vectors, see \ref ss_VectorSequence for more details.
*/ | | /** Sequence of UINT4 Vectors, see \ref ss_VectorSequence for more details.
*/ | |
|
| typedef struct | | typedef struct tagUINT4VectorSequence { | |
| tagUINT4VectorSequence | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_2D(UINT4VectorSequence, UINT4, data, UINT4, length, vecto | |
| #ifdef SWIG /* SWIG interface directives */ | | rLength)); | |
| SWIGLAL(2D_ARRAY(UINT4, data, UINT4, length, vectorLength)); | | #endif /* SWIG */ | |
| #endif /* SWIG */ | | UINT4 length; /**< The number \a l of vectors. */ | |
| UINT4 length; /**< The number \a l of vectors. */ | | UINT4 vectorLength; /**< The length \a n of each vector. */ | |
| UINT4 vectorLength; /**< The length \a n of each vector. */ | | UINT4 *data; /**< Pointer to the data array. Element \a i of vector \a | |
| UINT4 *data; /**< Pointer to the data array. Element \a i of vector \a j | | j is \c data[ \a jn + \a i \c ]. */ | |
| is \c data[ \a jn + \a i \c ]. */ | | } UINT4VectorSequence; | |
| } | | | |
| UINT4VectorSequence; | | | |
| | | | |
| /** Sequence of INT8 Vectors, see \ref ss_VectorSequence for more details.
*/ | | /** Sequence of INT8 Vectors, see \ref ss_VectorSequence for more details.
*/ | |
|
| typedef struct | | typedef struct tagINT8VectorSequence { | |
| tagINT8VectorSequence | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_2D(INT8VectorSequence, INT8, data, UINT4, length, vectorL | |
| #ifdef SWIG /* SWIG interface directives */ | | ength)); | |
| SWIGLAL(2D_ARRAY(INT8, data, UINT4, length, vectorLength)); | | #endif /* SWIG */ | |
| #endif /* SWIG */ | | UINT4 length; /**< The number \a l of vectors. */ | |
| UINT4 length; /**< The number \a l of vectors. */ | | UINT4 vectorLength; /**< The length \a n of each vector. */ | |
| UINT4 vectorLength; /**< The length \a n of each vector. */ | | INT8 *data; /**< Pointer to the data array. Element \a i of vector \a | |
| INT8 *data; /**< Pointer to the data array. Element \a i of vector \a j | | j is \c data[ \a jn + \a i \c ]. */ | |
| is \c data[ \a jn + \a i \c ]. */ | | } INT8VectorSequence; | |
| } | | | |
| INT8VectorSequence; | | | |
| | | | |
| /** Sequence of UINT8 Vectors, see \ref ss_VectorSequence for more details.
*/ | | /** Sequence of UINT8 Vectors, see \ref ss_VectorSequence for more details.
*/ | |
|
| typedef struct | | typedef struct tagUINT8VectorSequence { | |
| tagUINT8VectorSequence | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_2D(UINT8VectorSequence, UINT8, data, UINT4, length, vecto | |
| #ifdef SWIG /* SWIG interface directives */ | | rLength)); | |
| SWIGLAL(2D_ARRAY(UINT8, data, UINT4, length, vectorLength)); | | #endif /* SWIG */ | |
| #endif /* SWIG */ | | UINT4 length; /**< The number \a l of vectors. */ | |
| UINT4 length; /**< The number \a l of vectors. */ | | UINT4 vectorLength; /**< The length \a n of each vector. */ | |
| UINT4 vectorLength; /**< The length \a n of each vector. */ | | UINT8 *data; /**< Pointer to the data array. Element \a i of vector \a | |
| UINT8 *data; /**< Pointer to the data array. Element \a i of vector \a j | | j is \c data[ \a jn + \a i \c ]. */ | |
| is \c data[ \a jn + \a i \c ]. */ | | } UINT8VectorSequence; | |
| } | | | |
| UINT8VectorSequence; | | | |
| | | | |
| /** Sequence of REAL4 Vectors, see \ref ss_VectorSequence for more details.
*/ | | /** Sequence of REAL4 Vectors, see \ref ss_VectorSequence for more details.
*/ | |
|
| typedef struct | | typedef struct tagREAL4VectorSequence { | |
| tagREAL4VectorSequence | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_2D(REAL4VectorSequence, REAL4, data, UINT4, length, vecto | |
| #ifdef SWIG /* SWIG interface directives */ | | rLength)); | |
| SWIGLAL(2D_ARRAY(REAL4, data, UINT4, length, vectorLength)); | | #endif /* SWIG */ | |
| #endif /* SWIG */ | | UINT4 length; /**< The number \a l of vectors. */ | |
| UINT4 length; /**< The number \a l of vectors. */ | | UINT4 vectorLength; /**< The length \a n of each vector. */ | |
| UINT4 vectorLength; /**< The length \a n of each vector. */ | | REAL4 *data; /**< Pointer to the data array. Element \a i of vector \a | |
| REAL4 *data; /**< Pointer to the data array. Element \a i of vector \a j | | j is \c data[ \a jn + \a i \c ]. */ | |
| is \c data[ \a jn + \a i \c ]. */ | | } REAL4VectorSequence; | |
| } | | | |
| REAL4VectorSequence; | | | |
| | | | |
| /** Sequence of REAL8 Vectors, see \ref ss_VectorSequence for more details.
*/ | | /** Sequence of REAL8 Vectors, see \ref ss_VectorSequence for more details.
*/ | |
|
| typedef struct | | typedef struct tagREAL8VectorSequence { | |
| tagREAL8VectorSequence | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_2D(REAL8VectorSequence, REAL8, data, UINT4, length, vecto | |
| #ifdef SWIG /* SWIG interface directives */ | | rLength)); | |
| SWIGLAL(2D_ARRAY(REAL8, data, UINT4, length, vectorLength)); | | #endif /* SWIG */ | |
| #endif /* SWIG */ | | UINT4 length; /**< The number \a l of vectors. */ | |
| UINT4 length; /**< The number \a l of vectors. */ | | UINT4 vectorLength; /**< The length \a n of each vector. */ | |
| UINT4 vectorLength; /**< The length \a n of each vector. */ | | REAL8 *data; /**< Pointer to the data array. Element \a i of vector \a | |
| REAL8 *data; /**< Pointer to the data array. Element \a i of vector \a j | | j is \c data[ \a jn + \a i \c ]. */ | |
| is \c data[ \a jn + \a i \c ]. */ | | } REAL8VectorSequence; | |
| } | | | |
| REAL8VectorSequence; | | | |
| | | | |
| /** Sequence of COMPLEX8 Vectors, see \ref ss_VectorSequence for more detai
ls. */ | | /** Sequence of COMPLEX8 Vectors, see \ref ss_VectorSequence for more detai
ls. */ | |
|
| typedef struct | | typedef struct tagCOMPLEX8VectorSequence { | |
| tagCOMPLEX8VectorSequence | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_2D(COMPLEX8VectorSequence, COMPLEX8, data, UINT4, length, | |
| #ifdef SWIG /* SWIG interface directives */ | | vectorLength)); | |
| SWIGLAL(2D_ARRAY(COMPLEX8, data, UINT4, length, vectorLength)); | | #endif /* SWIG */ | |
| #endif /* SWIG */ | | UINT4 length; /**< The number \a l of vectors. */ | |
| UINT4 length; /**< The number \a l of vectors. */ | | UINT4 vectorLength; /**< The length \a n of each vector. */ | |
| UINT4 vectorLength; /**< The length \a n of each vector. */ | | COMPLEX8 *data; /**< Pointer to the data array. Element \a i of vector | |
| COMPLEX8 *data; /**< Pointer to the data array. Element \a i of vector \ | | \a j is \c data[ \a jn + \a i \c ]. */ | |
| a j is \c data[ \a jn + \a i \c ]. */ | | } COMPLEX8VectorSequence; | |
| } | | | |
| COMPLEX8VectorSequence; | | | |
| | | | |
| /** Sequence of COMPLEX16 Vectors, see \ref ss_VectorSequence for more deta
ils. */ | | /** Sequence of COMPLEX16 Vectors, see \ref ss_VectorSequence for more deta
ils. */ | |
|
| typedef struct | | typedef struct tagCOMPLEX16VectorSequence { | |
| tagCOMPLEX16VectorSequence | | #ifdef SWIG /* SWIG interface directives */ | |
| { | | SWIGLAL(ARRAY_2D(COMPLEX16VectorSequence, COMPLEX16, data, UINT4, lengt | |
| #ifdef SWIG /* SWIG interface directives */ | | h, vectorLength)); | |
| SWIGLAL(2D_ARRAY(COMPLEX16, data, UINT4, length, vectorLength)); | | #endif /* SWIG */ | |
| #endif /* SWIG */ | | UINT4 length; /**< The number \a l of vectors. */ | |
| UINT4 length; /**< The number \a l of vectors. */ | | UINT4 vectorLength; /**< The length \a n of each vector. */ | |
| UINT4 vectorLength; /**< The length \a n of each vector. */ | | COMPLEX16 *data; /**< Pointer to the data array. Element \a i of vecto | |
| COMPLEX16 *data; /**< Pointer to the data array. Element \a i of vector | | r \a j is \c data[ \a jn + \a i \c ]. */ | |
| \a j is \c data[ \a jn + \a i \c ]. */ | | } COMPLEX16VectorSequence; | |
| } | | | |
| COMPLEX16VectorSequence; | | | |
| | | | |
|
| /* ---------- ArraySequence types ---------- */ | | /* ---------- ArraySequence types ---------- */ | |
| | | | |
| /** Sequence of INT2 multidimensional arrays, see \ref ss_ArraySequence for
more details. */ | | /** Sequence of INT2 multidimensional arrays, see \ref ss_ArraySequence for
more details. */ | |
|
| typedef struct | | typedef struct tagINT2ArraySequence { | |
| tagINT2ArraySequence | | UINT4 length; /**< The number \a l of vectors. */ | |
| { | | UINT4 arrayDim; /**< The number of data \a N in each array element | |
| UINT4 length; /**< The number \a l of vectors. */ | | (this is not the number \a m of indices). */ | |
| UINT4 arrayDim; /**< The number of data \a N in each array element | | UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing | |
| (this is not the number \a m of indices). */ | | the array dimensions */ | |
| UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing t | | INT2 *data; /**< Pointer to the data array. */ | |
| he array dimensions */ | | } INT2ArraySequence; | |
| INT2 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| INT2ArraySequence; | | | |
| | | | |
| /** Sequence of UINT2 multidimensional arrays, see \ref ss_ArraySequence fo
r more details. */ | | /** Sequence of UINT2 multidimensional arrays, see \ref ss_ArraySequence fo
r more details. */ | |
|
| typedef struct | | typedef struct tagUINT2ArraySequence { | |
| tagUINT2ArraySequence | | UINT4 length; /**< The number \a l of vectors. */ | |
| { | | UINT4 arrayDim; /**< The number of data \a N in each array element | |
| UINT4 length; /**< The number \a l of vectors. */ | | (this is not the number \a m of indices). */ | |
| UINT4 arrayDim; /**< The number of data \a N in each array element | | UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing | |
| (this is not the number \a m of indices). */ | | the array dimensions */ | |
| UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing t | | UINT2 *data; /**< Pointer to the data array. */ | |
| he array dimensions */ | | } UINT2ArraySequence; | |
| UINT2 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| UINT2ArraySequence; | | | |
| | | | |
| /** Sequence of INT4 multidimensional arrays, see \ref ss_ArraySequence for
more details. */ | | /** Sequence of INT4 multidimensional arrays, see \ref ss_ArraySequence for
more details. */ | |
|
| typedef struct | | typedef struct tagINT4ArraySequence { | |
| tagINT4ArraySequence | | UINT4 length; /**< The number \a l of vectors. */ | |
| { | | UINT4 arrayDim; /**< The number of data \a N in each array element | |
| UINT4 length; /**< The number \a l of vectors. */ | | (this is not the number \a m of indices). */ | |
| UINT4 arrayDim; /**< The number of data \a N in each array element | | UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing | |
| (this is not the number \a m of indices). */ | | the array dimensions */ | |
| UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing t | | INT4 *data; /**< Pointer to the data array. */ | |
| he array dimensions */ | | } INT4ArraySequence; | |
| INT4 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| INT4ArraySequence; | | | |
| | | | |
| /** Sequence of UINT4 multidimensional arrays, see \ref ss_ArraySequence fo
r more details. */ | | /** Sequence of UINT4 multidimensional arrays, see \ref ss_ArraySequence fo
r more details. */ | |
|
| typedef struct | | typedef struct tagUINT4ArraySequence { | |
| tagUINT4ArraySequence | | UINT4 length; /**< The number \a l of vectors. */ | |
| { | | UINT4 arrayDim; /**< The number of data \a N in each array element | |
| UINT4 length; /**< The number \a l of vectors. */ | | (this is not the number \a m of indices). */ | |
| UINT4 arrayDim; /**< The number of data \a N in each array element | | UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing | |
| (this is not the number \a m of indices). */ | | the array dimensions */ | |
| UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing t | | UINT4 *data; /**< Pointer to the data array. */ | |
| he array dimensions */ | | } UINT4ArraySequence; | |
| UINT4 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| UINT4ArraySequence; | | | |
| | | | |
| /** Sequence of INT8 multidimensional arrays, see \ref ss_ArraySequence for
more details. */ | | /** Sequence of INT8 multidimensional arrays, see \ref ss_ArraySequence for
more details. */ | |
|
| typedef struct | | typedef struct tagINT8ArraySequence { | |
| tagINT8ArraySequence | | UINT4 length; /**< The number \a l of vectors. */ | |
| { | | UINT4 arrayDim; /**< The number of data \a N in each array element | |
| UINT4 length; /**< The number \a l of vectors. */ | | (this is not the number \a m of indices). */ | |
| UINT4 arrayDim; /**< The number of data \a N in each array element | | UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing | |
| (this is not the number \a m of indices). */ | | the array dimensions */ | |
| UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing t | | INT8 *data; /**< Pointer to the data array. */ | |
| he array dimensions */ | | } INT8ArraySequence; | |
| INT8 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| INT8ArraySequence; | | | |
| | | | |
| /** Sequence of UINT8 multidimensional arrays, see \ref ss_ArraySequence fo
r more details. */ | | /** Sequence of UINT8 multidimensional arrays, see \ref ss_ArraySequence fo
r more details. */ | |
|
| typedef struct | | typedef struct tagUINT8ArraySequence { | |
| tagUINT8ArraySequence | | UINT4 length; /**< The number \a l of vectors. */ | |
| { | | UINT4 arrayDim; /**< The number of data \a N in each array element | |
| UINT4 length; /**< The number \a l of vectors. */ | | (this is not the number \a m of indices). */ | |
| UINT4 arrayDim; /**< The number of data \a N in each array element | | UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing | |
| (this is not the number \a m of indices). */ | | the array dimensions */ | |
| UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing t | | UINT8 *data; /**< Pointer to the data array. */ | |
| he array dimensions */ | | } UINT8ArraySequence; | |
| UINT8 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| UINT8ArraySequence; | | | |
| | | | |
| /** Sequence of REAL4 multidimensional arrays, see \ref ss_ArraySequence fo
r more details. */ | | /** Sequence of REAL4 multidimensional arrays, see \ref ss_ArraySequence fo
r more details. */ | |
|
| typedef struct | | typedef struct tagREAL4ArraySequence { | |
| tagREAL4ArraySequence | | UINT4 length; /**< The number \a l of vectors. */ | |
| { | | UINT4 arrayDim; /**< The number of data \a N in each array element | |
| UINT4 length; /**< The number \a l of vectors. */ | | (this is not the number \a m of indices). */ | |
| UINT4 arrayDim; /**< The number of data \a N in each array element | | UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing | |
| (this is not the number \a m of indices). */ | | the array dimensions */ | |
| UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing t | | REAL4 *data; /**< Pointer to the data array. */ | |
| he array dimensions */ | | } REAL4ArraySequence; | |
| REAL4 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| REAL4ArraySequence; | | | |
| | | | |
| /** Sequence of REAL8 multidimensional arrays, see \ref ss_ArraySequence fo
r more details. */ | | /** Sequence of REAL8 multidimensional arrays, see \ref ss_ArraySequence fo
r more details. */ | |
|
| typedef struct | | typedef struct tagREAL8ArraySequence { | |
| tagREAL8ArraySequence | | UINT4 length; /**< The number \a l of vectors. */ | |
| { | | UINT4 arrayDim; /**< The number of data \a N in each array element | |
| UINT4 length; /**< The number \a l of vectors. */ | | (this is not the number \a m of indices). */ | |
| UINT4 arrayDim; /**< The number of data \a N in each array element | | UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing | |
| (this is not the number \a m of indices). */ | | the array dimensions */ | |
| UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing t | | REAL8 *data; /**< Pointer to the data array. */ | |
| he array dimensions */ | | } REAL8ArraySequence; | |
| REAL8 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| REAL8ArraySequence; | | | |
| | | | |
| /** Sequence of COMPLEX8 multidimensional arrays, see \ref ss_ArraySequence
for more details. */ | | /** Sequence of COMPLEX8 multidimensional arrays, see \ref ss_ArraySequence
for more details. */ | |
|
| typedef struct | | typedef struct tagCOMPLEX8ArraySequence { | |
| tagCOMPLEX8ArraySequence | | UINT4 length; /**< The number \a l of vectors. */ | |
| { | | UINT4 arrayDim; /**< The number of data \a N in each array element | |
| UINT4 length; /**< The number \a l of vectors. */ | | (this is not the number \a m of indices). */ | |
| UINT4 arrayDim; /**< The number of data \a N in each array element | | UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing | |
| (this is not the number \a m of indices). */ | | the array dimensions */ | |
| UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing t | | COMPLEX8 *data; /**< Pointer to the data array. */ | |
| he array dimensions */ | | } COMPLEX8ArraySequence; | |
| COMPLEX8 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| COMPLEX8ArraySequence; | | | |
| | | | |
| /** Sequence of COMPLEX16 multidimensional arrays, see \ref ss_ArraySequenc
e for more details. */ | | /** Sequence of COMPLEX16 multidimensional arrays, see \ref ss_ArraySequenc
e for more details. */ | |
|
| typedef struct | | typedef struct tagCOMPLEX16ArraySequence { | |
| tagCOMPLEX16ArraySequence | | UINT4 length; /**< The number \a l of vectors. */ | |
| { | | UINT4 arrayDim; /**< The number of data \a N in each array element | |
| UINT4 length; /**< The number \a l of vectors. */ | | (this is not the number \a m of indices). */ | |
| UINT4 arrayDim; /**< The number of data \a N in each array element | | UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing | |
| (this is not the number \a m of indices). */ | | the array dimensions */ | |
| UINT4Vector *dimLength; /**< Pointer to a vector of length \a m storing t | | COMPLEX16 *data; /**< Pointer to the data array. */ | |
| he array dimensions */ | | } COMPLEX16ArraySequence; | |
| COMPLEX16 *data; /**< Pointer to the data array. */ | | | |
| } | | | |
| COMPLEX16ArraySequence; | | | |
| | | | |
|
| /* ---------- Structured datatypes ---------- */ | | /* ---------- Structured datatypes ---------- */ | |
| | | | |
| /** Epoch relative to GPS epoch, see \ref ss_LIGOTimeGPS for more details *
/ | | /** Epoch relative to GPS epoch, see \ref ss_LIGOTimeGPS for more details *
/ | |
|
| typedef struct | | typedef struct tagLIGOTimeGPS { | |
| tagLIGOTimeGPS | | INT4 gpsSeconds; /**< Seconds since 0h UTC 6 Jan 1980. */ | |
| { | | INT4 gpsNanoSeconds; /**< Residual nanoseconds. */ | |
| INT4 gpsSeconds; /**< Seconds since 0h UTC 6 Jan 1980. */ | | } LIGOTimeGPS; | |
| INT4 gpsNanoSeconds; /**< Residual nanoseconds. */ | | | |
| } | | | |
| LIGOTimeGPS; | | | |
| | | | |
| /** Zero-initializer for LIGOTimeGPS structs */ | | /** Zero-initializer for LIGOTimeGPS structs */ | |
| #define LIGOTIMEGPSZERO { 0, 0 } | | #define LIGOTIMEGPSZERO { 0, 0 } | |
| | | | |
|
| | | #ifdef SWIG /* SWIG interface directives */ | |
| | | /* *INDENT-OFF* */ | |
| | | %include <lal/lalswig_ligotimegps.i> | |
| | | /* *INDENT-ON* */ | |
| | | #endif /* SWIG */ | |
| | | | |
| /** Indices of arrays corresponding to particular units. | | /** Indices of arrays corresponding to particular units. | |
| * | | * | |
| * The ::LALUnit structure has arrays giving the numerators | | * The ::LALUnit structure has arrays giving the numerators | |
| * and denominators-minus-one of the powers of various units. | | * and denominators-minus-one of the powers of various units. | |
| * These are the indices for the particular units. | | * These are the indices for the particular units. | |
| */ | | */ | |
|
| enum | | enum { | |
| { | | LALUnitIndexMeter, /**< The meter index. */ | |
| LALUnitIndexMeter, /**< The meter index. */ | | LALUnitIndexKiloGram, /**< The kilogram index. */ | |
| LALUnitIndexKiloGram, /**< The kilogram index. */ | | LALUnitIndexSecond, /**< The second index. */ | |
| LALUnitIndexSecond, /**< The second index. */ | | LALUnitIndexAmpere, /**< The ampere index. */ | |
| LALUnitIndexAmpere, /**< The ampere index. */ | | LALUnitIndexKelvin, /**< The kelvin index. */ | |
| LALUnitIndexKelvin, /**< The kelvin index. */ | | LALUnitIndexStrain, /**< The strain index. */ | |
| LALUnitIndexStrain, /**< The strain index. */ | | LALUnitIndexADCCount, /**< The ADC counts index. */ | |
| LALUnitIndexADCCount, /**< The ADC counts index. */ | | LALNumUnits /**< The number of units. */ | |
| LALNumUnits /**< The number of units. */ | | | |
| }; | | }; | |
| | | | |
| /** This structure stores units in the mksA system (plus Kelvin, Strain, | | /** This structure stores units in the mksA system (plus Kelvin, Strain, | |
| * and ADC Count). It also stores an overall power-of-ten scaling factor. | | * and ADC Count). It also stores an overall power-of-ten scaling factor. | |
| * Thus, the units are given by | | * Thus, the units are given by | |
| * \f{equation}{ | | * \f{equation}{ | |
| * 10^p\times\textrm{m}^{N_0/(1+D_0)}\times\textrm{kg}^{N_1/(1+D_1)} | | * 10^p\times\textrm{m}^{N_0/(1+D_0)}\times\textrm{kg}^{N_1/(1+D_1)} | |
| * \times\textrm{s}^{N_2/(1+D_2)}\times\textrm{A}^{N_3/(1+D_3)} | | * \times\textrm{s}^{N_2/(1+D_2)}\times\textrm{A}^{N_3/(1+D_3)} | |
| * \times\textrm{K}^{N_4/(1+D_4)}\times\textrm{strain}^{N_5/(1+D_5)} | | * \times\textrm{K}^{N_4/(1+D_4)}\times\textrm{strain}^{N_5/(1+D_5)} | |
| * \times\textrm{count}^{N_6/(1+D_6)} | | * \times\textrm{count}^{N_6/(1+D_6)} | |
| * \f} | | * \f} | |
| * | | * | |
| */ | | */ | |
|
| typedef struct | | typedef struct tagLALUnit { | |
| tagLALUnit | | INT2 powerOfTen; /**< Overall power-of-ten scaling is 10^\c powerOfTen. | |
| { | | */ | |
| INT2 powerOfTen; /**< Overall power-of-ten scaling is 10^\c powerOfTen. | | INT2 unitNumerator[LALNumUnits]; /**< Array of unit power numerators. * | |
| */ | | / | |
| INT2 unitNumerator[LALNumUnits]; /**< Array of unit power numerators. */ | | UINT2 unitDenominatorMinusOne[LALNumUnits]; /**< Array of unit power de | |
| UINT2 unitDenominatorMinusOne[LALNumUnits]; /**< Array of unit power deno | | nominators-minus-one. */ | |
| minators-minus-one. */ | | } LALUnit; | |
| } | | | |
| LALUnit; | | | |
| | | | |
|
| /* ---------- TimeSeries types ---------- */ | | /* ---------- TimeSeries types ---------- */ | |
| | | | |
| /** Length of name fields of LAL structured data types. */ | | /** Length of name fields of LAL structured data types. */ | |
| enum enumLALNameLength { LALNameLength = 64 }; | | enum enumLALNameLength { LALNameLength = 64 }; | |
| | | | |
| /** Time series of INT2 data, see \ref ss_TimeSeries for more details. */ | | /** Time series of INT2 data, see \ref ss_TimeSeries for more details. */ | |
|
| typedef struct | | typedef struct tagINT2TimeSeries { | |
| tagINT2TimeSeries | | CHAR name[LALNameLength]; /**< The name of the time series. */ | |
| { | | LIGOTimeGPS epoch; /**< The start time of the time series. */ | |
| CHAR name[LALNameLength]; /**< The name of the time series. */ | | REAL8 deltaT; /**< The time step between samples of the time seri | |
| LIGOTimeGPS epoch; /**< The start time of the time series. */ | | es in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of the time seri | | REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if not | |
| es in seconds. */ | | heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if not | | LALUnit sampleUnits; /**< The physical units of the quantity being | |
| heterodyned). */ | | sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity being | | INT2Sequence *data; /**< The sequence of sampled data. */ | |
| sampled. */ | | } INT2TimeSeries; | |
| INT2Sequence *data; /**< The sequence of sampled data. */ | | | |
| } | | | |
| INT2TimeSeries; | | | |
| | | | |
| /** Time series of UINT2 data, see \ref ss_TimeSeries for more details. */ | | /** Time series of UINT2 data, see \ref ss_TimeSeries for more details. */ | |
|
| typedef struct | | typedef struct tagUINT2TimeSeries { | |
| tagUINT2TimeSeries | | CHAR name[LALNameLength]; /**< The name of the time series. */ | |
| { | | LIGOTimeGPS epoch; /**< The start time of the time series. */ | |
| CHAR name[LALNameLength]; /**< The name of the time series. */ | | REAL8 deltaT; /**< The time step between samples of the time ser | |
| LIGOTimeGPS epoch; /**< The start time of the time series. */ | | ies in seconds. */ REAL8 f0; /**< The heterodyning frequency, in Her | |
| REAL8 deltaT; /**< The time step between samples of the time ser | | tz (zero if not heterodyned). */ | |
| ies in seconds. */ | | LALUnit sampleUnits; /**< The physical units of the quantity being | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if not | | sampled. */ | |
| heterodyned). */ | | UINT2Sequence *data; /**< The sequence of sampled data. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity being | | } UINT2TimeSeries; | |
| sampled. */ | | | |
| UINT2Sequence *data; /**< The sequence of sampled data. */ | | | |
| } | | | |
| UINT2TimeSeries; | | | |
| | | | |
| /** Time series of INT4 data, see \ref ss_TimeSeries for more details. */ | | /** Time series of INT4 data, see \ref ss_TimeSeries for more details. */ | |
|
| typedef struct | | typedef struct tagINT4TimeSeries { | |
| tagINT4TimeSeries | | CHAR name[LALNameLength]; /**< The name of the time series. */ | |
| { | | LIGOTimeGPS epoch; /**< The start time of the time series. */ | |
| CHAR name[LALNameLength]; /**< The name of the time series. */ | | REAL8 deltaT; /**< The time step between samples of the time seri | |
| LIGOTimeGPS epoch; /**< The start time of the time series. */ | | es in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of the time seri | | REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if not | |
| es in seconds. */ | | heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if not | | LALUnit sampleUnits; /**< The physical units of the quantity being | |
| heterodyned). */ | | sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity being | | INT4Sequence *data; /**< The sequence of sampled data. */ | |
| sampled. */ | | } INT4TimeSeries; | |
| INT4Sequence *data; /**< The sequence of sampled data. */ | | | |
| } | | | |
| INT4TimeSeries; | | | |
| | | | |
| /** Time series of UINT4 data, see \ref ss_TimeSeries for more details. */ | | /** Time series of UINT4 data, see \ref ss_TimeSeries for more details. */ | |
|
| typedef struct | | typedef struct tagUINT4TimeSeries { | |
| tagUINT4TimeSeries | | CHAR name[LALNameLength]; /**< The name of the time series. */ | |
| { | | LIGOTimeGPS epoch; /**< The start time of the time series. */ | |
| CHAR name[LALNameLength]; /**< The name of the time series. */ | | REAL8 deltaT; /**< The time step between samples of the time ser | |
| LIGOTimeGPS epoch; /**< The start time of the time series. */ | | ies in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of the time ser | | REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if not | |
| ies in seconds. */ | | heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if not | | LALUnit sampleUnits; /**< The physical units of the quantity being | |
| heterodyned). */ | | sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity being | | UINT4Sequence *data; /**< The sequence of sampled data. */ | |
| sampled. */ | | } UINT4TimeSeries; | |
| UINT4Sequence *data; /**< The sequence of sampled data. */ | | | |
| } | | | |
| UINT4TimeSeries; | | | |
| | | | |
| /** Time series of INT8 data, see \ref ss_TimeSeries for more details. */ | | /** Time series of INT8 data, see \ref ss_TimeSeries for more details. */ | |
|
| typedef struct | | typedef struct tagINT8TimeSeries { | |
| tagINT8TimeSeries | | CHAR name[LALNameLength]; /**< The name of the time series. */ | |
| { | | LIGOTimeGPS epoch; /**< The start time of the time series. */ | |
| CHAR name[LALNameLength]; /**< The name of the time series. */ | | REAL8 deltaT; /**< The time step between samples of the time seri | |
| LIGOTimeGPS epoch; /**< The start time of the time series. */ | | es in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of the time seri | | REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if not | |
| es in seconds. */ | | heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if not | | LALUnit sampleUnits; /**< The physical units of the quantity being | |
| heterodyned). */ | | sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity being | | INT8Sequence *data; /**< The sequence of sampled data. */ | |
| sampled. */ | | } INT8TimeSeries; | |
| INT8Sequence *data; /**< The sequence of sampled data. */ | | | |
| } | | | |
| INT8TimeSeries; | | | |
| | | | |
| /** Time series of UINT8 data, see \ref ss_TimeSeries for more details. */ | | /** Time series of UINT8 data, see \ref ss_TimeSeries for more details. */ | |
|
| typedef struct | | typedef struct tagUINT8TimeSeries { | |
| tagUINT8TimeSeries | | CHAR name[LALNameLength]; /**< The name of the time series. */ | |
| { | | LIGOTimeGPS epoch; /**< The start time of the time series. */ | |
| CHAR name[LALNameLength]; /**< The name of the time series. */ | | REAL8 deltaT; /**< The time step between samples of the time ser | |
| LIGOTimeGPS epoch; /**< The start time of the time series. */ | | ies in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of the time ser | | REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if not | |
| ies in seconds. */ | | heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if not | | LALUnit sampleUnits; /**< The physical units of the quantity being | |
| heterodyned). */ | | sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity being | | UINT8Sequence *data; /**< The sequence of sampled data. */ | |
| sampled. */ | | } UINT8TimeSeries; | |
| UINT8Sequence *data; /**< The sequence of sampled data. */ | | | |
| } | | | |
| UINT8TimeSeries; | | | |
| | | | |
| /** Time series of REAL4 data, see \ref ss_TimeSeries for more details. */ | | /** Time series of REAL4 data, see \ref ss_TimeSeries for more details. */ | |
|
| typedef struct | | typedef struct tagREAL4TimeSeries { | |
| tagREAL4TimeSeries | | CHAR name[LALNameLength]; /**< The name of the time series. */ | |
| { | | LIGOTimeGPS epoch; /**< The start time of the time series. */ | |
| CHAR name[LALNameLength]; /**< The name of the time series. */ | | REAL8 deltaT; /**< The time step between samples of the time ser | |
| LIGOTimeGPS epoch; /**< The start time of the time series. */ | | ies in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of the time ser | | REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if not | |
| ies in seconds. */ | | heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if not | | LALUnit sampleUnits; /**< The physical units of the quantity being | |
| heterodyned). */ | | sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity being | | REAL4Sequence *data; /**< The sequence of sampled data. */ | |
| sampled. */ | | } REAL4TimeSeries; | |
| REAL4Sequence *data; /**< The sequence of sampled data. */ | | | |
| } | | | |
| REAL4TimeSeries; | | | |
| | | | |
| /** Time series of REAL8 data, see \ref ss_TimeSeries for more details. */ | | /** Time series of REAL8 data, see \ref ss_TimeSeries for more details. */ | |
|
| typedef struct | | typedef struct tagREAL8TimeSeries { | |
| tagREAL8TimeSeries | | CHAR name[LALNameLength]; /**< The name of the time series. */ | |
| { | | LIGOTimeGPS epoch; /**< The start time of the time series. */ | |
| CHAR name[LALNameLength]; /**< The name of the time series. */ | | REAL8 deltaT; /**< The time step between samples of the time ser | |
| LIGOTimeGPS epoch; /**< The start time of the time series. */ | | ies in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of the time ser | | REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if not | |
| ies in seconds. */ | | heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if not | | LALUnit sampleUnits; /**< The physical units of the quantity being | |
| heterodyned). */ | | sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity being | | REAL8Sequence *data; /**< The sequence of sampled data. */ | |
| sampled. */ | | } REAL8TimeSeries; | |
| REAL8Sequence *data; /**< The sequence of sampled data. */ | | | |
| } | | | |
| REAL8TimeSeries; | | | |
| | | | |
| /** Time series of COMPLEX8 data, see \ref ss_TimeSeries for more details.
*/ | | /** Time series of COMPLEX8 data, see \ref ss_TimeSeries for more details.
*/ | |
|
| typedef struct | | typedef struct tagCOMPLEX8TimeSeries { | |
| tagCOMPLEX8TimeSeries | | CHAR name[LALNameLength]; /**< The name of the time series. | |
| { | | */ | |
| CHAR name[LALNameLength]; /**< The name of the time series. | | LIGOTimeGPS epoch; /**< The start time of the time series. */ | |
| */ | | REAL8 deltaT; /**< The time step between samples of the time | |
| LIGOTimeGPS epoch; /**< The start time of the time series. */ | | series in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of the time | | REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if | |
| series in seconds. */ | | not heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if | | LALUnit sampleUnits; /**< The physical units of the quantity be | |
| not heterodyned). */ | | ing sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity be | | COMPLEX8Sequence *data; /**< The sequence of sampled data. */ | |
| ing sampled. */ | | } COMPLEX8TimeSeries; | |
| COMPLEX8Sequence *data; /**< The sequence of sampled data. */ | | | |
| } | | | |
| COMPLEX8TimeSeries; | | | |
| | | | |
| /** Time series of COMPLEX16 data, see \ref ss_TimeSeries for more details.
*/ | | /** Time series of COMPLEX16 data, see \ref ss_TimeSeries for more details.
*/ | |
|
| typedef struct | | typedef struct tagCOMPLEX16TimeSeries { | |
| tagCOMPLEX16TimeSeries | | CHAR name[LALNameLength]; /**< The name of the time series. | |
| { | | */ | |
| CHAR name[LALNameLength]; /**< The name of the time series. | | LIGOTimeGPS epoch; /**< The start time of the time series. */ | |
| */ | | REAL8 deltaT; /**< The time step between samples of the time | |
| LIGOTimeGPS epoch; /**< The start time of the time series. */ | | series in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of the time | | REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if | |
| series in seconds. */ | | not heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero if | | LALUnit sampleUnits; /**< The physical units of the quantity b | |
| not heterodyned). */ | | eing sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity b | | COMPLEX16Sequence *data; /**< The sequence of sampled data. */ | |
| eing sampled. */ | | } COMPLEX16TimeSeries; | |
| COMPLEX16Sequence *data; /**< The sequence of sampled data. */ | | | |
| } | | | |
| COMPLEX16TimeSeries; | | | |
| | | | |
|
| /* ---------- TimeVectorSeries types ---------- */ | | /* ---------- TimeVectorSeries types ---------- */ | |
| | | | |
| /** Time series of INT2 vectors, see \ref ss_TimeVectorSeries for more deta
ils. */ | | /** Time series of INT2 vectors, see \ref ss_TimeVectorSeries for more deta
ils. */ | |
|
| typedef struct | | typedef struct tagINT2TimeVectorSeries { | |
| tagINT2TimeVectorSeries | | CHAR name[LALNameLength]; /**< The name of the time serie | |
| { | | s of vectors. */ | |
| CHAR name[LALNameLength]; /**< The name of the time serie | | LIGOTimeGPS epoch; /**< The start time of the time series of vec | |
| s of vectors. */ | | tors. */ | |
| LIGOTimeGPS epoch; /**< The start time of the time series of vec | | REAL8 deltaT; /**< The time step between samples of the ti | |
| tors. */ | | me series of vectors in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of the ti | | REAL8 f0; /**< The heterodyning frequency, in Hertz (zero | |
| me series of vectors in seconds. */ | | if not heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero | | LALUnit sampleUnits; /**< The physical units of the quantity | |
| if not heterodyned). */ | | being sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity | | INT2VectorSequence *data; /**< The sequence of sampled data vectors. */ | |
| being sampled. */ | | } INT2TimeVectorSeries; | |
| INT2VectorSequence *data; /**< The sequence of sampled data vectors. */ | | | |
| } | | | |
| INT2TimeVectorSeries; | | | |
| | | | |
| /** Time series of UINT2 vectors, see \ref ss_TimeVectorSeries for more det
ails. */ | | /** Time series of UINT2 vectors, see \ref ss_TimeVectorSeries for more det
ails. */ | |
|
| typedef struct | | typedef struct tagUINT2TimeVectorSeries { | |
| tagUINT2TimeVectorSeries | | CHAR name[LALNameLength]; /**< The name of the time serie | |
| { | | s of vectors. */ | |
| CHAR name[LALNameLength]; /**< The name of the time serie | | LIGOTimeGPS epoch; /**< The start time of the time series of vec | |
| s of vectors. */ | | tors. */ | |
| LIGOTimeGPS epoch; /**< The start time of the time series of vec | | REAL8 deltaT; /**< The time step between samples of the ti | |
| tors. */ | | me series of vectors in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of the ti | | REAL8 f0; /**< The heterodyning frequency, in Hertz (zero | |
| me series of vectors in seconds. */ | | if not heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero | | LALUnit sampleUnits; /**< The physical units of the quantity | |
| if not heterodyned). */ | | being sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity | | UINT2VectorSequence *data; /**< The sequence of sampled data vectors. * | |
| being sampled. */ | | / | |
| UINT2VectorSequence *data; /**< The sequence of sampled data vectors. */ | | } UINT2TimeVectorSeries; | |
| } | | | |
| UINT2TimeVectorSeries; | | | |
| | | | |
| /** Time series of INT4 vectors, see \ref ss_TimeVectorSeries for more deta
ils. */ | | /** Time series of INT4 vectors, see \ref ss_TimeVectorSeries for more deta
ils. */ | |
|
| typedef struct | | typedef struct tagINT4TimeVectorSeries { | |
| tagINT4TimeVectorSeries | | CHAR name[LALNameLength]; /**< The name of the time serie | |
| { | | s of vectors. */ | |
| CHAR name[LALNameLength]; /**< The name of the time serie | | LIGOTimeGPS epoch; /**< The start time of the time series of vec | |
| s of vectors. */ | | tors. */ | |
| LIGOTimeGPS epoch; /**< The start time of the time series of vec | | REAL8 deltaT; /**< The time step between samples of the ti | |
| tors. */ | | me series of vectors in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of the ti | | REAL8 f0; /**< The heterodyning frequency, in Hertz (zero | |
| me series of vectors in seconds. */ | | if not heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero | | LALUnit sampleUnits; /**< The physical units of the quantity | |
| if not heterodyned). */ | | being sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity | | INT4VectorSequence *data; /**< The sequence of sampled data vectors. */ | |
| being sampled. */ | | } INT4TimeVectorSeries; | |
| INT4VectorSequence *data; /**< The sequence of sampled data vectors. */ | | | |
| } | | | |
| INT4TimeVectorSeries; | | | |
| | | | |
| /** Time series of UINT4 vectors, see \ref ss_TimeVectorSeries for more det
ails. */ | | /** Time series of UINT4 vectors, see \ref ss_TimeVectorSeries for more det
ails. */ | |
|
| typedef struct | | typedef struct tagUINT4TimeVectorSeries { | |
| tagUINT4TimeVectorSeries | | CHAR name[LALNameLength]; /**< The name of the time serie | |
| { | | s of vectors. */ | |
| CHAR name[LALNameLength]; /**< The name of the time serie | | LIGOTimeGPS epoch; /**< The start time of the time series of vec | |
| s of vectors. */ | | tors. */ | |
| LIGOTimeGPS epoch; /**< The start time of the time series of vec | | REAL8 deltaT; /**< The time step between samples of the ti | |
| tors. */ | | me series of vectors in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of the ti | | REAL8 f0; /**< The heterodyning frequency, in Hertz (zero | |
| me series of vectors in seconds. */ | | if not heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero | | LALUnit sampleUnits; /**< The physical units of the quantity | |
| if not heterodyned). */ | | being sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity | | UINT4VectorSequence *data; /**< The sequence of sampled data vectors. * | |
| being sampled. */ | | / | |
| UINT4VectorSequence *data; /**< The sequence of sampled data vectors. */ | | } UINT4TimeVectorSeries; | |
| } | | | |
| UINT4TimeVectorSeries; | | | |
| | | | |
| /** Time series of INT8 vectors, see \ref ss_TimeVectorSeries for more deta
ils. */ | | /** Time series of INT8 vectors, see \ref ss_TimeVectorSeries for more deta
ils. */ | |
|
| typedef struct | | typedef struct tagINT8TimeVectorSeries { | |
| tagINT8TimeVectorSeries | | CHAR name[LALNameLength]; /**< The name of the time serie | |
| { | | s of vectors. */ | |
| CHAR name[LALNameLength]; /**< The name of the time serie | | LIGOTimeGPS epoch; /**< The start time of the time series of vec | |
| s of vectors. */ | | tors. */ | |
| LIGOTimeGPS epoch; /**< The start time of the time series of vec | | REAL8 deltaT; /**< The time step between samples of the ti | |
| tors. */ | | me series of vectors in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of the ti | | REAL8 f0; /**< The heterodyning frequency, in Hertz (zero | |
| me series of vectors in seconds. */ | | if not heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero | | LALUnit sampleUnits; /**< The physical units of the quantity | |
| if not heterodyned). */ | | being sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity | | INT8VectorSequence *data; /**< The sequence of sampled data vectors. */ | |
| being sampled. */ | | } INT8TimeVectorSeries; | |
| INT8VectorSequence *data; /**< The sequence of sampled data vectors. */ | | | |
| } | | | |
| INT8TimeVectorSeries; | | | |
| | | | |
| /** Time series of UINT8 vectors, see \ref ss_TimeVectorSeries for more det
ails. */ | | /** Time series of UINT8 vectors, see \ref ss_TimeVectorSeries for more det
ails. */ | |
|
| typedef struct | | typedef struct tagUINT8TimeVectorSeries { | |
| tagUINT8TimeVectorSeries | | CHAR name[LALNameLength]; /**< The name of the time serie | |
| { | | s of vectors. */ | |
| CHAR name[LALNameLength]; /**< The name of the time serie | | LIGOTimeGPS epoch; /**< The start time of the time series of vec | |
| s of vectors. */ | | tors. */ | |
| LIGOTimeGPS epoch; /**< The start time of the time series of vec | | REAL8 deltaT; /**< The time step between samples of the ti | |
| tors. */ | | me series of vectors in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of the ti | | REAL8 f0; /**< The heterodyning frequency, in Hertz (zero | |
| me series of vectors in seconds. */ | | if not heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero | | LALUnit sampleUnits; /**< The physical units of the quantity | |
| if not heterodyned). */ | | being sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity | | UINT8VectorSequence *data; /**< The sequence of sampled data vectors. * | |
| being sampled. */ | | / | |
| UINT8VectorSequence *data; /**< The sequence of sampled data vectors. */ | | } UINT8TimeVectorSeries; | |
| } | | | |
| UINT8TimeVectorSeries; | | | |
| | | | |
| /** Time series of REAL4 vectors, see \ref ss_TimeVectorSeries for more det
ails. */ | | /** Time series of REAL4 vectors, see \ref ss_TimeVectorSeries for more det
ails. */ | |
|
| typedef struct | | typedef struct tagREAL4TimeVectorSeries { | |
| tagREAL4TimeVectorSeries | | CHAR name[LALNameLength]; /**< The name of the time serie | |
| { | | s of vectors. */ | |
| CHAR name[LALNameLength]; /**< The name of the time serie | | LIGOTimeGPS epoch; /**< The start time of the time series of vec | |
| s of vectors. */ | | tors. */ | |
| LIGOTimeGPS epoch; /**< The start time of the time series of vec | | REAL8 deltaT; /**< The time step between samples of the ti | |
| tors. */ | | me series of vectors in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of the ti | | REAL8 f0; /**< The heterodyning frequency, in Hertz (zero | |
| me series of vectors in seconds. */ | | if not heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero | | LALUnit sampleUnits; /**< The physical units of the quantity | |
| if not heterodyned). */ | | being sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity | | REAL4VectorSequence *data; /**< The sequence of sampled data vectors. * | |
| being sampled. */ | | / | |
| REAL4VectorSequence *data; /**< The sequence of sampled data vectors. */ | | } REAL4TimeVectorSeries; | |
| } | | | |
| REAL4TimeVectorSeries; | | | |
| | | | |
| /** Time series of REAL8 vectors, see \ref ss_TimeVectorSeries for more det
ails. */ | | /** Time series of REAL8 vectors, see \ref ss_TimeVectorSeries for more det
ails. */ | |
|
| typedef struct | | typedef struct tagREAL8TimeVectorSeries { | |
| tagREAL8TimeVectorSeries | | CHAR name[LALNameLength]; /**< The name of the time serie | |
| { | | s of vectors. */ | |
| CHAR name[LALNameLength]; /**< The name of the time serie | | LIGOTimeGPS epoch; /**< The start time of the time series of vec | |
| s of vectors. */ | | tors. */ | |
| LIGOTimeGPS epoch; /**< The start time of the time series of vec | | REAL8 deltaT; /**< The time step between samples of the ti | |
| tors. */ | | me series of vectors in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of the ti | | REAL8 f0; /**< The heterodyning frequency, in Hertz (zero | |
| me series of vectors in seconds. */ | | if not heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (zero | | LALUnit sampleUnits; /**< The physical units of the quantity | |
| if not heterodyned). */ | | being sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quantity | | REAL8VectorSequence *data; /**< The sequence of sampled data vectors. * | |
| being sampled. */ | | / | |
| REAL8VectorSequence *data; /**< The sequence of sampled data vectors. */ | | } REAL8TimeVectorSeries; | |
| } | | | |
| REAL8TimeVectorSeries; | | | |
| | | | |
| /** Time series of COMPLEX8 vectors, see \ref ss_TimeVectorSeries for more
details. */ | | /** Time series of COMPLEX8 vectors, see \ref ss_TimeVectorSeries for more
details. */ | |
|
| typedef struct | | typedef struct tagCOMPLEX8TimeVectorSeries { | |
| tagCOMPLEX8TimeVectorSeries | | CHAR name[LALNameLength]; /**< The name of the time s | |
| { | | eries of vectors. */ | |
| CHAR name[LALNameLength]; /**< The name of the time s | | LIGOTimeGPS epoch; /**< The start time of the time series of | |
| eries of vectors. */ | | vectors. */ | |
| LIGOTimeGPS epoch; /**< The start time of the time series of | | REAL8 deltaT; /**< The time step between samples of th | |
| vectors. */ | | e time series of vectors in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of th | | REAL8 f0; /**< The heterodyning frequency, in Hertz (z | |
| e time series of vectors in seconds. */ | | ero if not heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz (z | | LALUnit sampleUnits; /**< The physical units of the quan | |
| ero if not heterodyned). */ | | tity being sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the quan | | COMPLEX8VectorSequence *data; /**< The sequence of sampled data vectors | |
| tity being sampled. */ | | . */ | |
| COMPLEX8VectorSequence *data; /**< The sequence of sampled data vectors. | | } COMPLEX8TimeVectorSeries; | |
| */ | | | |
| } | | | |
| COMPLEX8TimeVectorSeries; | | | |
| | | | |
| /** Time series of COMPLEX16 vectors, see \ref ss_TimeVectorSeries for more
details. */ | | /** Time series of COMPLEX16 vectors, see \ref ss_TimeVectorSeries for more
details. */ | |
|
| typedef struct | | typedef struct tagCOMPLEX16TimeVectorSeries { | |
| tagCOMPLEX16TimeVectorSeries | | CHAR name[LALNameLength]; /**< The name of the time | |
| { | | series of vectors. */ | |
| CHAR name[LALNameLength]; /**< The name of the time | | LIGOTimeGPS epoch; /**< The start time of the time series o | |
| series of vectors. */ | | f vectors. */ | |
| LIGOTimeGPS epoch; /**< The start time of the time series o | | REAL8 deltaT; /**< The time step between samples of t | |
| f vectors. */ | | he time series of vectors in seconds. */ | |
| REAL8 deltaT; /**< The time step between samples of t | | REAL8 f0; /**< The heterodyning frequency, in Hertz ( | |
| he time series of vectors in seconds. */ | | zero if not heterodyned). */ | |
| REAL8 f0; /**< The heterodyning frequency, in Hertz ( | | LALUnit sampleUnits; /**< The physical units of the qua | |
| zero if not heterodyned). */ | | ntity being sampled. */ | |
| LALUnit sampleUnits; /**< The physical units of the qua | | COMPLEX16VectorSequence *data; /**< The sequence of sampled data vector | |
| ntity being sampled. */ | | s. */ | |
| COMPLEX16VectorSequence *data; /**< The sequence of sampled data vectors | | } COMPLEX16TimeVectorSeries; | |
| . */ | | | |
| } | | | |
| COMPLEX16TimeVectorSeries; | | | |
| | | | |
| /* ---------- TimeArraySeries ---------- */ | | /* ---------- TimeArraySeries ---------- */ | |
| | | | |
| /** See \ref ss_TimeArraySeries for documentation */ | | /** See \ref ss_TimeArraySeries for documentation */ | |
|
| typedef struct | | typedef struct tagINT2TimeArraySeries { | |
| tagINT2TimeArraySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 deltaT; | |
| LIGOTimeGPS epoch; | | REAL8 f0; | |
| REAL8 deltaT; | | LALUnit sampleUnits; | |
| REAL8 f0; | | INT2ArraySequence *data; | |
| LALUnit sampleUnits; | | } INT2TimeArraySeries; | |
| INT2ArraySequence *data; | | | |
| } | | | |
| INT2TimeArraySeries; | | | |
| | | | |
| /** See \ref ss_TimeArraySeries for documentation */ | | /** See \ref ss_TimeArraySeries for documentation */ | |
|
| typedef struct | | typedef struct tagUINT2TimeArraySeries { | |
| tagUINT2TimeArraySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 deltaT; | |
| LIGOTimeGPS epoch; | | REAL8 f0; | |
| REAL8 deltaT; | | LALUnit sampleUnits; | |
| REAL8 f0; | | UINT2ArraySequence *data; | |
| LALUnit sampleUnits; | | } UINT2TimeArraySeries; | |
| UINT2ArraySequence *data; | | | |
| } | | | |
| UINT2TimeArraySeries; | | | |
| | | | |
| /** See \ref ss_TimeArraySeries for documentation */ | | /** See \ref ss_TimeArraySeries for documentation */ | |
|
| typedef struct | | typedef struct tagINT4TimeArraySeries { | |
| tagINT4TimeArraySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 deltaT; | |
| LIGOTimeGPS epoch; | | REAL8 f0; | |
| REAL8 deltaT; | | LALUnit sampleUnits; | |
| REAL8 f0; | | INT4ArraySequence *data; | |
| LALUnit sampleUnits; | | } INT4TimeArraySeries; | |
| INT4ArraySequence *data; | | | |
| } | | | |
| INT4TimeArraySeries; | | | |
| | | | |
| /** See \ref ss_TimeArraySeries for documentation */ | | /** See \ref ss_TimeArraySeries for documentation */ | |
|
| typedef struct | | typedef struct tagUINT4TimeArraySeries { | |
| tagUINT4TimeArraySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 deltaT; | |
| LIGOTimeGPS epoch; | | REAL8 f0; | |
| REAL8 deltaT; | | LALUnit sampleUnits; | |
| REAL8 f0; | | UINT4ArraySequence *data; | |
| LALUnit sampleUnits; | | } UINT4TimeArraySeries; | |
| UINT4ArraySequence *data; | | | |
| } | | | |
| UINT4TimeArraySeries; | | | |
| | | | |
| /** See \ref ss_TimeArraySeries for documentation */ | | /** See \ref ss_TimeArraySeries for documentation */ | |
|
| typedef struct | | typedef struct tagINT8TimeArraySeries { | |
| tagINT8TimeArraySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 deltaT; | |
| LIGOTimeGPS epoch; | | REAL8 f0; | |
| REAL8 deltaT; | | LALUnit sampleUnits; | |
| REAL8 f0; | | INT8ArraySequence *data; | |
| LALUnit sampleUnits; | | } INT8TimeArraySeries; | |
| INT8ArraySequence *data; | | | |
| } | | | |
| INT8TimeArraySeries; | | | |
| | | | |
| /** See \ref ss_TimeArraySeries for documentation */ | | /** See \ref ss_TimeArraySeries for documentation */ | |
|
| typedef struct | | typedef struct tagUINT8TimeArraySeries { | |
| tagUINT8TimeArraySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 deltaT; | |
| LIGOTimeGPS epoch; | | REAL8 f0; | |
| REAL8 deltaT; | | LALUnit sampleUnits; | |
| REAL8 f0; | | UINT8ArraySequence *data; | |
| LALUnit sampleUnits; | | } UINT8TimeArraySeries; | |
| UINT8ArraySequence *data; | | | |
| } | | | |
| UINT8TimeArraySeries; | | | |
| | | | |
| /** See \ref ss_TimeArraySeries for documentation */ | | /** See \ref ss_TimeArraySeries for documentation */ | |
|
| typedef struct | | typedef struct tagREAL4TimeArraySeries { | |
| tagREAL4TimeArraySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 deltaT; | |
| LIGOTimeGPS epoch; | | REAL8 f0; | |
| REAL8 deltaT; | | LALUnit sampleUnits; | |
| REAL8 f0; | | REAL4ArraySequence *data; | |
| LALUnit sampleUnits; | | } REAL4TimeArraySeries; | |
| REAL4ArraySequence *data; | | | |
| } | | | |
| REAL4TimeArraySeries; | | | |
| | | | |
| /** See \ref ss_TimeArraySeries for documentation */ | | /** See \ref ss_TimeArraySeries for documentation */ | |
|
| typedef struct | | typedef struct tagREAL8TimeArraySeries { | |
| tagREAL8TimeArraySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 deltaT; | |
| LIGOTimeGPS epoch; | | REAL8 f0; | |
| REAL8 deltaT; | | LALUnit sampleUnits; | |
| REAL8 f0; | | REAL8ArraySequence *data; | |
| LALUnit sampleUnits; | | } REAL8TimeArraySeries; | |
| REAL8ArraySequence *data; | | | |
| } | | | |
| REAL8TimeArraySeries; | | | |
| | | | |
| /** See \ref ss_TimeArraySeries for documentation */ | | /** See \ref ss_TimeArraySeries for documentation */ | |
|
| typedef struct | | typedef struct tagCOMPLEX8TimeArraySeries { | |
| tagCOMPLEX8TimeArraySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 deltaT; | |
| LIGOTimeGPS epoch; | | REAL8 f0; | |
| REAL8 deltaT; | | LALUnit sampleUnits; | |
| REAL8 f0; | | COMPLEX8ArraySequence *data; | |
| LALUnit sampleUnits; | | } COMPLEX8TimeArraySeries; | |
| COMPLEX8ArraySequence *data; | | | |
| } | | | |
| COMPLEX8TimeArraySeries; | | | |
| | | | |
| /** See \ref ss_TimeArraySeries for documentation */ | | /** See \ref ss_TimeArraySeries for documentation */ | |
|
| typedef struct | | typedef struct tagCOMPLEX16TimeArraySeries { | |
| tagCOMPLEX16TimeArraySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 deltaT; | |
| LIGOTimeGPS epoch; | | REAL8 f0; | |
| REAL8 deltaT; | | LALUnit sampleUnits; | |
| REAL8 f0; | | COMPLEX16ArraySequence *data; | |
| LALUnit sampleUnits; | | } COMPLEX16TimeArraySeries; | |
| COMPLEX16ArraySequence *data; | | | |
| } | | | |
| COMPLEX16TimeArraySeries; | | | |
| | | | |
| /* ---------- FrequencySeries types ---------- */ | | /* ---------- FrequencySeries types ---------- */ | |
| | | | |
| /** See \ref ss_FrequencySeries for documentation */ | | /** See \ref ss_FrequencySeries for documentation */ | |
|
| typedef struct | | typedef struct tagINT2FrequencySeries { | |
| tagINT2FrequencySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 f0; | |
| LIGOTimeGPS epoch; | | REAL8 deltaF; | |
| REAL8 f0; | | LALUnit sampleUnits; | |
| REAL8 deltaF; | | INT2Sequence *data; | |
| LALUnit sampleUnits; | | } INT2FrequencySeries; | |
| INT2Sequence *data; | | | |
| } | | | |
| INT2FrequencySeries; | | | |
| | | | |
| /** See \ref ss_FrequencySeries for documentation */ | | /** See \ref ss_FrequencySeries for documentation */ | |
|
| typedef struct | | typedef struct tagUINT2FrequencySeries { | |
| tagUINT2FrequencySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 f0; | |
| LIGOTimeGPS epoch; | | REAL8 deltaF; | |
| REAL8 f0; | | LALUnit sampleUnits; | |
| REAL8 deltaF; | | UINT2Sequence *data; | |
| LALUnit sampleUnits; | | } UINT2FrequencySeries; | |
| UINT2Sequence *data; | | | |
| } | | | |
| UINT2FrequencySeries; | | | |
| | | | |
| /** See \ref ss_FrequencySeries for documentation */ | | /** See \ref ss_FrequencySeries for documentation */ | |
|
| typedef struct | | typedef struct tagINT4FrequencySeries { | |
| tagINT4FrequencySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 f0; | |
| LIGOTimeGPS epoch; | | REAL8 deltaF; | |
| REAL8 f0; | | LALUnit sampleUnits; | |
| REAL8 deltaF; | | INT4Sequence *data; | |
| LALUnit sampleUnits; | | } INT4FrequencySeries; | |
| INT4Sequence *data; | | | |
| } | | | |
| INT4FrequencySeries; | | | |
| | | | |
| /** See \ref ss_FrequencySeries for documentation */ | | /** See \ref ss_FrequencySeries for documentation */ | |
|
| typedef struct | | typedef struct tagUINT4FrequencySeries { | |
| tagUINT4FrequencySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 f0; | |
| LIGOTimeGPS epoch; | | REAL8 deltaF; | |
| REAL8 f0; | | LALUnit sampleUnits; | |
| REAL8 deltaF; | | UINT4Sequence *data; | |
| LALUnit sampleUnits; | | } UINT4FrequencySeries; | |
| UINT4Sequence *data; | | | |
| } | | | |
| UINT4FrequencySeries; | | | |
| | | | |
| /** See \ref ss_FrequencySeries for documentation */ | | /** See \ref ss_FrequencySeries for documentation */ | |
|
| typedef struct | | typedef struct tagINT8FrequencySeries { | |
| tagINT8FrequencySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 f0; | |
| LIGOTimeGPS epoch; | | REAL8 deltaF; | |
| REAL8 f0; | | LALUnit sampleUnits; | |
| REAL8 deltaF; | | INT8Sequence *data; | |
| LALUnit sampleUnits; | | } INT8FrequencySeries; | |
| INT8Sequence *data; | | | |
| } | | | |
| INT8FrequencySeries; | | | |
| | | | |
| /** See \ref ss_FrequencySeries for documentation */ | | /** See \ref ss_FrequencySeries for documentation */ | |
|
| typedef struct | | typedef struct tagUINT8FrequencySeries { | |
| tagUINT8FrequencySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 f0; | |
| LIGOTimeGPS epoch; | | REAL8 deltaF; | |
| REAL8 f0; | | LALUnit sampleUnits; | |
| REAL8 deltaF; | | UINT8Sequence *data; | |
| LALUnit sampleUnits; | | } UINT8FrequencySeries; | |
| UINT8Sequence *data; | | | |
| } | | | |
| UINT8FrequencySeries; | | | |
| | | | |
| /** See \ref ss_FrequencySeries for documentation */ | | /** See \ref ss_FrequencySeries for documentation */ | |
|
| typedef struct | | typedef struct tagREAL4FrequencySeries { | |
| tagREAL4FrequencySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 f0; | |
| LIGOTimeGPS epoch; | | REAL8 deltaF; | |
| REAL8 f0; | | LALUnit sampleUnits; | |
| REAL8 deltaF; | | REAL4Sequence *data; | |
| LALUnit sampleUnits; | | } REAL4FrequencySeries; | |
| REAL4Sequence *data; | | | |
| } | | | |
| REAL4FrequencySeries; | | | |
| | | | |
| /** See \ref ss_FrequencySeries for documentation */ | | /** See \ref ss_FrequencySeries for documentation */ | |
|
| typedef struct | | typedef struct tagREAL8FrequencySeries { | |
| tagREAL8FrequencySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 f0; | |
| LIGOTimeGPS epoch; | | REAL8 deltaF; | |
| REAL8 f0; | | LALUnit sampleUnits; | |
| REAL8 deltaF; | | REAL8Sequence *data; | |
| LALUnit sampleUnits; | | } REAL8FrequencySeries; | |
| REAL8Sequence *data; | | | |
| } | | | |
| REAL8FrequencySeries; | | | |
| | | | |
| /** See \ref ss_FrequencySeries for documentation */ | | /** See \ref ss_FrequencySeries for documentation */ | |
|
| typedef struct | | typedef struct tagCOMPLEX8FrequencySeries { | |
| tagCOMPLEX8FrequencySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 f0; | |
| LIGOTimeGPS epoch; | | REAL8 deltaF; | |
| REAL8 f0; | | LALUnit sampleUnits; | |
| REAL8 deltaF; | | COMPLEX8Sequence *data; | |
| LALUnit sampleUnits; | | } COMPLEX8FrequencySeries; | |
| COMPLEX8Sequence *data; | | | |
| } | | | |
| COMPLEX8FrequencySeries; | | | |
| | | | |
| /** See \ref ss_FrequencySeries for documentation */ | | /** See \ref ss_FrequencySeries for documentation */ | |
|
| typedef struct | | typedef struct tagCOMPLEX16FrequencySeries { | |
| tagCOMPLEX16FrequencySeries | | CHAR name[LALNameLength]; | |
| { | | LIGOTimeGPS epoch; | |
| CHAR name[LALNameLength]; | | REAL8 f0; | |
| LIGOTimeGPS epoch; | | REAL8 deltaF; | |
| REAL8 f0; | | LALUnit sampleUnits; | |
| REAL8 deltaF; | | COMPLEX16Sequence *data; | |
| LALUnit sampleUnits; | | } COMPLEX16FrequencySeries; | |
| COMPLEX16Sequence *data; | | | |
| } | | | |
| COMPLEX16FrequencySeries; | | | |
| | | | |
| /* ---------- ZPGFilter types ---------- */ | | /* ---------- ZPGFilter types ---------- */ | |
| | | | |
| /** See \ref ss_ZPGFilter for details */ | | /** See \ref ss_ZPGFilter for details */ | |
|
| typedef struct | | typedef struct tagCOMPLEX8ZPGFilter { | |
| tagCOMPLEX8ZPGFilter | | CHAR name[LALNameLength]; | |
| { | | REAL8 deltaT; | |
| CHAR name[LALNameLength]; | | COMPLEX8Vector *zeros; | |
| REAL8 deltaT; | | COMPLEX8Vector *poles; | |
| COMPLEX8Vector *zeros; | | COMPLEX8 gain; | |
| COMPLEX8Vector *poles; | | } COMPLEX8ZPGFilter; | |
| COMPLEX8 gain; | | | |
| } | | | |
| COMPLEX8ZPGFilter; | | | |
| | | | |
| /** See \ref ss_ZPGFilter for details */ | | /** See \ref ss_ZPGFilter for details */ | |
|
| typedef struct | | typedef struct tagCOMPLEX16ZPGFilter { | |
| tagCOMPLEX16ZPGFilter | | CHAR name[LALNameLength]; | |
| { | | REAL8 deltaT; | |
| CHAR name[LALNameLength]; | | COMPLEX16Vector *zeros; | |
| REAL8 deltaT; | | COMPLEX16Vector *poles; | |
| COMPLEX16Vector *zeros; | | COMPLEX16 gain; | |
| COMPLEX16Vector *poles; | | } COMPLEX16ZPGFilter; | |
| COMPLEX16 gain; | | | |
| } | | | |
| COMPLEX16ZPGFilter; | | | |
| | | | |
|
| /*@}*/ // end of LALDatatypes documentation group | | /*@} */// end of LALDatatypes documentation group | |
| | | | |
|
| #ifndef SWIG /* exclude from SWIG interface */ | | #ifndef SWIG /* exclude from SWIG interface */ | |
| | | | |
| /** \ingroup LALStatusMacros_h | | /** \ingroup LALStatusMacros_h | |
| * \brief LAL status structure, see \ref ss_LALStatus for more details. | | * \brief LAL status structure, see \ref ss_LALStatus for more details. | |
| */ | | */ | |
|
| typedef struct | | typedef struct tagLALStatus { | |
| tagLALStatus | | INT4 statusCode; /**< A numerical code ident | |
| { | | ifying the type of error, or 0 for nominal status; Negative values are rese | |
| INT4 statusCode; /**< A numerical code identi | | rved for certain standard error types */ | |
| fying the type of error, or 0 for nominal status; Negative values are reser | | const CHAR *statusDescription; /**< An explanatory string | |
| ved for certain standard error types */ | | corresponding to the numerical status code */ | |
| const CHAR *statusDescription; /**< An explanatory string c | | volatile const CHAR *Id; /**< A character string ide | |
| orresponding to the numerical status code */ | | ntifying the source file and version number of the function being reported | |
| volatile const CHAR *Id; /**< A character string iden | | on */ | |
| tifying the source file and version number of the function being reported o | | const CHAR *function; /**< The name of the functi | |
| n */ | | on */ | |
| const CHAR *function; /**< The name of the functio | | const CHAR *file; /**< The name of the source | |
| n */ | | file containing the function code */ | |
| const CHAR *file; /**< The name of the source | | INT4 line; /**< The line number in the | |
| file containing the function code */ | | source file where the current \c statusCode was set */ | |
| INT4 line; /**< The line number in the | | struct tagLALStatus *statusPtr; /**< Pointer to the next no | |
| source file where the current \c statusCode was set */ | | de in the list; \c NULL if this function is not reporting a subroutine erro | |
| struct tagLALStatus *statusPtr; /**< Pointer to the next nod | | r */ | |
| e in the list; \c NULL if this function is not reporting a subroutine error | | INT4 level; /**< The nested-function le | |
| */ | | vel where any error was reported */ | |
| INT4 level; /**< The nested-function lev | | } LALStatus; | |
| el where any error was reported */ | | | |
| } | | | |
| LALStatus; | | | |
| #endif /* SWIG */ | | #endif /* SWIG */ | |
| | | | |
|
| #ifdef __cplusplus | | #if 0 | |
| | | { /* so that editors will match succeeding brace */ | |
| | | #elif defined(__cplusplus) | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif /* _LALDATATYPES_H */ | | #endif /* _LALDATATYPES_H */ | |
| | | | |
End of changes. 105 change blocks. |
| 1093 lines changed or deleted | | 856 lines changed or added | |
|
| XLALError.h | | XLALError.h | |
| | | | |
| skipping to change at line 30 | | skipping to change at line 30 | |
| #ifndef XLALERROR_H | | #ifndef XLALERROR_H | |
| #define XLALERROR_H | | #define XLALERROR_H | |
| | | | |
| #include <stdarg.h> | | #include <stdarg.h> | |
| #include <stddef.h> | | #include <stddef.h> | |
| #include <lal/LALAtomicDatatypes.h> | | #include <lal/LALAtomicDatatypes.h> | |
| | | | |
| #if defined(__cplusplus) | | #if defined(__cplusplus) | |
| extern "C" { | | extern "C" { | |
| #elif 0 | | #elif 0 | |
|
| } /* so that editors will match preceding brace */ | | } /* so that editors will match preceding brace */ | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * \addtogroup XLALError_h | | * \addtogroup XLALError_h | |
| * \author Creighton, J. D. E. | | * \author Creighton, J. D. E. | |
| * \date 2005 | | * \date 2005 | |
| * \brief This header covers routines to provide the XLAL interface error | | * \brief This header covers routines to provide the XLAL interface error | |
| * handling. | | * handling. | |
| * | | * | |
| * \heading{XLAL Errors} | | * \heading{XLAL Errors} | |
| | | | |
| skipping to change at line 158 | | skipping to change at line 158 | |
| | | | |
| /** Prints an error message if error printing is enabled by lalDebugLevel.
*/ | | /** Prints an error message if error printing is enabled by lalDebugLevel.
*/ | |
| int XLALPrintError(const char *fmt, ...); | | int XLALPrintError(const char *fmt, ...); | |
| | | | |
| /** Prints a warning message if warning printing is enabled by lalDebugLeve
l. */ | | /** Prints a warning message if warning printing is enabled by lalDebugLeve
l. */ | |
| int XLALPrintWarning(const char *fmt, ...); | | int XLALPrintWarning(const char *fmt, ...); | |
| | | | |
| /** Prints an info message if info printing is enabled by lalDebugLevel. */ | | /** Prints an info message if info printing is enabled by lalDebugLevel. */ | |
| int XLALPrintInfo(const char *fmt, ...); | | int XLALPrintInfo(const char *fmt, ...); | |
| | | | |
|
| #ifndef SWIG /* exclude from SWIG interface */ | | #ifndef SWIG /* exclude from SWIG interface */ | |
| | | | |
| /** Prints an error message if error printing is enabled by lalDebugLevel.
*/ | | /** Prints an error message if error printing is enabled by lalDebugLevel.
*/ | |
| int XLALVPrintError(const char *fmt, va_list ap); | | int XLALVPrintError(const char *fmt, va_list ap); | |
| | | | |
| /** Prints a warning message if warning printing is enabled by lalDebugLeve
l. */ | | /** Prints a warning message if warning printing is enabled by lalDebugLeve
l. */ | |
| int XLALVPrintWarning(const char *fmt, va_list ap); | | int XLALVPrintWarning(const char *fmt, va_list ap); | |
| | | | |
| /** Prints an info message if info printing is enabled by lalDebugLevel. */ | | /** Prints an info message if info printing is enabled by lalDebugLevel. */ | |
| int XLALVPrintInfo(const char *fmt, va_list ap); | | int XLALVPrintInfo(const char *fmt, va_list ap); | |
| | | | |
| #endif /* SWIG */ | | #endif /* SWIG */ | |
| | | | |
| /* | | /* | |
| * | | * | |
| * Miscelaneous routines to print information with standard formatting. | | * Miscelaneous routines to print information with standard formatting. | |
| * | | * | |
| */ | | */ | |
| | | | |
| /** Print an error message with standard XLAL formatting (if error messages | | /** Print an error message with standard XLAL formatting (if error messages | |
| * are enabled by lalDebugLevel). */ | | * are enabled by lalDebugLevel). */ | |
|
| void XLALPrintErrorMessage(const char *func, const char *file, int line, co | | void XLALPrintErrorMessage(const char *func, const char *file, int line, | |
| nst char *fmt, ...); | | const char *fmt, ...); | |
| | | | |
| /** Print an warning message with standard XLAL formatting (if warning mess
ages | | /** Print an warning message with standard XLAL formatting (if warning mess
ages | |
| * are enabled by lalDebugLevel). */ | | * are enabled by lalDebugLevel). */ | |
|
| void XLALPrintWarningMessage(const char *func, const char *file, int line, | | void XLALPrintWarningMessage(const char *func, const char *file, int line, | |
| const char *fmt, ...); | | const char *fmt, ...); | |
| | | | |
| /** Print an info message with standard XLAL formatting (if info messages | | /** Print an info message with standard XLAL formatting (if info messages | |
| * are enabled by lalDebugLevel). */ | | * are enabled by lalDebugLevel). */ | |
|
| void XLALPrintInfoMessage(const char *func, const char *file, int line, con | | void XLALPrintInfoMessage(const char *func, const char *file, int line, | |
| st char *fmt, ...); | | const char *fmt, ...); | |
| | | | |
|
| #ifndef SWIG /* exclude from SWIG interface */ | | #ifndef SWIG /* exclude from SWIG interface */ | |
| | | | |
| /** Print an error message with standard XLAL formatting (if error messages | | /** Print an error message with standard XLAL formatting (if error messages | |
| * are enabled by lalDebugLevel). */ | | * are enabled by lalDebugLevel). */ | |
|
| void XLALVPrintErrorMessage(const char *func, const char *file, int line, c | | void XLALVPrintErrorMessage(const char *func, const char *file, int line, | |
| onst char *fmt, va_list ap); | | const char *fmt, va_list ap); | |
| | | | |
| /** Print an warning message with standard XLAL formatting (if warning mess
ages | | /** Print an warning message with standard XLAL formatting (if warning mess
ages | |
| * are enabled by lalDebugLevel). */ | | * are enabled by lalDebugLevel). */ | |
|
| void XLALVPrintWarningMessage(const char *func, const char *file, int line, | | void XLALVPrintWarningMessage(const char *func, const char *file, int line, | |
| const char *fmt, va_list ap); | | const char *fmt, va_list ap); | |
| | | | |
| /** Print an error message with standard XLAL formatting (if error messages | | /** Print an error message with standard XLAL formatting (if error messages | |
| * are enabled by lalDebugLevel). */ | | * are enabled by lalDebugLevel). */ | |
|
| void XLALVPrintInfoMessage(const char *func, const char *file, int line, co | | void XLALVPrintInfoMessage(const char *func, const char *file, int line, | |
| nst char *fmt, va_list ap); | | const char *fmt, va_list ap); | |
| | | | |
| #endif /* SWIG */ | | #endif /* SWIG */ | |
| | | | |
| /** Prints a progress bar at the "info" verbosity level. */ | | /** Prints a progress bar at the "info" verbosity level. */ | |
| int XLALPrintProgressBar(double); | | int XLALPrintProgressBar(double); | |
| | | | |
| /** Prints a deprecation warning at the "warning" verbosity level. */ | | /** Prints a deprecation warning at the "warning" verbosity level. */ | |
| int XLALPrintDeprecationWarning(const char *old, const char *replacement); | | int XLALPrintDeprecationWarning(const char *old, const char *replacement); | |
| | | | |
| /* | | /* | |
| | | | |
| skipping to change at line 297 | | skipping to change at line 303 | |
| | | | |
| /* | | /* | |
| * The floating point values themselves are returned by static functions th
at | | * The floating point values themselves are returned by static functions th
at | |
| * can be easily inlined by the compiler; similarly, the routines to test i
f a | | * can be easily inlined by the compiler; similarly, the routines to test i
f a | |
| * value is the LAL failure NaN can also be inlined. | | * value is the LAL failure NaN can also be inlined. | |
| */ | | */ | |
| | | | |
| /** Returns the value of the XLAL <tt>REAL4</tt> failure NaN. */ | | /** Returns the value of the XLAL <tt>REAL4</tt> failure NaN. */ | |
| static REAL4 UNUSED XLALREAL4FailNaN(void) | | static REAL4 UNUSED XLALREAL4FailNaN(void) | |
| { | | { | |
|
| volatile const union { INT4 i; REAL4 x; } val = { XLAL_REAL4_FAIL_NA | | volatile const union { | |
| N_INT } ; | | INT4 i; | |
| return val.x; | | REAL4 x; | |
| | | } val = { | |
| | | XLAL_REAL4_FAIL_NAN_INT}; | |
| | | return val.x; | |
| } | | } | |
| | | | |
| /** Returns the value of the XLAL <tt>REAL8</tt> failure NaN. */ | | /** Returns the value of the XLAL <tt>REAL8</tt> failure NaN. */ | |
| static REAL8 UNUSED XLALREAL8FailNaN(void) | | static REAL8 UNUSED XLALREAL8FailNaN(void) | |
| { | | { | |
|
| volatile const union { INT8 i; REAL8 x; } val = { XLAL_REAL8_FAIL_NA | | volatile const union { | |
| N_INT } ; | | INT8 i; | |
| return val.x; | | REAL8 x; | |
| | | } val = { | |
| | | XLAL_REAL8_FAIL_NAN_INT}; | |
| | | return val.x; | |
| } | | } | |
| | | | |
| /** Tests if a value is an XLAL <tt>REAL4</tt> failure NaN. */ | | /** Tests if a value is an XLAL <tt>REAL4</tt> failure NaN. */ | |
| static int UNUSED XLALIsREAL4FailNaN(REAL4 val) | | static int UNUSED XLALIsREAL4FailNaN(REAL4 val) | |
| { | | { | |
|
| volatile const union { INT4 i; unsigned char s[4]; } a = { XLAL_REAL | | volatile const union { | |
| 4_FAIL_NAN_INT } ; | | INT4 i; | |
| volatile union { REAL4 x; unsigned char s[4]; } b; | | unsigned char s[4]; | |
| size_t n; | | } a = { | |
| b.x = val; | | XLAL_REAL4_FAIL_NAN_INT}; | |
| for (n = 0; n < sizeof(val); ++n) | | volatile union { | |
| if (a.s[n] != b.s[n]) | | REAL4 x; | |
| return 0; | | unsigned char s[4]; | |
| return 1; | | } b; | |
| | | size_t n; | |
| | | b.x = val; | |
| | | for (n = 0; n < sizeof(val); ++n) | |
| | | if (a.s[n] != b.s[n]) | |
| | | return 0; | |
| | | return 1; | |
| } | | } | |
| | | | |
| /** Tests if a value is an XLAL <tt>REAL8</tt> failure NaN. */ | | /** Tests if a value is an XLAL <tt>REAL8</tt> failure NaN. */ | |
| static int UNUSED XLALIsREAL8FailNaN(REAL8 val) | | static int UNUSED XLALIsREAL8FailNaN(REAL8 val) | |
| { | | { | |
|
| volatile const union { INT8 i; unsigned char s[8]; } a = { XLAL_REAL | | volatile const union { | |
| 8_FAIL_NAN_INT } ; | | INT8 i; | |
| volatile union { REAL8 x; unsigned char s[8]; } b; | | unsigned char s[8]; | |
| size_t n; | | } a = { | |
| b.x = val; | | XLAL_REAL8_FAIL_NAN_INT}; | |
| for (n = 0; n < sizeof(val); ++n) | | volatile union { | |
| if (a.s[n] != b.s[n]) | | REAL8 x; | |
| return 0; | | unsigned char s[8]; | |
| return 1; | | } b; | |
| | | size_t n; | |
| | | b.x = val; | |
| | | for (n = 0; n < sizeof(val); ++n) | |
| | | if (a.s[n] != b.s[n]) | |
| | | return 0; | |
| | | return 1; | |
| } | | } | |
|
| | | | |
| #undef UNUSED | | #undef UNUSED | |
| | | | |
| /* Here are the macro constants for the fail NaNs. */ | | /* Here are the macro constants for the fail NaNs. */ | |
| #define XLAL_REAL4_FAIL_NAN ( XLALREAL4FailNaN() ) /**< Floating-point valu
e of the XLAL <tt>REAL4</tt> failure NaN. */ | | #define XLAL_REAL4_FAIL_NAN ( XLALREAL4FailNaN() ) /**< Floating-point valu
e of the XLAL <tt>REAL4</tt> failure NaN. */ | |
| #define XLAL_REAL8_FAIL_NAN ( XLALREAL8FailNaN() ) /**< Floating-point valu
e of the XLAL <tt>REAL8</tt> failure NaN. */ | | #define XLAL_REAL8_FAIL_NAN ( XLALREAL8FailNaN() ) /**< Floating-point valu
e of the XLAL <tt>REAL8</tt> failure NaN. */ | |
| | | | |
| /* Here are the macros to test for fail NaNs. */ | | /* Here are the macros to test for fail NaNs. */ | |
| #define XLAL_IS_REAL4_FAIL_NAN(val) XLALIsREAL4FailNaN(val) /**< Tests if <
tt>val</tt> is a XLAL <tt>REAL4</tt> failure NaN. */ | | #define XLAL_IS_REAL4_FAIL_NAN(val) XLALIsREAL4FailNaN(val) /**< Tests if <
tt>val</tt> is a XLAL <tt>REAL4</tt> failure NaN. */ | |
| #define XLAL_IS_REAL8_FAIL_NAN(val) XLALIsREAL8FailNaN(val) /**< Tests if <
tt>val</tt> is a XLAL <tt>REAL8</tt> failure NaN. */ | | #define XLAL_IS_REAL8_FAIL_NAN(val) XLALIsREAL8FailNaN(val) /**< Tests if <
tt>val</tt> is a XLAL <tt>REAL8</tt> failure NaN. */ | |
| | | | |
| /** XLAL error numbers and return values. */ | | /** XLAL error numbers and return values. */ | |
| enum XLALErrorValue { | | enum XLALErrorValue { | |
|
| XLAL_SUCCESS = 0, /**< Success return value (not an error number) * | | XLAL_SUCCESS = 0, /**< Success return value (not an error number) | |
| / | | */ | |
| XLAL_FAILURE = -1, /**< Failure return value (not an error number) * | | XLAL_FAILURE = -1, /**< Failure return value (not an error number) | |
| / | | */ | |
| | | | |
|
| /* these are standard error numbers */ | | /* these are standard error numbers */ | |
| XLAL_EIO = 5, /**< I/O error */ | | XLAL_EIO = 5, /**< I/O error */ | |
| XLAL_ENOMEM = 12, /**< Memory allocation error */ | | XLAL_ENOMEM = 12, /**< Memory allocation error */ | |
| XLAL_EFAULT = 14, /**< Invalid pointer */ | | XLAL_EFAULT = 14, /**< Invalid pointer */ | |
| XLAL_EINVAL = 22, /**< Invalid argument */ | | XLAL_EINVAL = 22, /**< Invalid argument */ | |
| XLAL_EDOM = 33, /**< Input domain error */ | | XLAL_EDOM = 33, /**< Input domain error */ | |
| XLAL_ERANGE = 34, /**< Output range error */ | | XLAL_ERANGE = 34, /**< Output range error */ | |
| | | | |
| /* extended error numbers start at 128 ... | | /* extended error numbers start at 128 ... | |
| * should be beyond normal errnos */ | | * should be beyond normal errnos */ | |
| | | | |
| /* these are common errors for XLAL functions */ | | /* these are common errors for XLAL functions */ | |
| XLAL_EFAILED = 128, /**< Generic failure */ | | XLAL_EFAILED = 128, /**< Generic failure */ | |
| XLAL_EBADLEN = 129, /**< Inconsistent or invalid length */ | | XLAL_EBADLEN = 129, /**< Inconsistent or invalid length */ | |
| XLAL_ESIZE = 130, /**< Wrong size */ | | XLAL_ESIZE = 130, /**< Wrong size */ | |
| XLAL_EDIMS = 131, /**< Wrong dimensions */ | | XLAL_EDIMS = 131, /**< Wrong dimensions */ | |
| XLAL_ETYPE = 132, /**< Wrong or unknown type */ | | XLAL_ETYPE = 132, /**< Wrong or unknown type */ | |
| XLAL_ETIME = 133, /**< Invalid time */ | | XLAL_ETIME = 133, /**< Invalid time */ | |
| XLAL_EFREQ = 134, /**< Invalid freqency */ | | XLAL_EFREQ = 134, /**< Invalid freqency */ | |
| XLAL_EUNIT = 135, /**< Invalid units */ | | XLAL_EUNIT = 135, /**< Invalid units */ | |
| XLAL_ENAME = 136, /**< Wrong name */ | | XLAL_ENAME = 136, /**< Wrong name */ | |
| XLAL_EDATA = 137, /**< Invalid data */ | | XLAL_EDATA = 137, /**< Invalid data */ | |
| | | | |
| /* user-defined errors */ | | /* user-defined errors */ | |
| XLAL_EUSR0 = 200, /**< User-defined error 0 */ | | XLAL_EUSR0 = 200, /**< User-defined error 0 */ | |
| XLAL_EUSR1 = 201, /**< User-defined error 1 */ | | XLAL_EUSR1 = 201, /**< User-defined error 1 */ | |
| XLAL_EUSR2 = 202, /**< User-defined error 2 */ | | XLAL_EUSR2 = 202, /**< User-defined error 2 */ | |
| XLAL_EUSR3 = 203, /**< User-defined error 3 */ | | XLAL_EUSR3 = 203, /**< User-defined error 3 */ | |
| XLAL_EUSR4 = 204, /**< User-defined error 4 */ | | XLAL_EUSR4 = 204, /**< User-defined error 4 */ | |
| XLAL_EUSR5 = 205, /**< User-defined error 5 */ | | XLAL_EUSR5 = 205, /**< User-defined error 5 */ | |
| XLAL_EUSR6 = 206, /**< User-defined error 6 */ | | XLAL_EUSR6 = 206, /**< User-defined error 6 */ | |
| XLAL_EUSR7 = 207, /**< User-defined error 7 */ | | XLAL_EUSR7 = 207, /**< User-defined error 7 */ | |
| XLAL_EUSR8 = 208, /**< User-defined error 8 */ | | XLAL_EUSR8 = 208, /**< User-defined error 8 */ | |
| XLAL_EUSR9 = 209, /**< User-defined error 9 */ | | XLAL_EUSR9 = 209, /**< User-defined error 9 */ | |
| | | | |
| /* external or internal errors */ | | /* external or internal errors */ | |
| XLAL_ESYS = 254, /**< System error */ | | XLAL_ESYS = 254, /**< System error */ | |
| XLAL_EERR = 255, /**< Internal error */ | | XLAL_EERR = 255, /**< Internal error */ | |
| | | | |
| /* specific mathematical and numerical errors start at 256 */ | | /* specific mathematical and numerical errors start at 256 */ | |
| | | | |
| /* IEEE floating point errors */ | | /* IEEE floating point errors */ | |
| XLAL_EFPINVAL = 256, /**< IEEE Invalid floating point operation, eg | | XLAL_EFPINVAL = 256, /**< IEEE Invalid floating point operation, e | |
| sqrt(-1), 0/0 */ | | g sqrt(-1), 0/0 */ | |
| XLAL_EFPDIV0 = 257, /**< IEEE Division by zero floating point erro | | XLAL_EFPDIV0 = 257, /**< IEEE Division by zero floating point err | |
| r */ | | or */ | |
| XLAL_EFPOVRFLW = 258, /**< IEEE Floating point overflow error */ | | XLAL_EFPOVRFLW = 258, /**< IEEE Floating point overflow error */ | |
| XLAL_EFPUNDFLW = 259, /**< IEEE Floating point underflow error */ | | XLAL_EFPUNDFLW = 259, /**< IEEE Floating point underflow error */ | |
| XLAL_EFPINEXCT = 260, /**< IEEE Floating point inexact error */ | | XLAL_EFPINEXCT = 260, /**< IEEE Floating point inexact error */ | |
| | | | |
| /* numerical algorithm errors */ | | /* numerical algorithm errors */ | |
| XLAL_EMAXITER = 261, /**< Exceeded maximum number of iterations */ | | XLAL_EMAXITER = 261, /**< Exceeded maximum number of iterations */ | |
| XLAL_EDIVERGE = 262, /**< Series is diverging */ | | XLAL_EDIVERGE = 262, /**< Series is diverging */ | |
| XLAL_ESING = 263, /**< Apparent singularity detected */ | | XLAL_ESING = 263, /**< Apparent singularity detected */ | |
| XLAL_ETOL = 264, /**< Failed to reach specified tolerance */ | | XLAL_ETOL = 264, /**< Failed to reach specified tolerance */ | |
| XLAL_ELOSS = 265, /**< Loss of accuracy */ | | XLAL_ELOSS = 265, /**< Loss of accuracy */ | |
| | | | |
|
| /* failure from within a function call: "or" error number with this | | /* failure from within a function call: "or" error number with this */ | |
| */ | | XLAL_EFUNC = 1024 /**< Internal function call failed bit: "or" | |
| XLAL_EFUNC = 1024 /**< Internal function call failed bit: "or" t | | this with existing error number */ | |
| his with existing error number */ | | | |
| }; | | }; | |
| | | | |
| /* | | /* | |
| * | | * | |
| * These functions provide message associated with an error code and print | | * These functions provide message associated with an error code and print | |
| * an error message associated with the error code. The macro XLAL_PERROR | | * an error message associated with the error code. The macro XLAL_PERROR | |
| * fills in the current file and line information and uses the current | | * fills in the current file and line information and uses the current | |
| * value of xlalErrno as the error number. | | * value of xlalErrno as the error number. | |
| * | | * | |
| */ | | */ | |
| | | | |
| /** Returns the error message associated with an error number. */ | | /** Returns the error message associated with an error number. */ | |
|
| const char * XLALErrorString(int errnum); | | const char *XLALErrorString(int errnum); | |
| | | | |
| /** Prints an error message for a particular error code in a standard forma
t. */ | | /** Prints an error message for a particular error code in a standard forma
t. */ | |
| void XLALPerror(const char *func, const char *file, int line, int errnum); | | void XLALPerror(const char *func, const char *file, int line, int errnum); | |
| | | | |
| /** Prints an error message for the current value of <tt>xlalErrno</tt>. */ | | /** Prints an error message for the current value of <tt>xlalErrno</tt>. */ | |
| #define XLAL_PERROR( ) XLALPerror(__func__, __FILE__, __LINE__, xlalErrno) | | #define XLAL_PERROR( ) XLALPerror(__func__, __FILE__, __LINE__, xlalErrno) | |
| | | | |
| /* | | /* | |
| * | | * | |
| * Here is the XLAL error handler type and the routines that set it. | | * Here is the XLAL error handler type and the routines that set it. | |
| * Also provide is the default error handler. | | * Also provide is the default error handler. | |
| * | | * | |
| */ | | */ | |
| | | | |
|
| #ifndef SWIG /* exclude from SWIG interface */ | | #ifndef SWIG /* exclude from SWIG interface */ | |
| | | | |
| /** The XLAL error handler type. */ | | /** The XLAL error handler type. */ | |
|
| typedef void XLALErrorHandlerType(const char *func, const char *file, int l | | typedef void XLALErrorHandlerType(const char *func, const char *file, | |
| ine, int errnum); | | int line, int errnum); | |
| | | | |
| /** The default XLAL error handler. */ | | /** The default XLAL error handler. */ | |
|
| void XLALDefaultErrorHandler(const char *func, const char *file, int line, | | void XLALDefaultErrorHandler(const char *func, const char *file, int line, | |
| int errnum); | | int errnum); | |
| /** A silent XLAL error handler. */ | | /** A silent XLAL error handler. */ | |
|
| void XLALSilentErrorHandler(const char *func, const char *file, int line, i | | void XLALSilentErrorHandler(const char *func, const char *file, int line, | |
| nt errnum); | | int errnum); | |
| | | | |
| /* Other useful XLAL error handlers. */ | | /* Other useful XLAL error handlers. */ | |
| /** The XLAL error handler that raises SIGABRT. */ | | /** The XLAL error handler that raises SIGABRT. */ | |
|
| void XLALAbortErrorHandler(const char *func, const char *file, int line, in | | void XLALAbortErrorHandler(const char *func, const char *file, int line, | |
| t errnum); | | int errnum); | |
| /** The XLAL error handler that calls exit. */ | | /** The XLAL error handler that calls exit. */ | |
|
| void XLALExitErrorHandler(const char *func, const char *file, int line, int | | void XLALExitErrorHandler(const char *func, const char *file, int line, | |
| errnum); | | int errnum); | |
| /** The XLAL error handler that prints a function call backtrace then raise
s SIGABRT. */ | | /** The XLAL error handler that prints a function call backtrace then raise
s SIGABRT. */ | |
|
| void XLALBacktraceErrorHandler(const char *func, const char *file, int line | | void XLALBacktraceErrorHandler(const char *func, const char *file, | |
| , int errnum); | | int line, int errnum); | |
| | | | |
| /** Function to return pointer to the XLAL error handler function pointer.
*/ | | /** Function to return pointer to the XLAL error handler function pointer.
*/ | |
|
| XLALErrorHandlerType ** XLALGetErrorHandlerPtr( void ); | | XLALErrorHandlerType **XLALGetErrorHandlerPtr(void); | |
| | | | |
| /** Sets the error handler to a new handler and returns the old handler. */ | | /** Sets the error handler to a new handler and returns the old handler. */ | |
|
| XLALErrorHandlerType * XLALSetErrorHandler(XLALErrorHandlerType *newHandler | | XLALErrorHandlerType *XLALSetErrorHandler(XLALErrorHandlerType * | |
| ); | | newHandler); | |
| | | | |
| /** Sets the error handler to the default handler and returns the old handl
er. */ | | /** Sets the error handler to the default handler and returns the old handl
er. */ | |
|
| XLALErrorHandlerType * XLALSetDefaultErrorHandler(void); | | XLALErrorHandlerType *XLALSetDefaultErrorHandler(void); | |
| /** Sets the error handler to a silent handler and returns the old handler.
*/ | | /** Sets the error handler to a silent handler and returns the old handler.
*/ | |
|
| XLALErrorHandlerType * XLALSetSilentErrorHandler(void); | | XLALErrorHandlerType *XLALSetSilentErrorHandler(void); | |
| | | | |
| #endif /* SWIG */ | | #endif /* SWIG */ | |
| | | | |
| /* | | /* | |
| * | | * | |
| * Here are the routines that set or clear the XLAL error number. | | * Here are the routines that set or clear the XLAL error number. | |
| * | | * | |
| */ | | */ | |
| | | | |
|
| #ifdef SWIG /* SWIG interface directives */ | | #ifdef SWIG /* SWIG interface directives */ | |
| SWIGLAL(DISABLE_EXCEPTIONS(XLALSetErrno, XLALGetBaseErrno, XLALClearErrno))
; | | SWIGLAL(DISABLE_EXCEPTIONS(XLALSetErrno, XLALGetBaseErrno, XLALClearErrno))
; | |
| #endif /* SWIG */ | | #endif /* SWIG */ | |
| | | | |
| /** Sets the XLAL error number to errnum, returns the new value. */ | | /** Sets the XLAL error number to errnum, returns the new value. */ | |
| int XLALSetErrno(int errnum); | | int XLALSetErrno(int errnum); | |
| | | | |
| /** Gets the XLAL base error number ignoring the internal-function-failed f
lag. */ | | /** Gets the XLAL base error number ignoring the internal-function-failed f
lag. */ | |
| int XLALGetBaseErrno(void); | | int XLALGetBaseErrno(void); | |
| | | | |
| /** Clears the XLAL error number, returns the old value. */ | | /** Clears the XLAL error number, returns the old value. */ | |
| | | | |
| skipping to change at line 494 | | skipping to change at line 530 | |
| * The LAL specifiation requires that the XLAL error number be a modifiable | | * The LAL specifiation requires that the XLAL error number be a modifiable | |
| * lvalue. Similarly, the function pointer to the XLAL error handler is | | * lvalue. Similarly, the function pointer to the XLAL error handler is | |
| * a modifiable lvalue. These are implemented as macros that dereference | | * a modifiable lvalue. These are implemented as macros that dereference | |
| * pointers to the current value (in the current thread). The pointer is | | * pointers to the current value (in the current thread). The pointer is | |
| * returned by the functions XLALGetErrnoPtr and XLALGetErrorHandlerPtr. | | * returned by the functions XLALGetErrnoPtr and XLALGetErrorHandlerPtr. | |
| * Here these functions and macros are defined. | | * Here these functions and macros are defined. | |
| * | | * | |
| */ | | */ | |
| | | | |
| /** Function to return pointer to the XLAL error number. */ | | /** Function to return pointer to the XLAL error number. */ | |
|
| int * XLALGetErrnoPtr(void); | | int *XLALGetErrnoPtr(void); | |
| | | | |
| /* these are the modifiable lvalues for xlalErrno and XLALErrorHandler */ | | /* these are the modifiable lvalues for xlalErrno and XLALErrorHandler */ | |
| #define xlalErrno ( * XLALGetErrnoPtr() ) /**< Modifiable lvalue containing
the XLAL error number */ | | #define xlalErrno ( * XLALGetErrnoPtr() ) /**< Modifiable lvalue containing
the XLAL error number */ | |
| #define XLALErrorHandler ( * XLALGetErrorHandlerPtr() ) /**< Modifiable lva
lue containing the XLAL error handler */ | | #define XLALErrorHandler ( * XLALGetErrorHandlerPtr() ) /**< Modifiable lva
lue containing the XLAL error handler */ | |
| | | | |
| /** | | /** | |
| * | | * | |
| * A macro to (i) disable the XLAL error handling and preserve the | | * A macro to (i) disable the XLAL error handling and preserve the | |
| * current value of xlalErrno (ii) perform a statement that involves an | | * current value of xlalErrno (ii) perform a statement that involves an | |
| * XLAL function call and (iii) restore the XLAL error handler and value of | | * XLAL function call and (iii) restore the XLAL error handler and value of | |
| | | | |
| skipping to change at line 534 | | skipping to change at line 570 | |
| * Here are the routines and macros that are used to report errors when | | * Here are the routines and macros that are used to report errors when | |
| * an XLAL function fails. They (i) set the XLAL error number and (ii) | | * an XLAL function fails. They (i) set the XLAL error number and (ii) | |
| * invoke the XLAL error handler. The macros also (iii) return the | | * invoke the XLAL error handler. The macros also (iii) return the | |
| * appropriate failure codes. The macros should be used to report all | | * appropriate failure codes. The macros should be used to report all | |
| * failures. | | * failures. | |
| * | | * | |
| */ | | */ | |
| | | | |
| /** Routine to set the XLAL error number and invoke the XLAL error handler. | | /** Routine to set the XLAL error number and invoke the XLAL error handler. | |
| * It is used by the error macros. */ | | * It is used by the error macros. */ | |
|
| void XLALError( | | void XLALError(const char *func, | |
| const char *func, /**< name of function where the error occurs */ | | /**< name of function where the error occurs */ | |
| const char *file, /**< source file name (use the __FILE__ macro) */ | | const char *file, | |
| int line, /**< source line number (use the __LINE__ macro) * | | /**< source file name (use the __FILE__ macro) */ | |
| / | | int line, /**< source line number (use the __LINE__ macro) | |
| int errnum /**< error code */ | | */ | |
| ); | | int errnum /**< error code */ | |
| | | ); | |
| | | | |
| /** \brief Macro to invoke the <tt>XLALError()</tt> function and return | | /** \brief Macro to invoke the <tt>XLALError()</tt> function and return | |
| * with code val (it should not really be used itself, but forms the basis
for | | * with code val (it should not really be used itself, but forms the basis
for | |
| * other macros). | | * other macros). | |
| * | | * | |
| * Prototype: <b>XLAL_ERROR_VAL(val, errnum [, fmt [, ...]])</b> | | * Prototype: <b>XLAL_ERROR_VAL(val, errnum [, fmt [, ...]])</b> | |
| * | | * | |
| * \b Parameters:<ul> | | * \b Parameters:<ul> | |
| * <li> \b val The value to return. | | * <li> \b val The value to return. | |
| * <li> \b errnum The XLAL error number to set. | | * <li> \b errnum The XLAL error number to set. | |
| | | | |
| skipping to change at line 734 | | skipping to change at line 771 | |
| * <li> \b fmt (Optional) Format string for additional error information. | | * <li> \b fmt (Optional) Format string for additional error information. | |
| * <li> \b ... (Optional) Additional arguments for printf-like format. | | * <li> \b ... (Optional) Additional arguments for printf-like format. | |
| * </ul> | | * </ul> | |
| */ | | */ | |
| #define XLAL_CHECK_REAL8(assertion, ...) \ | | #define XLAL_CHECK_REAL8(assertion, ...) \ | |
| XLAL_CHECK_VAL(XLAL_REAL8_FAIL_NAN, assertion, __VA_ARGS__) | | XLAL_CHECK_VAL(XLAL_REAL8_FAIL_NAN, assertion, __VA_ARGS__) | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| #if 0 | | #if 0 | |
|
| { /* so that editors will match succeeding brace */ | | { /* so that editors will match succeeding brace */ | |
| #elif defined(__cplusplus) | | #elif defined(__cplusplus) | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif /* XLALERROR_H */ | | #endif /* XLALERROR_H */ | |
| | | | |
End of changes. 33 change blocks. |
| 132 lines changed or deleted | | 151 lines changed or added | |
|
| swiglal_common.i | | swiglal_common.i | |
| | | | |
| skipping to change at line 87 | | skipping to change at line 87 | |
| #if #X != "" | | #if #X != "" | |
| MACRO(A, X); | | MACRO(A, X); | |
| %_swiglal_map_a(MACRO, A, __VA_ARGS__); | | %_swiglal_map_a(MACRO, A, __VA_ARGS__); | |
| #endif | | #endif | |
| %enddef | | %enddef | |
| %define %swiglal_map_a(MACRO, A, ...) | | %define %swiglal_map_a(MACRO, A, ...) | |
| %_swiglal_map_a(MACRO, A, __VA_ARGS__, ); | | %_swiglal_map_a(MACRO, A, __VA_ARGS__, ); | |
| %enddef | | %enddef | |
| | | | |
| // The macro %swiglal_map_ab() maps a three-argument MACRO(A, B, X) onto a
list | | // The macro %swiglal_map_ab() maps a three-argument MACRO(A, B, X) onto a
list | |
|
| // of arguments (which may be empty), with a common first arguments A and B
. | | // of arguments (which may be empty), with common first arguments A and B. | |
| %define %_swiglal_map_ab(MACRO, A, B, X, ...) | | %define %_swiglal_map_ab(MACRO, A, B, X, ...) | |
| #if #X != "" | | #if #X != "" | |
| MACRO(A, B, X); | | MACRO(A, B, X); | |
| %_swiglal_map_ab(MACRO, A, B, __VA_ARGS__); | | %_swiglal_map_ab(MACRO, A, B, __VA_ARGS__); | |
| #endif | | #endif | |
| %enddef | | %enddef | |
| %define %swiglal_map_ab(MACRO, A, B, ...) | | %define %swiglal_map_ab(MACRO, A, B, ...) | |
| %_swiglal_map_ab(MACRO, A, B, __VA_ARGS__, ); | | %_swiglal_map_ab(MACRO, A, B, __VA_ARGS__, ); | |
| %enddef | | %enddef | |
| | | | |
|
| | | // The macro %swiglal_map_abc() maps a four-argument MACRO(A, B, C, X) onto | |
| | | a list | |
| | | // of arguments (which may be empty), with common first arguments A, B, and | |
| | | C. | |
| | | %define %_swiglal_map_abc(MACRO, A, B, C, X, ...) | |
| | | #if #X != "" | |
| | | MACRO(A, B, C, X); | |
| | | %_swiglal_map_abc(MACRO, A, B, C, __VA_ARGS__); | |
| | | #endif | |
| | | %enddef | |
| | | %define %swiglal_map_abc(MACRO, A, B, C, ...) | |
| | | %_swiglal_map_abc(MACRO, A, B, C, __VA_ARGS__, ); | |
| | | %enddef | |
| | | | |
| // Apply and clear SWIG typemaps. | | // Apply and clear SWIG typemaps. | |
| %define %swiglal_apply(TYPEMAP, TYPE, NAME) | | %define %swiglal_apply(TYPEMAP, TYPE, NAME) | |
| %apply TYPEMAP { TYPE NAME }; | | %apply TYPEMAP { TYPE NAME }; | |
| %enddef | | %enddef | |
| %define %swiglal_clear(TYPE, NAME) | | %define %swiglal_clear(TYPE, NAME) | |
| %clear TYPE NAME; | | %clear TYPE NAME; | |
| %enddef | | %enddef | |
| | | | |
| // Apply a SWIG feature. | | // Apply a SWIG feature. | |
| %define %swiglal_feature(FEATURE, VALUE, NAME) | | %define %swiglal_feature(FEATURE, VALUE, NAME) | |
| %feature(FEATURE, VALUE) NAME; | | %feature(FEATURE, VALUE) NAME; | |
| %enddef | | %enddef | |
|
| | | %define %swiglal_feature_nspace(FEATURE, VALUE, NSPACE, NAME) | |
| | | %feature(FEATURE, VALUE) NSPACE::NAME; | |
| | | %enddef | |
| | | | |
| // Macros for allocating/copying new instances and arrays | | // Macros for allocating/copying new instances and arrays | |
| // Analogous to SWIG macros but using XLAL memory functions | | // Analogous to SWIG macros but using XLAL memory functions | |
| #define %swiglal_new_instance(TYPE...) \ | | #define %swiglal_new_instance(TYPE...) \ | |
| %reinterpret_cast(XLALMalloc(sizeof(TYPE)), TYPE*) | | %reinterpret_cast(XLALMalloc(sizeof(TYPE)), TYPE*) | |
| #define %swiglal_new_copy(VAL, TYPE...) \ | | #define %swiglal_new_copy(VAL, TYPE...) \ | |
| %reinterpret_cast(memcpy(%swiglal_new_instance(TYPE), &VAL, sizeof(TYPE))
, TYPE*) | | %reinterpret_cast(memcpy(%swiglal_new_instance(TYPE), &VAL, sizeof(TYPE))
, TYPE*) | |
| #define %swiglal_new_array(SIZE, TYPE...) \ | | #define %swiglal_new_array(SIZE, TYPE...) \ | |
| %reinterpret_cast(XLALMalloc((SIZE)*sizeof(TYPE)), TYPE*) | | %reinterpret_cast(XLALMalloc((SIZE)*sizeof(TYPE)), TYPE*) | |
| #define %swiglal_new_copy_array(PTR, SIZE, TYPE...) \ | | #define %swiglal_new_copy_array(PTR, SIZE, TYPE...) \ | |
| | | | |
| skipping to change at line 150 | | skipping to change at line 165 | |
| %} | | %} | |
| | | | |
| // Include LAL headers. | | // Include LAL headers. | |
| %header %{ | | %header %{ | |
| #include <lal/LALDatatypes.h> | | #include <lal/LALDatatypes.h> | |
| #include <lal/LALMalloc.h> | | #include <lal/LALMalloc.h> | |
| #include <lal/XLALError.h> | | #include <lal/XLALError.h> | |
| #include <lal/Date.h> | | #include <lal/Date.h> | |
| %} | | %} | |
| | | | |
|
| // Print LAL debugging errors by default. | | | |
| %init %{ | | | |
| lalDebugLevel |= LALERROR; | | | |
| %} | | | |
| | | | |
| // Version of SWIG used to generate wrapping code. | | // Version of SWIG used to generate wrapping code. | |
| %inline %{const int swig_version = SWIG_VERSION;%} | | %inline %{const int swig_version = SWIG_VERSION;%} | |
| | | | |
| // Whether wrapping code was generated in debug mode. | | // Whether wrapping code was generated in debug mode. | |
| #ifdef NDEBUG | | #ifdef NDEBUG | |
| %inline %{const bool swig_debug = false;%} | | %inline %{const bool swig_debug = false;%} | |
| #else | | #else | |
| %inline %{const bool swig_debug = true;%} | | %inline %{const bool swig_debug = true;%} | |
| #endif | | #endif | |
| | | | |
| | | | |
| skipping to change at line 192 | | skipping to change at line 202 | |
| // - LAL: For any function which has a LALStatus* argument, create a | | // - LAL: For any function which has a LALStatus* argument, create a | |
| // blank LALStatus struct and pass its pointer to the LAL function. | | // blank LALStatus struct and pass its pointer to the LAL function. | |
| // After the function is called, check the LALStatus statusCode; | | // After the function is called, check the LALStatus statusCode; | |
| // if it is non-zero, raise a generic XLAL error (to set the XLAL | | // if it is non-zero, raise a generic XLAL error (to set the XLAL | |
| // error number), then a native scripting-language exception. The | | // error number), then a native scripting-language exception. The | |
| // swiglal_check_LALStatus (C) preprocessor symbol determines if | | // swiglal_check_LALStatus (C) preprocessor symbol determines if | |
| // the LAL error handling code is invoked; by default this symbol | | // the LAL error handling code is invoked; by default this symbol | |
| // should be undefined, i.e. functions are XLAL functions by default. | | // should be undefined, i.e. functions are XLAL functions by default. | |
| %header %{ | | %header %{ | |
| static const LALStatus swiglal_empty_LALStatus = {0, NULL, NULL, NULL, NULL
, 0, NULL, 0}; | | static const LALStatus swiglal_empty_LALStatus = {0, NULL, NULL, NULL, NULL
, 0, NULL, 0}; | |
|
| #define swiglal_XLAL_error() XLALError(__func__, __FILE__, __LINE__, XLAL_E
FAILED) | | | |
| #undef swiglal_check_LALStatus | | #undef swiglal_check_LALStatus | |
| %} | | %} | |
| %typemap(in, noblock=1, numinputs=0) LALStatus* { | | %typemap(in, noblock=1, numinputs=0) LALStatus* { | |
| LALStatus lalstatus = swiglal_empty_LALStatus; | | LALStatus lalstatus = swiglal_empty_LALStatus; | |
| $1 = &lalstatus; | | $1 = &lalstatus; | |
| %#define swiglal_check_LALStatus | | %#define swiglal_check_LALStatus | |
| } | | } | |
| %exception %{ | | %exception %{ | |
| XLALClearErrno(); | | XLALClearErrno(); | |
| $action | | $action | |
| #ifdef swiglal_check_LALStatus | | #ifdef swiglal_check_LALStatus | |
| if (lalstatus.statusCode) { | | if (lalstatus.statusCode) { | |
|
| swiglal_XLAL_error(); | | XLALSetErrno(XLAL_EFAILED); | |
| SWIG_exception(SWIG_RuntimeError, lalstatus.statusDescription); | | SWIG_exception(SWIG_RuntimeError, lalstatus.statusDescription); | |
| } | | } | |
| #else | | #else | |
| if (xlalErrno) { | | if (xlalErrno) { | |
| SWIG_exception(SWIG_RuntimeError, XLALErrorString(xlalErrno)); | | SWIG_exception(SWIG_RuntimeError, XLALErrorString(xlalErrno)); | |
| } | | } | |
| #endif | | #endif | |
| #undef swiglal_check_LALStatus | | #undef swiglal_check_LALStatus | |
| %} | | %} | |
| | | | |
| ////////// General fragments ////////// | | ////////// General fragments ////////// | |
| | | | |
| // Empty fragment, for fragment-generating macros. | | // Empty fragment, for fragment-generating macros. | |
| %fragment("swiglal_empty_frag", "header") {} | | %fragment("swiglal_empty_frag", "header") {} | |
| | | | |
| // Wrappers around SWIG's pointer to/from SWIG-wrapped scripting language o
bject functions. | | // Wrappers around SWIG's pointer to/from SWIG-wrapped scripting language o
bject functions. | |
| // swiglal_from_SWIGTYPE() simply returns a SWIG-wrapped object containing
the input pointer. | | // swiglal_from_SWIGTYPE() simply returns a SWIG-wrapped object containing
the input pointer. | |
| // swiglal_from_SWIGTYPE() extracts a pointer from a SWIG-wrapped object, t
hen struct-copies | | // swiglal_from_SWIGTYPE() extracts a pointer from a SWIG-wrapped object, t
hen struct-copies | |
| // the pointer to the supplied output pointer. | | // the pointer to the supplied output pointer. | |
| %fragment("swiglal_from_SWIGTYPE", "header") { | | %fragment("swiglal_from_SWIGTYPE", "header") { | |
|
| SWIGINTERNINLINE SWIG_Object swiglal_from_SWIGTYPE(SWIG_Object self, void | | SWIGINTERNINLINE SWIG_Object swiglal_from_SWIGTYPE(SWIG_Object self, void | |
| *ptr, swig_type_info *tinfo, int tflags) { | | *ptr, bool isptr, swig_type_info *tinfo, int tflags) { | |
| return SWIG_NewPointerObj(ptr, tinfo, tflags); | | return SWIG_NewPointerObj(isptr ? *((void**)ptr) : ptr, tinfo, tflags); | |
| } | | } | |
| } | | } | |
| %fragment("swiglal_as_SWIGTYPE", "header") { | | %fragment("swiglal_as_SWIGTYPE", "header") { | |
|
| SWIGINTERN int swiglal_as_SWIGTYPE(SWIG_Object self, SWIG_Object obj, voi
d *ptr, size_t len, swig_type_info *tinfo, int tflags) { | | SWIGINTERN int swiglal_as_SWIGTYPE(SWIG_Object self, SWIG_Object obj, voi
d *ptr, size_t len, bool isptr, swig_type_info *tinfo, int tflags) { | |
| void *vptr = NULL; | | void *vptr = NULL; | |
| int ecode = SWIG_ConvertPtr(obj, &vptr, tinfo, tflags); | | int ecode = SWIG_ConvertPtr(obj, &vptr, tinfo, tflags); | |
| if (!SWIG_IsOK(ecode)) { | | if (!SWIG_IsOK(ecode)) { | |
| return ecode; | | return ecode; | |
| } | | } | |
|
| memcpy(ptr, vptr, len); | | memcpy(ptr, isptr ? &vptr : vptr, len); | |
| return ecode; | | return ecode; | |
| } | | } | |
| } | | } | |
| | | | |
| ////////// Generate interface ////////// | | ////////// Generate interface ////////// | |
| | | | |
| // The SWIG interface file is generated by 'generate_swiglal_iface.py', whi
ch | | // The SWIG interface file is generated by 'generate_swiglal_iface.py', whi
ch | |
| // extracts lists of interface symbols (functions, structs, typedefs to str
ucts) | | // extracts lists of interface symbols (functions, structs, typedefs to str
ucts) | |
| // and headers from the preprocessing interface, and generates calls to the | | // and headers from the preprocessing interface, and generates calls to the | |
| // following macros: | | // following macros: | |
| | | | |
| // Process an interface function NAME: rename it to RENAME, and set it to | | // Process an interface function NAME: rename it to RENAME, and set it to | |
| // always return SWIG-owned wrapping objects (unless the function is being | | // always return SWIG-owned wrapping objects (unless the function is being | |
|
| // ignored). If TYPE is given, ignore the return value of the function. | | // ignored). If IGNORE_TYPE is given, ignore the function's return value. | |
| %typemap(out, noblock=1) SWIGTYPE SWIGLAL_RETURN_VOID { | | // If DISOWN is true, disown the function's first argument. | |
| %set_output(VOID_Object); | | %define %swiglal_process_function(NAME, RENAME, IGNORE_TYPE, DISOWN) | |
| } | | | |
| %typemap(newfree, noblock=1) SWIGTYPE SWIGLAL_RETURN_VOID ""; | | | |
| %define %swiglal_process_function(NAME, RENAME, TYPE) | | | |
| %rename(#RENAME) NAME; | | %rename(#RENAME) NAME; | |
| #if #RENAME != "$ignore" | | #if #RENAME != "$ignore" | |
| %feature("new", "1") NAME; | | %feature("new", "1") NAME; | |
|
| #if #TYPE != "" | | #if #IGNORE_TYPE != "" | |
| %apply SWIGTYPE SWIGLAL_RETURN_VOID { TYPE NAME }; | | %apply SWIGTYPE SWIGLAL_RETURN_VOID { IGNORE_TYPE NAME }; | |
| | | #endif | |
| | | #if DISOWN | |
| | | %feature("del", "1") NAME; | |
| #endif | | #endif | |
| #endif | | #endif | |
| %enddef | | %enddef | |
| | | | |
| // Process a typedef to an interface struct TAGNAME: rename it to RENAME. | | // Process a typedef to an interface struct TAGNAME: rename it to RENAME. | |
| %define %swiglal_process_tdstruct(TAGNAME, RENAME) | | %define %swiglal_process_tdstruct(TAGNAME, RENAME) | |
| %rename(#RENAME) TAGNAME; | | %rename(#RENAME) TAGNAME; | |
| %enddef | | %enddef | |
| | | | |
| // Do not generate any default (copy) contructors or destructors. | | // Do not generate any default (copy) contructors or destructors. | |
| | | | |
| skipping to change at line 340 | | skipping to change at line 349 | |
| } | | } | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| %enddef // %swiglal_generate_struct_cdtor() | | %enddef // %swiglal_generate_struct_cdtor() | |
| | | | |
| ////////// Fragments and typemaps for arrays ////////// | | ////////// Fragments and typemaps for arrays ////////// | |
| | | | |
| // Map fixed-array types to special variables of their elements, | | // Map fixed-array types to special variables of their elements, | |
| // e.g. $typemap(swiglal_fixarr_ltype, const int[][]) returns "int". | | // e.g. $typemap(swiglal_fixarr_ltype, const int[][]) returns "int". | |
|
| | | // Fixed-array types are assumed never to be arrays of pointers. | |
| %typemap(swiglal_fixarr_ltype) SWIGTYPE "$ltype"; | | %typemap(swiglal_fixarr_ltype) SWIGTYPE "$ltype"; | |
| %typemap(swiglal_fixarr_ltype) SWIGTYPE[ANY] "$typemap(swiglal_fixarr_ltype
, $*type)"; | | %typemap(swiglal_fixarr_ltype) SWIGTYPE[ANY] "$typemap(swiglal_fixarr_ltype
, $*type)"; | |
| %typemap(swiglal_fixarr_ltype) SWIGTYPE[ANY][ANY] "$typemap(swiglal_fixarr_
ltype, $*type)"; | | %typemap(swiglal_fixarr_ltype) SWIGTYPE[ANY][ANY] "$typemap(swiglal_fixarr_
ltype, $*type)"; | |
|
| %typemap(swiglal_fixarr_pdesc) SWIGTYPE "$&descriptor"; | | %typemap(swiglal_fixarr_tinfo) SWIGTYPE "$&descriptor"; | |
| %typemap(swiglal_fixarr_pdesc) SWIGTYPE[ANY] "$typemap(swiglal_fixarr_pdesc | | %typemap(swiglal_fixarr_tinfo) SWIGTYPE[ANY] "$typemap(swiglal_fixarr_tinfo | |
| , $*type)"; | | , $*type)"; | |
| %typemap(swiglal_fixarr_pdesc) SWIGTYPE[ANY][ANY] "$typemap(swiglal_fixarr_ | | %typemap(swiglal_fixarr_tinfo) SWIGTYPE[ANY][ANY] "$typemap(swiglal_fixarr_ | |
| pdesc, $*type)"; | | tinfo, $*type)"; | |
| | | | |
| // The conversion of C arrays to/from scripting-language arrays are perform
ed | | // The conversion of C arrays to/from scripting-language arrays are perform
ed | |
| // by the following functions: | | // by the following functions: | |
| // - %swiglal_array_copyin...() copies a scripting-language array into a C
array. | | // - %swiglal_array_copyin...() copies a scripting-language array into a C
array. | |
| // - %swiglal_array_copyout...() copies a C array into a scripting-languag
e array. | | // - %swiglal_array_copyout...() copies a C array into a scripting-languag
e array. | |
| // - %swiglal_array_viewout...() wraps a C array inside a scripting-langua
ge array, | | // - %swiglal_array_viewout...() wraps a C array inside a scripting-langua
ge array, | |
| // if this is supported by the target scripting language. | | // if this is supported by the target scripting language. | |
| // These functions accept a subset of the following arguments: | | // These functions accept a subset of the following arguments: | |
| // - SWIG_Object obj: input scripting-language array. | | // - SWIG_Object obj: input scripting-language array. | |
| // - SWIG_Object parent: SWIG-wrapped object containing parent struct. | | // - SWIG_Object parent: SWIG-wrapped object containing parent struct. | |
| | | | |
| skipping to change at line 399 | | skipping to change at line 409 | |
| %typemap(swiglal_array_typeid, fragment="swiglal_array_frags_" %str(ACFTYPE
)) TYPE[ANY][ANY] %str(ACFTYPE); | | %typemap(swiglal_array_typeid, fragment="swiglal_array_frags_" %str(ACFTYPE
)) TYPE[ANY][ANY] %str(ACFTYPE); | |
| %typemap(swiglal_array_typeid, fragment="swiglal_array_frags_" %str(ACFTYPE
)) const TYPE[ANY] %str(ACFTYPE); | | %typemap(swiglal_array_typeid, fragment="swiglal_array_frags_" %str(ACFTYPE
)) const TYPE[ANY] %str(ACFTYPE); | |
| %typemap(swiglal_array_typeid, fragment="swiglal_array_frags_" %str(ACFTYPE
)) const TYPE[ANY][ANY] %str(ACFTYPE); | | %typemap(swiglal_array_typeid, fragment="swiglal_array_frags_" %str(ACFTYPE
)) const TYPE[ANY][ANY] %str(ACFTYPE); | |
| %enddef | | %enddef | |
| %define %swiglal_array_type(ACFTYPE, ...) | | %define %swiglal_array_type(ACFTYPE, ...) | |
| %swiglal_map_a(%_swiglal_array_type, ACFTYPE, __VA_ARGS__); | | %swiglal_map_a(%_swiglal_array_type, ACFTYPE, __VA_ARGS__); | |
| %enddef | | %enddef | |
| | | | |
| // Map C array TYPEs to array conversion function ACFTYPEs. | | // Map C array TYPEs to array conversion function ACFTYPEs. | |
| %swiglal_array_type(SWIGTYPE, SWIGTYPE); | | %swiglal_array_type(SWIGTYPE, SWIGTYPE); | |
|
| %swiglal_array_type(LALCHAR, CHAR*); | | %swiglal_array_type(LALchar, char*); | |
| %swiglal_array_type(int8_t, char, signed char, int8_t); | | %swiglal_array_type(int8_t, char, signed char, int8_t); | |
| %swiglal_array_type(uint8_t, unsigned char, uint8_t); | | %swiglal_array_type(uint8_t, unsigned char, uint8_t); | |
| %swiglal_array_type(int16_t, short, int16_t); | | %swiglal_array_type(int16_t, short, int16_t); | |
| %swiglal_array_type(uint16_t, unsigned short, uint16_t); | | %swiglal_array_type(uint16_t, unsigned short, uint16_t); | |
| %swiglal_array_type(int32_t, int, int32_t, enum SWIGTYPE); | | %swiglal_array_type(int32_t, int, int32_t, enum SWIGTYPE); | |
| %swiglal_array_type(uint32_t, unsigned int, uint32_t); | | %swiglal_array_type(uint32_t, unsigned int, uint32_t); | |
| %swiglal_array_type(int64_t, long long, int64_t); | | %swiglal_array_type(int64_t, long long, int64_t); | |
| %swiglal_array_type(uint64_t, unsigned long long, uint64_t); | | %swiglal_array_type(uint64_t, unsigned long long, uint64_t); | |
| %swiglal_array_type(float, float); | | %swiglal_array_type(float, float); | |
| %swiglal_array_type(double, double); | | %swiglal_array_type(double, double); | |
| | | | |
| skipping to change at line 452 | | skipping to change at line 462 | |
| | | | |
| // Input typemaps for functions and structs: | | // Input typemaps for functions and structs: | |
| %typemap(in) SWIGTYPE[ANY], SWIGTYPE INOUT[ANY] { | | %typemap(in) SWIGTYPE[ANY], SWIGTYPE INOUT[ANY] { | |
| const size_t dims[] = {$1_dim0}; | | const size_t dims[] = {$1_dim0}; | |
| const size_t strides[] = {1}; | | const size_t strides[] = {1}; | |
| $typemap(swiglal_fixarr_ltype, $1_type) temp[$1_dim0]; | | $typemap(swiglal_fixarr_ltype, $1_type) temp[$1_dim0]; | |
| $1 = &temp[0]; | | $1 = &temp[0]; | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as
_voidptr($1), | | int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as
_voidptr($1), | |
| sizeof($1[0]), 1, dims, stride
s, | | sizeof($1[0]), 1, dims, stride
s, | |
|
| $typemap(swiglal_fixarr_pdesc,
$1_type), | | false, $typemap(swiglal_fixarr
_tinfo, $1_type), | |
| $disown | %convertptr_flags); | | $disown | %convertptr_flags); | |
| if (!SWIG_IsOK(ecode)) { | | if (!SWIG_IsOK(ecode)) { | |
| %argument_fail(ecode, "$type", $symname, $argnum); | | %argument_fail(ecode, "$type", $symname, $argnum); | |
| } | | } | |
| } | | } | |
| %typemap(in) SWIGTYPE[ANY][ANY], SWIGTYPE INOUT[ANY][ANY] { | | %typemap(in) SWIGTYPE[ANY][ANY], SWIGTYPE INOUT[ANY][ANY] { | |
| const size_t dims[] = {$1_dim0, $1_dim1}; | | const size_t dims[] = {$1_dim0, $1_dim1}; | |
| const size_t strides[] = {$1_dim1, 1}; | | const size_t strides[] = {$1_dim1, 1}; | |
| $typemap(swiglal_fixarr_ltype, $1_type) temp[$1_dim0][$1_dim1]; | | $typemap(swiglal_fixarr_ltype, $1_type) temp[$1_dim0][$1_dim1]; | |
| $1 = &temp[0]; | | $1 = &temp[0]; | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as
_voidptr($1), | | int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as
_voidptr($1), | |
| sizeof($1[0][0]), 2, dims, str
ides, | | sizeof($1[0][0]), 2, dims, str
ides, | |
|
| $typemap(swiglal_fixarr_pdesc,
$1_type), | | false, $typemap(swiglal_fixarr
_tinfo, $1_type), | |
| $disown | %convertptr_flags); | | $disown | %convertptr_flags); | |
| if (!SWIG_IsOK(ecode)) { | | if (!SWIG_IsOK(ecode)) { | |
| %argument_fail(ecode, "$type", $symname, $argnum); | | %argument_fail(ecode, "$type", $symname, $argnum); | |
| } | | } | |
| } | | } | |
| | | | |
| // Input typemaps for global variables: | | // Input typemaps for global variables: | |
| %typemap(varin) SWIGTYPE[ANY] { | | %typemap(varin) SWIGTYPE[ANY] { | |
| const size_t dims[] = {$1_dim0}; | | const size_t dims[] = {$1_dim0}; | |
| const size_t strides[] = {1}; | | const size_t strides[] = {1}; | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as
_voidptr($1), | | int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as
_voidptr($1), | |
| sizeof($1[0]), 1, dims, stride
s, | | sizeof($1[0]), 1, dims, stride
s, | |
|
| $typemap(swiglal_fixarr_pdesc,
$1_type), | | false, $typemap(swiglal_fixarr
_tinfo, $1_type), | |
| %convertptr_flags); | | %convertptr_flags); | |
| if (!SWIG_IsOK(ecode)) { | | if (!SWIG_IsOK(ecode)) { | |
| %variable_fail(ecode, "$type", $symname); | | %variable_fail(ecode, "$type", $symname); | |
| } | | } | |
| } | | } | |
| %typemap(varin) SWIGTYPE[ANY][ANY] { | | %typemap(varin) SWIGTYPE[ANY][ANY] { | |
| const size_t dims[] = {$1_dim0, $1_dim1}; | | const size_t dims[] = {$1_dim0, $1_dim1}; | |
| const size_t strides[] = {$1_dim1, 1}; | | const size_t strides[] = {$1_dim1, 1}; | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as
_voidptr($1), | | int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as
_voidptr($1), | |
| sizeof($1[0][0]), 2, dims, str
ides, | | sizeof($1[0][0]), 2, dims, str
ides, | |
|
| $typemap(swiglal_fixarr_pdesc,
$1_type), | | false, $typemap(swiglal_fixarr
_tinfo, $1_type), | |
| %convertptr_flags); | | %convertptr_flags); | |
| if (!SWIG_IsOK(ecode)) { | | if (!SWIG_IsOK(ecode)) { | |
| %variable_fail(ecode, "$type", $symname); | | %variable_fail(ecode, "$type", $symname); | |
| } | | } | |
| } | | } | |
| | | | |
| // Output typemaps for functions and structs: | | // Output typemaps for functions and structs: | |
| %typemap(out) SWIGTYPE[ANY] { | | %typemap(out) SWIGTYPE[ANY] { | |
| const size_t dims[] = {$1_dim0}; | | const size_t dims[] = {$1_dim0}; | |
| const size_t strides[] = {1}; | | const size_t strides[] = {1}; | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| %#if $owner & SWIG_POINTER_OWN | | %#if $owner & SWIG_POINTER_OWN | |
| %set_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voidpt
r($1), | | %set_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voidpt
r($1), | |
| sizeof($1[0]), 1, dims, strid
es, | | sizeof($1[0]), 1, dims, strid
es, | |
|
| $typemap(swiglal_fixarr_pdesc
, $1_type), | | false, $typemap(swiglal_fixar
r_tinfo, $1_type), | |
| $owner | %newpointer_flags)); | | $owner | %newpointer_flags)); | |
| %#else | | %#else | |
| %set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidptr($
1), | | %set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidptr($
1), | |
| sizeof($1[0]), 1, dims, strid
es, | | sizeof($1[0]), 1, dims, strid
es, | |
|
| $typemap(swiglal_fixarr_pdesc
, $1_type), | | false, $typemap(swiglal_fixar
r_tinfo, $1_type), | |
| $owner | %newpointer_flags)); | | $owner | %newpointer_flags)); | |
| %#endif | | %#endif | |
| } | | } | |
| %typemap(out) SWIGTYPE[ANY][ANY] { | | %typemap(out) SWIGTYPE[ANY][ANY] { | |
| const size_t dims[] = {$1_dim0, $1_dim1}; | | const size_t dims[] = {$1_dim0, $1_dim1}; | |
| const size_t strides[] = {$1_dim1, 1}; | | const size_t strides[] = {$1_dim1, 1}; | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| %#if $owner & SWIG_POINTER_OWN | | %#if $owner & SWIG_POINTER_OWN | |
| %set_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voidpt
r($1), | | %set_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voidpt
r($1), | |
| sizeof($1[0][0]), 2, dims, st
rides, | | sizeof($1[0][0]), 2, dims, st
rides, | |
|
| $typemap(swiglal_fixarr_pdesc
, $1_type), | | false, $typemap(swiglal_fixar
r_tinfo, $1_type), | |
| $owner | %newpointer_flags)); | | $owner | %newpointer_flags)); | |
| %#else | | %#else | |
| %set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidptr($
1), | | %set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidptr($
1), | |
| sizeof($1[0][0]), 2, dims, st
rides, | | sizeof($1[0][0]), 2, dims, st
rides, | |
|
| $typemap(swiglal_fixarr_pdesc
, $1_type), | | false, $typemap(swiglal_fixar
r_tinfo, $1_type), | |
| $owner | %newpointer_flags)); | | $owner | %newpointer_flags)); | |
| %#endif | | %#endif | |
| } | | } | |
| | | | |
| // Output typemaps for global variables: | | // Output typemaps for global variables: | |
| %typemap(varout) SWIGTYPE[ANY] { | | %typemap(varout) SWIGTYPE[ANY] { | |
| const size_t dims[] = {$1_dim0}; | | const size_t dims[] = {$1_dim0}; | |
| const size_t strides[] = {1}; | | const size_t strides[] = {1}; | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| %set_output(%swiglal_array_viewout($1_type)(swiglal_no_self(), %as_voidpt
r($1), | | %set_output(%swiglal_array_viewout($1_type)(swiglal_no_self(), %as_voidpt
r($1), | |
| sizeof($1[0]), 1, dims, strid
es, | | sizeof($1[0]), 1, dims, strid
es, | |
|
| $typemap(swiglal_fixarr_pdesc
, $1_type), | | false, $typemap(swiglal_fixar
r_tinfo, $1_type), | |
| %newpointer_flags)); | | %newpointer_flags)); | |
| } | | } | |
| %typemap(varout) SWIGTYPE[ANY][ANY] { | | %typemap(varout) SWIGTYPE[ANY][ANY] { | |
| const size_t dims[] = {$1_dim0, $1_dim1}; | | const size_t dims[] = {$1_dim0, $1_dim1}; | |
| const size_t strides[] = {$1_dim1, 1}; | | const size_t strides[] = {$1_dim1, 1}; | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| %set_output(%swiglal_array_viewout($1_type)(swiglal_no_self(), %as_voidpt
r($1), | | %set_output(%swiglal_array_viewout($1_type)(swiglal_no_self(), %as_voidpt
r($1), | |
| sizeof($1[0][0]), 2, dims, st
rides, | | sizeof($1[0][0]), 2, dims, st
rides, | |
|
| $typemap(swiglal_fixarr_pdesc
, $1_type), | | false, $typemap(swiglal_fixar
r_tinfo, $1_type), | |
| %newpointer_flags)); | | %newpointer_flags)); | |
| } | | } | |
| | | | |
| // Argument-output typemaps for functions: | | // Argument-output typemaps for functions: | |
| %typemap(in, numinputs=0) SWIGTYPE OUTPUT[ANY] { | | %typemap(in, numinputs=0) SWIGTYPE OUTPUT[ANY] { | |
| $typemap(swiglal_fixarr_ltype, $1_type) temp[$1_dim0]; | | $typemap(swiglal_fixarr_ltype, $1_type) temp[$1_dim0]; | |
| $1 = &temp[0]; | | $1 = &temp[0]; | |
| } | | } | |
| %typemap(argout) SWIGTYPE OUTPUT[ANY], SWIGTYPE INOUT[ANY] { | | %typemap(argout) SWIGTYPE OUTPUT[ANY], SWIGTYPE INOUT[ANY] { | |
| const size_t dims[] = {$1_dim0}; | | const size_t dims[] = {$1_dim0}; | |
| const size_t strides[] = {1}; | | const size_t strides[] = {1}; | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| %append_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voi
dptr($1), | | %append_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voi
dptr($1), | |
| sizeof($1[0]), 1, dims, st
rides, | | sizeof($1[0]), 1, dims, st
rides, | |
|
| $typemap(swiglal_fixarr_pd
esc, $1_type), | | false, $typemap(swiglal_fi
xarr_tinfo, $1_type), | |
| SWIG_POINTER_OWN | %newpoi
nter_flags)); | | SWIG_POINTER_OWN | %newpoi
nter_flags)); | |
| } | | } | |
| %typemap(in, numinputs=0) SWIGTYPE OUTPUT[ANY][ANY] { | | %typemap(in, numinputs=0) SWIGTYPE OUTPUT[ANY][ANY] { | |
| $typemap(swiglal_fixarr_ltype, $1_type) temp[$1_dim0][$1_dim1]; | | $typemap(swiglal_fixarr_ltype, $1_type) temp[$1_dim0][$1_dim1]; | |
| $1 = &temp[0]; | | $1 = &temp[0]; | |
| } | | } | |
| %typemap(argout) SWIGTYPE OUTPUT[ANY][ANY], SWIGTYPE INOUT[ANY][ANY] { | | %typemap(argout) SWIGTYPE OUTPUT[ANY][ANY], SWIGTYPE INOUT[ANY][ANY] { | |
| const size_t dims[] = {$1_dim0, $1_dim1}; | | const size_t dims[] = {$1_dim0, $1_dim1}; | |
| const size_t strides[] = {$1_dim1, 1}; | | const size_t strides[] = {$1_dim1, 1}; | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| %append_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voi
dptr($1), | | %append_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voi
dptr($1), | |
| sizeof($1[0][0]), 2, dims,
strides, | | sizeof($1[0][0]), 2, dims,
strides, | |
|
| $typemap(swiglal_fixarr_pd
esc, $1_type), | | false, $typemap(swiglal_fi
xarr_tinfo, $1_type), | |
| SWIG_POINTER_OWN | %newpoi
nter_flags)); | | SWIG_POINTER_OWN | %newpoi
nter_flags)); | |
| } | | } | |
| | | | |
| // Public macros to make fixed nD arrays: | | // Public macros to make fixed nD arrays: | |
|
| // * output-only arguments: SWIGLAL(OUTPUT_nDARRAY(TYPE, ...)) | | // * output-only arguments: SWIGLAL(OUTPUT_ARRAY_nD(TYPE, ...)) | |
| %define %swiglal_public_OUTPUT_1DARRAY(TYPE, ...) | | %define %swiglal_public_OUTPUT_ARRAY_1D(TYPE, ...) | |
| %swiglal_map_ab(%swiglal_apply, SWIGTYPE OUTPUT[ANY], TYPE, __VA_ARGS__); | | %swiglal_map_ab(%swiglal_apply, SWIGTYPE OUTPUT[ANY], TYPE, __VA_ARGS__); | |
| %enddef | | %enddef | |
|
| %define %swiglal_public_clear_OUTPUT_1DARRAY(TYPE, ...) | | %define %swiglal_public_clear_OUTPUT_ARRAY_1D(TYPE, ...) | |
| %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | | %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | |
| %enddef | | %enddef | |
|
| %define %swiglal_public_OUTPUT_2DARRAY(TYPE, ...) | | %define %swiglal_public_OUTPUT_ARRAY_2D(TYPE, ...) | |
| %swiglal_map_ab(%swiglal_apply, SWIGTYPE OUTPUT[ANY][ANY], TYPE, __VA_ARGS_
_); | | %swiglal_map_ab(%swiglal_apply, SWIGTYPE OUTPUT[ANY][ANY], TYPE, __VA_ARGS_
_); | |
| %enddef | | %enddef | |
|
| %define %swiglal_public_clear_OUTPUT_2DARRAY(TYPE, ...) | | %define %swiglal_public_clear_OUTPUT_ARRAY_2D(TYPE, ...) | |
| %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | | %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | |
| %enddef | | %enddef | |
|
| // * input-output arguments: SWIGLAL(INOUT_nDARRAY(TYPE, ...)) | | // * input-output arguments: SWIGLAL(INOUT_ARRAY_nD(TYPE, ...)) | |
| %define %swiglal_public_INOUT_1DARRAY(TYPE, ...) | | %define %swiglal_public_INOUT_ARRAY_1D(TYPE, ...) | |
| %swiglal_map_ab(%swiglal_apply, SWIGTYPE INOUT[ANY], TYPE, __VA_ARGS__); | | %swiglal_map_ab(%swiglal_apply, SWIGTYPE INOUT[ANY], TYPE, __VA_ARGS__); | |
| %enddef | | %enddef | |
|
| %define %swiglal_public_clear_INOUT_1DARRAY(TYPE, ...) | | %define %swiglal_public_clear_INOUT_ARRAY_1D(TYPE, ...) | |
| %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | | %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | |
| %enddef | | %enddef | |
|
| %define %swiglal_public_INOUT_2DARRAY(TYPE, ...) | | %define %swiglal_public_INOUT_ARRAY_2D(TYPE, ...) | |
| %swiglal_map_ab(%swiglal_apply, SWIGTYPE INOUT[ANY][ANY], TYPE, __VA_ARGS__
); | | %swiglal_map_ab(%swiglal_apply, SWIGTYPE INOUT[ANY][ANY], TYPE, __VA_ARGS__
); | |
| %enddef | | %enddef | |
|
| %define %swiglal_public_clear_INOUT_2DARRAY(TYPE, ...) | | %define %swiglal_public_clear_INOUT_ARRAY_2D(TYPE, ...) | |
| %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | | %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | |
| %enddef | | %enddef | |
| | | | |
| // Get the correct descriptor for a dynamic array element: | | // Get the correct descriptor for a dynamic array element: | |
|
| // always return a pointer-description, even for non-pointer types | | // Always return a pointer description, even for non-pointer types, and | |
| %typemap(swiglal_dynarr_pdesc) SWIGTYPE "$&descriptor"; | | // determine whether array is an array of pointers or of data blocks. | |
| %typemap(swiglal_dynarr_pdesc) SWIGTYPE* "$descriptor"; | | %typemap(swiglal_dynarr_isptr) SWIGTYPE "false"; | |
| | | %typemap(swiglal_dynarr_tinfo) SWIGTYPE "$&descriptor"; | |
| | | %typemap(swiglal_dynarr_isptr) SWIGTYPE* "true"; | |
| | | %typemap(swiglal_dynarr_tinfo) SWIGTYPE* "$descriptor"; | |
| | | | |
| | | // Create immutable members for accessing the array's dimensions. | |
| | | // NI is the name of the dimension member, and SIZET is its type. | |
| | | %define %swiglal_array_dynamic_size(SIZET, NI) | |
| | | %feature("action") NI { | |
| | | result = %static_cast(arg1->NI, SIZET); | |
| | | } | |
| | | %extend { | |
| | | const SIZET NI; | |
| | | } | |
| | | %feature("action", "") NI; | |
| | | %enddef // %swiglal_array_dynamic_size() | |
| | | | |
| | | // Check that array strides are non-zero, otherwise fail. | |
| | | %define %swiglal_array_dynamic_check_strides(NAME, DATA, I) | |
| | | if (strides[I-1] == 0) { | |
| | | SWIG_exception_fail(SWIG_IndexError, "Stride of dimension "#I" of "#NAM | |
| | | E"."#DATA" is zero"); | |
| | | } | |
| | | %enddef // %swiglal_array_dynamic_check_strides() | |
| | | | |
| // The %swiglal_array_dynamic_<n>D() macros create typemaps which convert | | // The %swiglal_array_dynamic_<n>D() macros create typemaps which convert | |
|
| // <n>-D dynamically-allocated arrays in structs. The macros must be | | // <n>-D dynamically-allocated arrays in structs NAME. The macros must be | |
| // added inside the definition of the struct, before the struct members | | // added inside the definition of the struct, before the struct members | |
| // comprising the array are defined. The DATA and N{I,J} members give | | // comprising the array are defined. The DATA and N{I,J} members give | |
| // the array data and dimensions, TYPE and SIZET give their respective | | // the array data and dimensions, TYPE and SIZET give their respective | |
| // types. The S{I,J} give the strides of the array, in number of elements. | | // types. The S{I,J} give the strides of the array, in number of elements. | |
|
| // If the strides are members of the struct, 'arg1->' should be used to | | // If the sizes or strides are members of the struct, 'arg1->' should be | |
| // access the struct itself. | | // used to access the struct itself. | |
| // 1-D arrays: | | // 1-D arrays: | |
|
| %define %swiglal_array_dynamic_1D(TYPE, SIZET, DATA, NI, SI) | | %define %swiglal_array_dynamic_1D(NAME, TYPE, SIZET, DATA, NI, SI) | |
| | | | |
| // Create immutable members for the array's dimensions. | | | |
| %feature("action") NI {result = %static_cast(arg1->NI, SIZET);} | | | |
| %extend { | | | |
| const SIZET NI; | | | |
| } | | | |
| %feature("action", "") NI; | | | |
| | | | |
| // Typemaps which convert to/from the dynamically-allocated array. | | // Typemaps which convert to/from the dynamically-allocated array. | |
| %typemap(in, noblock=1) TYPE* DATA { | | %typemap(in, noblock=1) TYPE* DATA { | |
| if (arg1) { | | if (arg1) { | |
|
| const size_t dims[] = {arg1->NI}; | | const size_t dims[] = {NI}; | |
| const size_t strides[] = {SI}; | | const size_t strides[] = {SI}; | |
|
| | | %swiglal_array_dynamic_check_strides(NAME, DATA, 1); | |
| $1 = %reinterpret_cast(arg1->DATA, TYPE*); | | $1 = %reinterpret_cast(arg1->DATA, TYPE*); | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| int ecode = %swiglal_array_copyin($1_type)(swiglal_self(), $input, %a
s_voidptr($1), | | int ecode = %swiglal_array_copyin($1_type)(swiglal_self(), $input, %a
s_voidptr($1), | |
| sizeof(TYPE), 1, dims, str
ides, | | sizeof(TYPE), 1, dims, str
ides, | |
|
| $typemap(swiglal_dynarr_pd
esc, TYPE), | | $typemap(swiglal_dynarr_is
ptr, TYPE), $typemap(swiglal_dynarr_tinfo, TYPE), | |
| $disown | %convertptr_flag
s); | | $disown | %convertptr_flag
s); | |
| if (!SWIG_IsOK(ecode)) { | | if (!SWIG_IsOK(ecode)) { | |
| %argument_fail(ecode, "$type", $symname, $argnum); | | %argument_fail(ecode, "$type", $symname, $argnum); | |
| } | | } | |
| } | | } | |
| } | | } | |
| %typemap(out, noblock=1) TYPE* DATA { | | %typemap(out, noblock=1) TYPE* DATA { | |
| if (arg1) { | | if (arg1) { | |
|
| const size_t dims[] = {arg1->NI}; | | const size_t dims[] = {NI}; | |
| const size_t strides[] = {SI}; | | const size_t strides[] = {SI}; | |
|
| | | %swiglal_array_dynamic_check_strides(NAME, DATA, 1); | |
| $1 = %reinterpret_cast(arg1->DATA, TYPE*); | | $1 = %reinterpret_cast(arg1->DATA, TYPE*); | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| %set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidp
tr($1), | | %set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidp
tr($1), | |
| sizeof(TYPE), 1, dims, st
rides, | | sizeof(TYPE), 1, dims, st
rides, | |
|
| $typemap(swiglal_dynarr_p
desc, TYPE), | | $typemap(swiglal_dynarr_i
sptr, TYPE), $typemap(swiglal_dynarr_tinfo, TYPE), | |
| $owner | %newpointer_flag
s)); | | $owner | %newpointer_flag
s)); | |
| } | | } | |
| } | | } | |
| | | | |
| // Clear unneeded typemaps and features. | | // Clear unneeded typemaps and features. | |
| %typemap(memberin, noblock=1) TYPE* DATA ""; | | %typemap(memberin, noblock=1) TYPE* DATA ""; | |
| %typemap(argout, noblock=1) TYPE* DATA ""; | | %typemap(argout, noblock=1) TYPE* DATA ""; | |
| %typemap(freearg, noblock=1) TYPE* DATA ""; | | %typemap(freearg, noblock=1) TYPE* DATA ""; | |
| %feature("action") DATA ""; | | %feature("action") DATA ""; | |
| %feature("except") DATA ""; | | %feature("except") DATA ""; | |
| | | | |
| skipping to change at line 680 | | skipping to change at line 707 | |
| TYPE *DATA; | | TYPE *DATA; | |
| } | | } | |
| | | | |
| // Restore modified typemaps and features. | | // Restore modified typemaps and features. | |
| %feature("action", "") DATA; | | %feature("action", "") DATA; | |
| %feature("except", "") DATA; | | %feature("except", "") DATA; | |
| %clear TYPE* DATA; | | %clear TYPE* DATA; | |
| | | | |
| %enddef // %swiglal_array_dynamic_1D() | | %enddef // %swiglal_array_dynamic_1D() | |
| // 2-D arrays: | | // 2-D arrays: | |
|
| %define %swiglal_array_dynamic_2D(TYPE, SIZET, DATA, NI, NJ, SI, SJ) | | %define %swiglal_array_dynamic_2D(NAME, TYPE, SIZET, DATA, NI, NJ, SI, SJ) | |
| | | | |
| // Create immutable members for the array's dimensions. | | | |
| %feature("action") NI {result = %static_cast(arg1->NI, SIZET);} | | | |
| %feature("action") NJ {result = %static_cast(arg1->NJ, SIZET);} | | | |
| %extend { | | | |
| const SIZET NI; | | | |
| const SIZET NJ; | | | |
| } | | | |
| %feature("action", "") NI; | | | |
| %feature("action", "") NJ; | | | |
| | | | |
| // Typemaps which convert to/from the dynamically-allocated array. | | // Typemaps which convert to/from the dynamically-allocated array. | |
| %typemap(in, noblock=1) TYPE* DATA { | | %typemap(in, noblock=1) TYPE* DATA { | |
| if (arg1) { | | if (arg1) { | |
|
| const size_t dims[] = {arg1->NI, arg1->NJ}; | | const size_t dims[] = {NI, NJ}; | |
| const size_t strides[] = {SI, SJ}; | | const size_t strides[] = {SI, SJ}; | |
|
| | | %swiglal_array_dynamic_check_strides(NAME, DATA, 1); | |
| | | %swiglal_array_dynamic_check_strides(NAME, DATA, 2); | |
| $1 = %reinterpret_cast(arg1->DATA, TYPE*); | | $1 = %reinterpret_cast(arg1->DATA, TYPE*); | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| int ecode = %swiglal_array_copyin($1_type)(swiglal_self(), $input, %a
s_voidptr($1), | | int ecode = %swiglal_array_copyin($1_type)(swiglal_self(), $input, %a
s_voidptr($1), | |
| sizeof(TYPE), 2, dims, str
ides, | | sizeof(TYPE), 2, dims, str
ides, | |
|
| $typemap(swiglal_dynarr_pd
esc, TYPE), | | $typemap(swiglal_dynarr_is
ptr, TYPE), $typemap(swiglal_dynarr_tinfo, TYPE), | |
| $disown | %convertptr_flag
s); | | $disown | %convertptr_flag
s); | |
| if (!SWIG_IsOK(ecode)) { | | if (!SWIG_IsOK(ecode)) { | |
| %argument_fail(ecode, "$type", $symname, $argnum); | | %argument_fail(ecode, "$type", $symname, $argnum); | |
| } | | } | |
| } | | } | |
| } | | } | |
| %typemap(out, noblock=1) TYPE* DATA { | | %typemap(out, noblock=1) TYPE* DATA { | |
| if (arg1) { | | if (arg1) { | |
|
| const size_t dims[] = {arg1->NI, arg1->NJ}; | | const size_t dims[] = {NI, NJ}; | |
| const size_t strides[] = {SI, SJ}; | | const size_t strides[] = {SI, SJ}; | |
|
| | | %swiglal_array_dynamic_check_strides(NAME, DATA, 1); | |
| | | %swiglal_array_dynamic_check_strides(NAME, DATA, 2); | |
| $1 = %reinterpret_cast(arg1->DATA, TYPE*); | | $1 = %reinterpret_cast(arg1->DATA, TYPE*); | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| %set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidp
tr($1), | | %set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidp
tr($1), | |
| sizeof(TYPE), 2, dims, st
rides, | | sizeof(TYPE), 2, dims, st
rides, | |
|
| $typemap(swiglal_dynarr_p
desc, TYPE), | | $typemap(swiglal_dynarr_i
sptr, TYPE), $typemap(swiglal_dynarr_tinfo, TYPE), | |
| $owner | %newpointer_flag
s)); | | $owner | %newpointer_flag
s)); | |
| } | | } | |
| } | | } | |
| | | | |
| // Clear unneeded typemaps and features. | | // Clear unneeded typemaps and features. | |
| %typemap(memberin, noblock=1) TYPE* DATA ""; | | %typemap(memberin, noblock=1) TYPE* DATA ""; | |
| %typemap(argout, noblock=1) TYPE* DATA ""; | | %typemap(argout, noblock=1) TYPE* DATA ""; | |
| %typemap(freearg, noblock=1) TYPE* DATA ""; | | %typemap(freearg, noblock=1) TYPE* DATA ""; | |
| %feature("action") DATA ""; | | %feature("action") DATA ""; | |
| %feature("except") DATA ""; | | %feature("except") DATA ""; | |
| | | | |
| skipping to change at line 741 | | skipping to change at line 762 | |
| } | | } | |
| | | | |
| // Restore modified typemaps and features. | | // Restore modified typemaps and features. | |
| %feature("action", "") DATA; | | %feature("action", "") DATA; | |
| %feature("except", "") DATA; | | %feature("except", "") DATA; | |
| %clear TYPE* DATA; | | %clear TYPE* DATA; | |
| | | | |
| %enddef // %swiglal_array_dynamic_2D() | | %enddef // %swiglal_array_dynamic_2D() | |
| | | | |
| // These macros should be called from within the definitions of | | // These macros should be called from within the definitions of | |
|
| // LAL structs containing dynamically-allocated arrays. | | // LAL structs NAME containing dynamically-allocated arrays. | |
| // 1-D arrays: | | // 1-D arrays, e.g: | |
| %define %swiglal_public_1D_ARRAY(TYPE, DATA, SIZET, NI) | | // SIZET NI; | |
| %swiglal_array_dynamic_1D(TYPE, SIZET, DATA, NI, 1); | | // TYPE* DATA; | |
| %ignore DATA; | | %define %swiglal_public_ARRAY_1D(NAME, TYPE, DATA, SIZET, NI) | |
| %ignore NI; | | %swiglal_array_dynamic_size(SIZET, NI); | |
| %enddef | | %swiglal_array_dynamic_1D(NAME, TYPE, SIZET, DATA, arg1->NI, 1); | |
| #define %swiglal_public_clear_1D_ARRAY(TYPE, DATA, SIZET, NI) | | %ignore DATA; | |
| // 2-D arrays: | | %ignore NI; | |
| %define %swiglal_public_2D_ARRAY(TYPE, DATA, SIZET, NI, NJ) | | %enddef | |
| %swiglal_array_dynamic_2D(TYPE, SIZET, DATA, NI, NJ, arg1->NJ, 1); | | #define %swiglal_public_clear_ARRAY_1D(NAME, TYPE, DATA, SIZET, NI) | |
| %ignore DATA; | | // 2-D arrays of fixed-length arrays, e.g: | |
| %ignore NI; | | // typedef ETYPE[NJ] ATYPE; | |
| %ignore NJ; | | // SIZET NI; | |
| | | // ATYPE* DATA; | |
| | | %define %swiglal_public_ARRAY_2D_FIXED(NAME, ETYPE, ATYPE, DATA, SIZET, NI) | |
| | | %swiglal_array_dynamic_size(SIZET, NI); | |
| | | %swiglal_array_dynamic_2D(NAME, ETYPE, SIZET, DATA, arg1->NI, (sizeof(ATY | |
| | | PE)/sizeof(ETYPE)), (sizeof(ATYPE)/sizeof(ETYPE)), 1); | |
| | | %ignore DATA; | |
| | | %ignore NI; | |
| | | %enddef | |
| | | #define %swiglal_public_clear_ARRAY_2D_FIXED(NAME, ETYPE, ATYPE, DATA, SIZE | |
| | | T, NI) | |
| | | // 2-D arrays, e.g: | |
| | | // SIZET NI, NJ; | |
| | | // TYPE* DATA; | |
| | | %define %swiglal_public_ARRAY_2D(NAME, TYPE, DATA, SIZET, NI, NJ) | |
| | | %swiglal_array_dynamic_size(SIZET, NI); | |
| | | %swiglal_array_dynamic_size(SIZET, NJ); | |
| | | %swiglal_array_dynamic_2D(NAME, TYPE, SIZET, DATA, arg1->NI, arg1->NJ, ar | |
| | | g1->NJ, 1); | |
| | | %ignore DATA; | |
| | | %ignore NI; | |
| | | %ignore NJ; | |
| %enddef | | %enddef | |
|
| #define %swiglal_public_clear_2D_ARRAY(TYPE, DATA, SIZET, NI, NJ) | | #define %swiglal_public_clear_ARRAY_2D(NAME, TYPE, DATA, SIZET, NI, NJ) | |
| | | | |
| ////////// Include scripting-language-specific interface headers ////////// | | ////////// Include scripting-language-specific interface headers ////////// | |
| | | | |
| #ifdef SWIGOCTAVE | | #ifdef SWIGOCTAVE | |
| %include <lal/swiglal_octave.i> | | %include <lal/swiglal_octave.i> | |
| #endif | | #endif | |
| #ifdef SWIGPYTHON | | #ifdef SWIGPYTHON | |
| %include <lal/swiglal_python.i> | | %include <lal/swiglal_python.i> | |
| #endif | | #endif | |
| | | | |
| ////////// General typemaps and macros ////////// | | ////////// General typemaps and macros ////////// | |
| | | | |
|
| | | // The SWIGLAL(RETURN_VOID(TYPE,...)) public macro can be used to ensure | |
| | | // that the return value of a function is always ignored. | |
| | | %define %swiglal_public_RETURN_VOID(TYPE, ...) | |
| | | %swiglal_map_ab(%swiglal_apply, SWIGTYPE SWIGLAL_RETURN_VOID, TYPE, __VA_AR | |
| | | GS__); | |
| | | %enddef | |
| | | %define %swiglal_public_clear_RETURN_VOID(TYPE, ...) | |
| | | %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | |
| | | %enddef | |
| | | %typemap(out, noblock=1) SWIGTYPE SWIGLAL_RETURN_VOID { | |
| | | %set_output(VOID_Object); | |
| | | } | |
| | | | |
| // The SWIGLAL(RETURN_VALUE(TYPE,...)) public macro can be used to ensure | | // The SWIGLAL(RETURN_VALUE(TYPE,...)) public macro can be used to ensure | |
| // that the return value of a function is not ignored, if the return value | | // that the return value of a function is not ignored, if the return value | |
| // has previously been ignored in the generated wrappings. | | // has previously been ignored in the generated wrappings. | |
| %define %swiglal_public_RETURN_VALUE(TYPE, ...) | | %define %swiglal_public_RETURN_VALUE(TYPE, ...) | |
| %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | | %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | |
| %enddef | | %enddef | |
| #define %swiglal_public_clear_RETURN_VALUE(TYPE, ...) | | #define %swiglal_public_clear_RETURN_VALUE(TYPE, ...) | |
| | | | |
| // The SWIGLAL(DISABLE_EXCEPTIONS(...)) public macro is useful for | | // The SWIGLAL(DISABLE_EXCEPTIONS(...)) public macro is useful for | |
| // functions which manipulate XLAL error codes, which thus require | | // functions which manipulate XLAL error codes, which thus require | |
| // XLAL exception handling to be disabled. | | // XLAL exception handling to be disabled. | |
| %define %swiglal_public_DISABLE_EXCEPTIONS(...) | | %define %swiglal_public_DISABLE_EXCEPTIONS(...) | |
| %swiglal_map_ab(%swiglal_feature, "except", "$action", __VA_ARGS__); | | %swiglal_map_ab(%swiglal_feature, "except", "$action", __VA_ARGS__); | |
| %enddef | | %enddef | |
| #define %swiglal_public_clear_DISABLE_EXCEPTIONS(...) | | #define %swiglal_public_clear_DISABLE_EXCEPTIONS(...) | |
| | | | |
|
| // The SWIGLAL(NO_NEW_OBJECT(...)) macro can be used to turn off | | | |
| // SWIG object ownership for certain functions. | | | |
| %define %swiglal_public_NO_NEW_OBJECT(...) | | | |
| %swiglal_map_ab(%swiglal_feature, "new", "0", __VA_ARGS__); | | | |
| %enddef | | | |
| #define %swiglal_public_clear_NO_NEW_OBJECT(...) | | | |
| | | | |
| // The SWIGLAL(FUNCTION_POINTER(...)) macro can be used to create | | // The SWIGLAL(FUNCTION_POINTER(...)) macro can be used to create | |
| // a function pointer constant, for functions which need to be used | | // a function pointer constant, for functions which need to be used | |
| // as callback functions. | | // as callback functions. | |
| %define %swiglal_public_FUNCTION_POINTER(...) | | %define %swiglal_public_FUNCTION_POINTER(...) | |
| %swiglal_map_ab(%swiglal_feature, "callback", "%sPtr", __VA_ARGS__); | | %swiglal_map_ab(%swiglal_feature, "callback", "%sPtr", __VA_ARGS__); | |
| %enddef | | %enddef | |
| #define %swiglal_public_clear_FUNCTION_POINTER(...) | | #define %swiglal_public_clear_FUNCTION_POINTER(...) | |
| | | | |
|
| // Typemap for functions which return 'int'. If these functions also return | | // The SWIGLAL(IMMUTABLE_MEMBERS(TAGNAME, ...)) macro can be used to make | |
| // other output arguments (via 'argout' typemaps), the 'int' return value i | | // the listed members of the struct TAGNAME immutable. | |
| s | | %define %swiglal_public_IMMUTABLE_MEMBERS(TAGNAME, ...) | |
| // ignored. This is because 'int' is very commonly used to return an XLAL | | %swiglal_map_abc(%swiglal_feature_nspace, "immutable", "1", TAGNAME, __VA_A | |
| // error code, which will be converted into a native scripting-language | | RGS__); | |
| // exception, and so the error code itself is not needed directly. To avoid | | %enddef | |
| // having to unpack the error code when collecting the other output argumen | | #define %swiglal_public_clear_IMMUTABLE_MEMBERS(...) | |
| ts, | | | |
| // therefore, it is ignored in the wrappings. Functions which fit this crit | | | |
| eria | | | |
| // but do return a useful 'int' can use SWIGLAL(RETURN_VALUE(int, ...)) to | | | |
| // disable this behaviour. | | | |
| // The 'newfree' typemap is used since its code will appear after all the | | | |
| // 'argout' typemaps, and will only apply to functions (since only function | | | |
| s | | | |
| // have %feature("new") set, and thus generate a 'newfree' typemap). The ma | | | |
| cro | | | |
| // %swiglal_maybe_drop_first_retval() is defined in the scripting-language- | | | |
| // specific interface headers; it will drop the first return value (which i | | | |
| s | | | |
| // the 'int') from the output argument list if the argument list contains | | | |
| // at least 2 items (the 'int' and some other output argument). | | | |
| %typemap(newfree, noblock=1, fragment="swiglal_maybe_drop_first_retval") in | | | |
| t { | | | |
| %swiglal_maybe_drop_first_retval(); | | | |
| } | | | |
| | | | |
| // Typemaps for empty arguments. These typemaps are useful when no input fr
om the | | // Typemaps for empty arguments. These typemaps are useful when no input fr
om the | |
| // scripting language is required, and an empty struct needs to be supplied
to | | // scripting language is required, and an empty struct needs to be supplied
to | |
| // the C function. The SWIGLAL(EMPTY_ARGUMENT(TYPE, ...)) macro applies the
typemap which | | // the C function. The SWIGLAL(EMPTY_ARGUMENT(TYPE, ...)) macro applies the
typemap which | |
| // supplies a static struct, while the SWIGLAL(NEW_EMPTY_ARGUMENT(TYPE, ...
)) macro | | // supplies a static struct, while the SWIGLAL(NEW_EMPTY_ARGUMENT(TYPE, ...
)) macro | |
| // applies the typemap which supplies a dynamically-allocated struct. | | // applies the typemap which supplies a dynamically-allocated struct. | |
| %define %swiglal_public_EMPTY_ARGUMENT(TYPE, ...) | | %define %swiglal_public_EMPTY_ARGUMENT(TYPE, ...) | |
| %swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT, TYPE, __V
A_ARGS__); | | %swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT, TYPE, __V
A_ARGS__); | |
| %enddef | | %enddef | |
| %define %swiglal_public_clear_EMPTY_ARGUMENT(TYPE, ...) | | %define %swiglal_public_clear_EMPTY_ARGUMENT(TYPE, ...) | |
| | | | |
| skipping to change at line 891 | | skipping to change at line 922 | |
| } | | } | |
| return ecode; | | return ecode; | |
| } | | } | |
| } | | } | |
| %typemaps_primitive(%checkcode(BOOL), BOOLEAN); | | %typemaps_primitive(%checkcode(BOOL), BOOLEAN); | |
| | | | |
| // Fragments and typemaps for LAL strings, which should be (de)allocated | | // Fragments and typemaps for LAL strings, which should be (de)allocated | |
| // using LAL memory functions. The fragments re-use existing scriping-langu
age | | // using LAL memory functions. The fragments re-use existing scriping-langu
age | |
| // conversion functions for ordinary char* strings. Appropriate typemaps ar
e | | // conversion functions for ordinary char* strings. Appropriate typemaps ar
e | |
| // then generated by %typemaps_string_alloc(), with custom memory allocator
s. | | // then generated by %typemaps_string_alloc(), with custom memory allocator
s. | |
|
| %fragment("SWIG_FromLALCHARPtrAndSize", "header", fragment="SWIG_FromCharPt | | %fragment("SWIG_FromLALcharPtrAndSize", "header", fragment="SWIG_FromCharPt | |
| rAndSize") { | | rAndSize") { | |
| SWIGINTERNINLINE SWIG_Object SWIG_FromLALCHARPtrAndSize(const CHAR *str, | | SWIGINTERNINLINE SWIG_Object SWIG_FromLALcharPtrAndSize(const char *str, | |
| size_t size) { | | size_t size) { | |
| return SWIG_FromCharPtrAndSize(str, size); | | return SWIG_FromCharPtrAndSize(str, size); | |
| } | | } | |
| } | | } | |
|
| %fragment("SWIG_AsLALCHARPtrAndSize", "header", fragment="SWIG_AsCharPtrAnd | | %fragment("SWIG_AsLALcharPtrAndSize", "header", fragment="SWIG_AsCharPtrAnd | |
| Size") { | | Size") { | |
| SWIGINTERN int SWIG_AsLALCHARPtrAndSize(SWIG_Object obj, CHAR **pstr, siz | | SWIGINTERN int SWIG_AsLALcharPtrAndSize(SWIG_Object obj, char **pstr, siz | |
| e_t *psize, int *alloc) { | | e_t *psize, int *alloc) { | |
| char *slstr = 0; | | char *slstr = 0; | |
| size_t slsize = 0; | | size_t slsize = 0; | |
| int slalloc = 0; | | int slalloc = 0; | |
| // Get pointer to scripting-language string 'slstr' and size 'slsize'. | | // Get pointer to scripting-language string 'slstr' and size 'slsize'. | |
| // The 'slalloc' argument indicates whether a new string was allocated. | | // The 'slalloc' argument indicates whether a new string was allocated. | |
| int ecode = SWIG_AsCharPtrAndSize(obj, &slstr, &slsize, &slalloc); | | int ecode = SWIG_AsCharPtrAndSize(obj, &slstr, &slsize, &slalloc); | |
| if (!SWIG_IsOK(ecode)) { | | if (!SWIG_IsOK(ecode)) { | |
| return SWIG_TypeError; | | return SWIG_TypeError; | |
| } | | } | |
| // Return the string, if needed. | | // Return the string, if needed. | |
| if (pstr) { | | if (pstr) { | |
| // Free the LAL string if it is already allocated. | | // Free the LAL string if it is already allocated. | |
| if (*pstr) { | | if (*pstr) { | |
| XLALFree(*pstr); | | XLALFree(*pstr); | |
| } | | } | |
| if (alloc) { | | if (alloc) { | |
| // Copy the scripting-language string into a LAL-managed memory str
ing. | | // Copy the scripting-language string into a LAL-managed memory str
ing. | |
|
| *pstr = %swiglal_new_copy_array(slstr, slsize, CHAR); | | *pstr = %swiglal_new_copy_array(slstr, slsize, char); | |
| *alloc = SWIG_NEWOBJ; | | *alloc = SWIG_NEWOBJ; | |
| } | | } | |
| else { | | else { | |
| return SWIG_TypeError; | | return SWIG_TypeError; | |
| } | | } | |
| } | | } | |
| // Return the size (length+1) of the string, if needed. | | // Return the size (length+1) of the string, if needed. | |
| if (psize) { | | if (psize) { | |
| *psize = slsize; | | *psize = slsize; | |
| } | | } | |
| // Free the scripting-language string, if it was allocated. | | // Free the scripting-language string, if it was allocated. | |
| if (slalloc == SWIG_NEWOBJ) { | | if (slalloc == SWIG_NEWOBJ) { | |
| %delete_array(slstr); | | %delete_array(slstr); | |
| } | | } | |
| return ecode; | | return ecode; | |
| } | | } | |
| } | | } | |
|
| %fragment("SWIG_AsNewLALCHARPtr", "header", fragment="SWIG_AsLALCHARPtrAndS | | %fragment("SWIG_AsNewLALcharPtr", "header", fragment="SWIG_AsLALcharPtrAndS | |
| ize") { | | ize") { | |
| SWIGINTERN int SWIG_AsNewLALCHARPtr(SWIG_Object obj, CHAR **pstr) { | | SWIGINTERN int SWIG_AsNewLALcharPtr(SWIG_Object obj, char **pstr) { | |
| int alloc = 0; | | int alloc = 0; | |
|
| return SWIG_AsLALCHARPtrAndSize(obj, pstr, 0, &alloc); | | return SWIG_AsLALcharPtrAndSize(obj, pstr, 0, &alloc); | |
| } | | } | |
| } | | } | |
|
| %typemaps_string_alloc(%checkcode(STRING), %checkcode(CHAR), CHAR, LALCHAR, | | %typemaps_string_alloc(%checkcode(STRING), %checkcode(char), char, LALchar, | |
| SWIG_AsLALCHARPtrAndSize, SWIG_FromLALCHARPtrAndSize | | SWIG_AsLALcharPtrAndSize, SWIG_FromLALcharPtrAndSize | |
| , | | , | |
| strlen, %swiglal_new_copy_array, XLALFree, | | strlen, %swiglal_new_copy_array, XLALFree, | |
| "<limits.h>", CHAR_MIN, CHAR_MAX); | | "<limits.h>", CHAR_MIN, CHAR_MAX); | |
| | | | |
|
| // Do not try to free const CHAR* return arguments. | | // Typemaps for string pointers. By default, treat arguments of type char* | |
| %typemap(newfree,noblock=1) const CHAR* ""; | | * | |
| | | // as output-only arguments, which do not require a scripting-language inpu | |
| | | t | |
| | | // argument, and return their results in the output argument list. Also | |
| | | // supply an INOUT typemap for input-output arguments, which allows a | |
| | | // scripting-language input string to be supplied. The INOUT typemaps can b | |
| | | e | |
| | | // applied as needed using the SWIGLAL(INOUT_STRINGS(...)) macro. | |
| | | %typemap(in, noblock=1, numinputs=0) char ** (char *str = NULL, int alloc = | |
| | | 0) { | |
| | | $1 = %reinterpret_cast(&str, $ltype); | |
| | | alloc = 0; | |
| | | } | |
| | | %typemap(in, noblock=1, fragment="SWIG_AsLALcharPtrAndSize") char ** INOUT | |
| | | (char *str = NULL, int alloc = 0, int ecode = 0) { | |
| | | ecode = SWIG_AsLALcharPtr($input, &str, &alloc); | |
| | | if (!SWIG_IsOK(ecode)) { | |
| | | %argument_fail(ecode, "$type", $symname, $argnum); | |
| | | } | |
| | | $1 = %reinterpret_cast(&str, $ltype); | |
| | | } | |
| | | %typemap(argout, noblock=1) char ** { | |
| | | %append_output(SWIG_FromLALcharPtr(str$argnum)); | |
| | | } | |
| | | %typemap(freearg, match="in") char ** { | |
| | | if (SWIG_IsNewObj(alloc$argnum)) { | |
| | | XLALFree(str$argnum); | |
| | | } | |
| | | } | |
| | | %define %swiglal_public_INOUT_STRINGS(...) | |
| | | %swiglal_map_ab(%swiglal_apply, char ** INOUT, char **, __VA_ARGS__); | |
| | | %enddef | |
| | | %define %swiglal_public_clear_INOUT_STRINGS(...) | |
| | | %swiglal_map_a(%swiglal_clear, char **, __VA_ARGS__); | |
| | | %enddef | |
| | | | |
| | | // Do not try to free const char* return arguments. | |
| | | %typemap(newfree,noblock=1) const char* ""; | |
| | | | |
| | | // Input typemap for pointer-to-const SWIGTYPEs. This typemap is identical | |
| | | to the | |
| | | // standard SWIGTYPE pointer typemap, except $disown is commented out. This | |
| | | prevents | |
| | | // SWIG transferring ownership of SWIG-wrapped objects when assigning to po | |
| | | inter-to-const | |
| | | // members of structs. In this case, it is assumed that the struct does not | |
| | | want to take | |
| | | // ownership of the pointer, since it cannot free it (since it is a pointer | |
| | | -to-const). | |
| | | %typemap(in,noblock=1) const SWIGTYPE * (void *argp = 0, int res = 0) { | |
| | | res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 /*$disown*/ | %conver | |
| | | tptr_flags); | |
| | | if (!SWIG_IsOK(res)) { | |
| | | %argument_fail(res, "$type", $symname, $argnum); | |
| | | } | |
| | | $1 = %reinterpret_cast(argp, $ltype); | |
| | | } | |
| | | %typemap(freearg) const SWIGTYPE * ""; | |
| | | | |
| // Typemap for output SWIGTYPEs. This typemaps will match either the SWIG-w
rapped | | // Typemap for output SWIGTYPEs. This typemaps will match either the SWIG-w
rapped | |
| // return argument from functions (which will have the SWIG_POINTER_OWN bit
set | | // return argument from functions (which will have the SWIG_POINTER_OWN bit
set | |
| // in $owner) or return a member of a struct through a 'get' functions (in
which | | // in $owner) or return a member of a struct through a 'get' functions (in
which | |
| // case SWIG_POINTER_OWN will not be set). If it is the latter case, the fu
nction | | // case SWIG_POINTER_OWN will not be set). If it is the latter case, the fu
nction | |
| // swiglal_store_parent() is called to store a reference to the struct cont
aining | | // swiglal_store_parent() is called to store a reference to the struct cont
aining | |
| // the member being accessed, in order to prevent it from being destroyed a
s long | | // the member being accessed, in order to prevent it from being destroyed a
s long | |
| // as the SWIG-wrapped member object is in scope. The return object is then
always | | // as the SWIG-wrapped member object is in scope. The return object is then
always | |
| // created with SWIG_POINTER_OWN, so that its destructor will always be cal
led. | | // created with SWIG_POINTER_OWN, so that its destructor will always be cal
led. | |
|
| %define %swiglal_store_parent(PTR, OWNER) | | %define %swiglal_store_parent(PTR, OWNER, SELF) | |
| %#if !(OWNER & SWIG_POINTER_OWN) | | %#if !(OWNER & SWIG_POINTER_OWN) | |
| if (%as_voidptr(PTR) != NULL) { | | if (%as_voidptr(PTR) != NULL) { | |
|
| swiglal_store_parent(%as_voidptr(PTR), swiglal_self()); | | swiglal_store_parent(%as_voidptr(PTR), SELF); | |
| } | | } | |
| %#endif | | %#endif | |
| %enddef | | %enddef | |
| %typemap(out,noblock=1) SWIGTYPE *, SWIGTYPE &, SWIGTYPE[] { | | %typemap(out,noblock=1) SWIGTYPE *, SWIGTYPE &, SWIGTYPE[] { | |
|
| %swiglal_store_parent($1, $owner); | | %swiglal_store_parent($1, $owner, swiglal_self()); | |
| %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %n
ewpointer_flags) | SWIG_POINTER_OWN)); | | %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %n
ewpointer_flags) | SWIG_POINTER_OWN)); | |
| } | | } | |
| %typemap(out,noblock=1) const SWIGTYPE *, const SWIGTYPE &, const SWIGTYPE[
] { | | %typemap(out,noblock=1) const SWIGTYPE *, const SWIGTYPE &, const SWIGTYPE[
] { | |
| %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %n
ewpointer_flags) & ~SWIG_POINTER_OWN)); | | %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %n
ewpointer_flags) & ~SWIG_POINTER_OWN)); | |
| } | | } | |
| %typemap(out, noblock=1) SWIGTYPE *const& { | | %typemap(out, noblock=1) SWIGTYPE *const& { | |
|
| %swiglal_store_parent(*$1, $owner); | | %swiglal_store_parent(*$1, $owner, swiglal_self()); | |
| %set_output(SWIG_NewPointerObj(%as_voidptr(*$1), $*descriptor, ($owner |
%newpointer_flags) | SWIG_POINTER_OWN)); | | %set_output(SWIG_NewPointerObj(%as_voidptr(*$1), $*descriptor, ($owner |
%newpointer_flags) | SWIG_POINTER_OWN)); | |
| } | | } | |
| %typemap(out, noblock=1) const SWIGTYPE *const& { | | %typemap(out, noblock=1) const SWIGTYPE *const& { | |
| %set_output(SWIG_NewPointerObj(%as_voidptr(*$1), $*descriptor, ($owner |
%newpointer_flags) & ~SWIG_POINTER_OWN)); | | %set_output(SWIG_NewPointerObj(%as_voidptr(*$1), $*descriptor, ($owner |
%newpointer_flags) & ~SWIG_POINTER_OWN)); | |
| } | | } | |
| %typemap(out, noblock=1) SWIGTYPE (void* copy = NULL) { | | %typemap(out, noblock=1) SWIGTYPE (void* copy = NULL) { | |
| copy = %swiglal_new_copy($1, $ltype); | | copy = %swiglal_new_copy($1, $ltype); | |
|
| %swiglal_store_parent(copy, SWIG_POINTER_OWN); | | %swiglal_store_parent(copy, SWIG_POINTER_OWN, swiglal_self()); | |
| %set_output(SWIG_NewPointerObj(copy, $&descriptor, (%newpointer_flags) |
SWIG_POINTER_OWN)); | | %set_output(SWIG_NewPointerObj(copy, $&descriptor, (%newpointer_flags) |
SWIG_POINTER_OWN)); | |
| } | | } | |
| %typemap(varout, noblock=1) SWIGTYPE *, SWIGTYPE [] { | | %typemap(varout, noblock=1) SWIGTYPE *, SWIGTYPE [] { | |
| %set_varoutput(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, (%newpoin
ter_flags) & ~SWIG_POINTER_OWN)); | | %set_varoutput(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, (%newpoin
ter_flags) & ~SWIG_POINTER_OWN)); | |
| } | | } | |
| %typemap(varout, noblock=1) SWIGTYPE & { | | %typemap(varout, noblock=1) SWIGTYPE & { | |
| %set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $descriptor, (%newpoi
nter_flags) & ~SWIG_POINTER_OWN)); | | %set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $descriptor, (%newpoi
nter_flags) & ~SWIG_POINTER_OWN)); | |
| } | | } | |
| %typemap(varout, noblock=1) SWIGTYPE { | | %typemap(varout, noblock=1) SWIGTYPE { | |
| %set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $&descriptor, (%newpo
inter_flags) & ~SWIG_POINTER_OWN)); | | %set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $&descriptor, (%newpo
inter_flags) & ~SWIG_POINTER_OWN)); | |
| } | | } | |
| | | | |
|
| | | // The SWIGLAL(GET_OBJECT(...)) macro is used when a function returns an ob | |
| | | ject whose | |
| | | // memory is owned by the object supplied as the first argument to the func | |
| | | tion. | |
| | | // Typically this occurs when the function is returning some property of it | |
| | | s first | |
| | | // argument. The macro applies a typemap which calles swiglal_store_parent( | |
| | | ) to store | |
| | | // a reference to the first argument as the 'parent' of the return argument | |
| | | , so that | |
| | | // the parent will not be destroyed as long as the return value is in scope | |
| | | . | |
| | | %define %swiglal_public_GET_OBJECT(TYPE, ...) | |
| | | %swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_GET_OBJECT, TYPE, __VA_AR | |
| | | GS__); | |
| | | %enddef | |
| | | %define %swiglal_public_clear_GET_OBJECT(TYPE, ...) | |
| | | %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | |
| | | %enddef | |
| | | %typemap(out,noblock=1) SWIGTYPE* SWIGLAL_GET_OBJECT { | |
| | | %swiglal_store_parent($1, 0, swiglal_1starg()); | |
| | | %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %n | |
| | | ewpointer_flags) | SWIG_POINTER_OWN)); | |
| | | } | |
| | | | |
| // Typemaps for pointers to primitive scalars. These are treated as output-
only | | // Typemaps for pointers to primitive scalars. These are treated as output-
only | |
| // arguments by default, by globally applying the SWIG OUTPUT typemaps. The
INOUT | | // arguments by default, by globally applying the SWIG OUTPUT typemaps. The
INOUT | |
| // typemaps can be supplied as needed using the SWIGLAL(INOUT_SCALARS(TYPE,
...)) macro. | | // typemaps can be supplied as needed using the SWIGLAL(INOUT_SCALARS(TYPE,
...)) macro. | |
| %apply int* OUTPUT { enum SWIGTYPE* }; | | %apply int* OUTPUT { enum SWIGTYPE* }; | |
| %apply short* OUTPUT { short* }; | | %apply short* OUTPUT { short* }; | |
| %apply unsigned short* OUTPUT { unsigned short* }; | | %apply unsigned short* OUTPUT { unsigned short* }; | |
| %apply int* OUTPUT { int* }; | | %apply int* OUTPUT { int* }; | |
| %apply unsigned int* OUTPUT { unsigned int* }; | | %apply unsigned int* OUTPUT { unsigned int* }; | |
| %apply long* OUTPUT { long* }; | | %apply long* OUTPUT { long* }; | |
| %apply unsigned long* OUTPUT { unsigned long* }; | | %apply unsigned long* OUTPUT { unsigned long* }; | |
| | | | |
| skipping to change at line 1056 | | skipping to change at line 1150 | |
| %define %swiglal_public_INOUT_STRUCTS(TYPE, ...) | | %define %swiglal_public_INOUT_STRUCTS(TYPE, ...) | |
| %swiglal_map_ab(%swiglal_apply, SWIGTYPE ** INOUT, TYPE, __VA_ARGS__); | | %swiglal_map_ab(%swiglal_apply, SWIGTYPE ** INOUT, TYPE, __VA_ARGS__); | |
| %enddef | | %enddef | |
| %define %swiglal_public_clear_INOUT_STRUCTS(TYPE, ...) | | %define %swiglal_public_clear_INOUT_STRUCTS(TYPE, ...) | |
| %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | | %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | |
| %enddef | | %enddef | |
| | | | |
| // Make the wrapping of printf-style LAL functions a little safer, as sugge
sted in | | // Make the wrapping of printf-style LAL functions a little safer, as sugge
sted in | |
| // the SWIG 2.0 documentation (section 13.5). These functions should now be
safely | | // the SWIG 2.0 documentation (section 13.5). These functions should now be
safely | |
| // able to print any string, so long as the format string is named "format"
or "fmt". | | // able to print any string, so long as the format string is named "format"
or "fmt". | |
|
| %typemap(in, fragment="SWIG_AsCharPtrAndSize") (const char *SWIGLAL_PRINTF_
FORMAT, ...) | | %typemap(in, fragment="SWIG_AsLALcharPtrAndSize") (const char *SWIGLAL_PRIN
TF_FORMAT, ...) | |
| (char fmt[] = "%s", char *str = 0, int alloc = 0) | | (char fmt[] = "%s", char *str = 0, int alloc = 0) | |
| { | | { | |
| $1 = fmt; | | $1 = fmt; | |
|
| int ecode = SWIG_AsCharPtrAndSize($input, &str, NULL, &alloc); | | int ecode = SWIG_AsLALcharPtr($input, &str, &alloc); | |
| if (!SWIG_IsOK(ecode)) { | | if (!SWIG_IsOK(ecode)) { | |
|
| %argument_fail(ecode, "const char*, ...", $symname, $argnum); | | %argument_fail(ecode, "$type", $symname, $argnum); | |
| } | | } | |
| $2 = (void *) str; | | $2 = (void *) str; | |
| } | | } | |
| %typemap(freearg, match="in") (const char *format, ...) { | | %typemap(freearg, match="in") (const char *format, ...) { | |
| if (SWIG_IsNewObj(alloc$argnum)) { | | if (SWIG_IsNewObj(alloc$argnum)) { | |
|
| %delete_array(str$argnum); | | XLALFree(str$argnum); | |
| } | | } | |
| } | | } | |
| %apply (const char *SWIGLAL_PRINTF_FORMAT, ...) { | | %apply (const char *SWIGLAL_PRINTF_FORMAT, ...) { | |
| (const char *format, ...), (const char *fmt, ...) | | (const char *format, ...), (const char *fmt, ...) | |
| }; | | }; | |
| | | | |
| // This macro supports functions which require a variable-length | | // This macro supports functions which require a variable-length | |
| // list of arguments of type TYPE, i.e. a list of strings. It | | // list of arguments of type TYPE, i.e. a list of strings. It | |
| // generates SWIG "compact" default arguments, i.e. only one | | // generates SWIG "compact" default arguments, i.e. only one | |
| // wrapping function where all missing arguments are assigned ENDVALUE, | | // wrapping function where all missing arguments are assigned ENDVALUE, | |
| | | | |
End of changes. 73 change blocks. |
| 157 lines changed or deleted | | 271 lines changed or added | |
|
| swiglal_octave.i | | swiglal_octave.i | |
| | | | |
| skipping to change at line 57 | | skipping to change at line 57 | |
| #include <octave/toplev.h> | | #include <octave/toplev.h> | |
| }%} | | }%} | |
| | | | |
| // Name of octave_value containing the SWIG wrapping of the 'this' | | // Name of octave_value containing the SWIG wrapping of the 'this' | |
| // pointer, i.e. the struct whose members are being accessed. | | // pointer, i.e. the struct whose members are being accessed. | |
| %header %{ | | %header %{ | |
| #define swiglal_self() (args.length() > 0 ? args(0) : octave_value()) | | #define swiglal_self() (args.length() > 0 ? args(0) : octave_value()) | |
| #define swiglal_no_self() octave_value() | | #define swiglal_no_self() octave_value() | |
| %} | | %} | |
| | | | |
|
| | | // Name of octave_value containing the SWIG wrapping of the | |
| | | // first argument to a function. | |
| | | %header %{ | |
| | | #define swiglal_1starg() (args.length() > 0 ? args(0) : octave_value()) | |
| | | %} | |
| | | | |
| ////////// SWIG directives for operators ////////// | | ////////// SWIG directives for operators ////////// | |
| | | | |
| // Unary operators which return a new object, and thus | | // Unary operators which return a new object, and thus | |
| // require %newobject to be set. | | // require %newobject to be set. | |
| %define %swiglal_oct_urn_op(NAME, OCTNAME) | | %define %swiglal_oct_urn_op(NAME, OCTNAME) | |
| %rename(__##OCTNAME##__) *::__##NAME##__; | | %rename(__##OCTNAME##__) *::__##NAME##__; | |
| %newobject *::__##NAME##__; | | %newobject *::__##NAME##__; | |
| %enddef | | %enddef | |
| %swiglal_oct_urn_op(abs, abs); | | %swiglal_oct_urn_op(abs, abs); | |
| %swiglal_oct_urn_op(neg, uminus); | | %swiglal_oct_urn_op(neg, uminus); | |
| | | | |
| skipping to change at line 88 | | skipping to change at line 94 | |
| %swiglal_oct_bin_op(lshift); | | %swiglal_oct_bin_op(lshift); | |
| %swiglal_oct_bin_op(mod); | | %swiglal_oct_bin_op(mod); | |
| %swiglal_oct_bin_op(mul); | | %swiglal_oct_bin_op(mul); | |
| %swiglal_oct_bin_op(or); | | %swiglal_oct_bin_op(or); | |
| %swiglal_oct_bin_op(rshift); | | %swiglal_oct_bin_op(rshift); | |
| %swiglal_oct_bin_op(sub); | | %swiglal_oct_bin_op(sub); | |
| %swiglal_oct_bin_op(xor); | | %swiglal_oct_bin_op(xor); | |
| | | | |
| ////////// General fragments, typemaps, and macros ////////// | | ////////// General fragments, typemaps, and macros ////////// | |
| | | | |
|
| // Helper fragment and macro for typemap for functions which return 'int'. | | | |
| // Drops the first return value (which is the 'int') from the output argume | | | |
| nt | | | |
| // list if the argument list contains at least 2 items (the 'int' and some | | | |
| // other output argument). | | | |
| %fragment("swiglal_maybe_drop_first_retval", "header") { | | | |
| SWIGINTERNINLINE void swiglal_maybe_drop_first_retval(octave_value_list& | | | |
| out) { | | | |
| if (out.length() > 1) { | | | |
| out = out.slice(1, out.length()-1); | | | |
| } | | | |
| } | | | |
| } | | | |
| #define %swiglal_maybe_drop_first_retval() \ | | | |
| swiglal_maybe_drop_first_retval(*_outp) | | | |
| | | | |
| // SWIG conversion fragments and typemaps for GSL complex numbers. | | // SWIG conversion fragments and typemaps for GSL complex numbers. | |
| %swig_cplxflt_convn(gsl_complex_float, gsl_complex_float_rect, GSL_REAL, GS
L_IMAG); | | %swig_cplxflt_convn(gsl_complex_float, gsl_complex_float_rect, GSL_REAL, GS
L_IMAG); | |
| %swig_cplxdbl_convn(gsl_complex, gsl_complex_rect, GSL_REAL, GSL_IMAG); | | %swig_cplxdbl_convn(gsl_complex, gsl_complex_rect, GSL_REAL, GSL_IMAG); | |
| %typemaps_primitive(%checkcode(CPLXFLT), gsl_complex_float); | | %typemaps_primitive(%checkcode(CPLXFLT), gsl_complex_float); | |
| %typemaps_primitive(%checkcode(CPLXDBL), gsl_complex); | | %typemaps_primitive(%checkcode(CPLXDBL), gsl_complex); | |
| | | | |
| // SWIG conversion fragments and typemaps for LAL complex numbers. | | // SWIG conversion fragments and typemaps for LAL complex numbers. | |
|
| %swig_cplxflt_convn(COMPLEX8, CX8rect, CX8re, CX8im); | | %swig_cplxflt_convn(COMPLEX8, COMPLEX8, std::real, std::imag); | |
| %swig_cplxdbl_convn(COMPLEX16, CX16rect, CX16re, CX16im); | | %swig_cplxdbl_convn(COMPLEX16, COMPLEX16, std::real, std::imag); | |
| %typemaps_primitive(%checkcode(CPLXFLT), COMPLEX8); | | %typemaps_primitive(%checkcode(CPLXFLT), COMPLEX8); | |
| %typemaps_primitive(%checkcode(CPLXDBL), COMPLEX16); | | %typemaps_primitive(%checkcode(CPLXDBL), COMPLEX16); | |
| | | | |
| // Typemaps which convert to/from the C broken-down date/time struct. | | // Typemaps which convert to/from the C broken-down date/time struct. | |
| %typemap(in) struct tm* (struct tm temptm) { | | %typemap(in) struct tm* (struct tm temptm) { | |
| | | | |
| // Set 'tm' struct to zero | | // Set 'tm' struct to zero | |
| memset(&temptm, 0, sizeof(temptm)); | | memset(&temptm, 0, sizeof(temptm)); | |
| | | | |
| if (!$input.is_empty()) { | | if (!$input.is_empty()) { | |
| | | | |
| skipping to change at line 305 | | skipping to change at line 297 | |
| // struct goes out of scope by the array view remains. | | // struct goes out of scope by the array view remains. | |
| const octave_value sloav_parent; | | const octave_value sloav_parent; | |
| | | | |
| // Parameters of the C array data being viewed, | | // Parameters of the C array data being viewed, | |
| // and associated SWIG type information. | | // and associated SWIG type information. | |
| void *const sloav_ptr; | | void *const sloav_ptr; | |
| const size_t sloav_esize; | | const size_t sloav_esize; | |
| const size_t sloav_ndims; | | const size_t sloav_ndims; | |
| const dim_vector sloav_dims; | | const dim_vector sloav_dims; | |
| const dim_vector sloav_strides; | | const dim_vector sloav_strides; | |
|
| | | const bool sloav_isptr; | |
| swig_type_info *const sloav_tinfo; | | swig_type_info *const sloav_tinfo; | |
| const int sloav_tflags; | | const int sloav_tflags; | |
| | | | |
| // Construct an Octave dim_vector from a C array. | | // Construct an Octave dim_vector from a C array. | |
| static dim_vector sloav_make_dim_vector(const size_t n, const size_t
v[]) { | | static dim_vector sloav_make_dim_vector(const size_t n, const size_t
v[]) { | |
| dim_vector dv(n, 1); | | dim_vector dv(n, 1); | |
| for (size_t i = 0; i < n; ++i) { | | for (size_t i = 0; i < n; ++i) { | |
| dv(i) = v[i]; | | dv(i) = v[i]; | |
| } | | } | |
| return dv; | | return dv; | |
| | | | |
| skipping to change at line 345 | | skipping to change at line 338 | |
| for (int j = sloav_ndims-1; j >= 0; --j) { | | for (int j = sloav_ndims-1; j >= 0; --j) { | |
| if (++idx(j) < sloav_dims(j)) { | | if (++idx(j) < sloav_dims(j)) { | |
| break; | | break; | |
| } | | } | |
| idx(j) = 0; | | idx(j) = 0; | |
| } | | } | |
| } | | } | |
| | | | |
| public: | | public: | |
| | | | |
|
| | | virtual ~swiglal_oct_array_view() | |
| | | { } | |
| | | | |
| swiglal_oct_array_view() | | swiglal_oct_array_view() | |
| : octave_base_value(), sloav_parent(), | | : octave_base_value(), sloav_parent(), | |
| sloav_ptr(0), sloav_esize(0), sloav_ndims(0), | | sloav_ptr(0), sloav_esize(0), sloav_ndims(0), | |
| sloav_dims(), sloav_strides(), | | sloav_dims(), sloav_strides(), | |
|
| sloav_tinfo(0), sloav_tflags(0) | | sloav_isptr(false), sloav_tinfo(0), sloav_tflags(0) | |
| { } | | { } | |
| | | | |
| swiglal_oct_array_view(const octave_value& parent, | | swiglal_oct_array_view(const octave_value& parent, | |
| void* ptr, | | void* ptr, | |
| const size_t esize, | | const size_t esize, | |
| const size_t ndims, | | const size_t ndims, | |
| const size_t dims[], | | const size_t dims[], | |
| const size_t strides[], | | const size_t strides[], | |
|
| | | const bool isptr, | |
| swig_type_info* tinfo, | | swig_type_info* tinfo, | |
| const int tflags) | | const int tflags) | |
| : octave_base_value(), sloav_parent(parent), | | : octave_base_value(), sloav_parent(parent), | |
| sloav_ptr(ptr), sloav_esize(esize), sloav_ndims(ndims), | | sloav_ptr(ptr), sloav_esize(esize), sloav_ndims(ndims), | |
| sloav_dims(sloav_make_dim_vector(ndims, dims)), | | sloav_dims(sloav_make_dim_vector(ndims, dims)), | |
| sloav_strides(sloav_make_dim_vector(ndims, strides)), | | sloav_strides(sloav_make_dim_vector(ndims, strides)), | |
|
| sloav_tinfo(tinfo), sloav_tflags(tflags) | | sloav_isptr(isptr), sloav_tinfo(tinfo), sloav_tflags(tflags) | |
| { } | | { } | |
| | | | |
| // Copy the Octave array obj to the C array. | | // Copy the Octave array obj to the C array. | |
| int sloav_array_in(octave_value& obj) { | | int sloav_array_in(octave_value& obj) { | |
| | | | |
| // Check that C array is non-NULL. | | // Check that C array is non-NULL. | |
| if (!sloav_ptr) { | | if (!sloav_ptr) { | |
| return SWIG_MemoryError; | | return SWIG_MemoryError; | |
| } | | } | |
| | | | |
| // Check that Octave array dimensions are consistent with C array d
imensions. | | // Check that Octave array dimensions are consistent with C array d
imensions. | |
| // 1-D arrays are a special case, since Octave arrays are always at
least | | // 1-D arrays are a special case, since Octave arrays are always at
least | |
| // 2-dimensional, so need to check that one of those dimensions is
singular. | | // 2-dimensional, so need to check that one of those dimensions is
singular. | |
| dim_vector objdims = obj.dims(); | | dim_vector objdims = obj.dims(); | |
| if (sloav_ndims == 1) { | | if (sloav_ndims == 1) { | |
|
| if (objdims.length() > 2 || objdims.num_ones() > 1 || objdims.num
el() != sloav_dims(0)) { | | if (objdims.length() > 2 || objdims.num_ones() == 0 || objdims.nu
mel() != sloav_dims(0)) { | |
| return SWIG_ValueError; | | return SWIG_ValueError; | |
| } | | } | |
| } | | } | |
| else if (objdims != sloav_dims) { | | else if (objdims != sloav_dims) { | |
| return SWIG_ValueError; | | return SWIG_ValueError; | |
| } | | } | |
| | | | |
| // Iterate over all elements in the C array. | | // Iterate over all elements in the C array. | |
| Array<octave_idx_type> idx(dim_vector(1, sloav_ndims), 0); | | Array<octave_idx_type> idx(dim_vector(1, sloav_ndims), 0); | |
| std::list<octave_value_list> objidx(1); | | std::list<octave_value_list> objidx(1); | |
| for (int i = 0; i < objdims.numel(); ++i) { | | for (int i = 0; i < objdims.numel(); ++i) { | |
| | | | |
| // Get the scalar index of the Octave array element, and the elem
ent itself. | | // Get the scalar index of the Octave array element, and the elem
ent itself. | |
| objidx.front()(0) = get_scalar_idx(idx, objdims) + 1; | | objidx.front()(0) = get_scalar_idx(idx, objdims) + 1; | |
| octave_value objelem = obj.subsref(obj.is_cell() ? "{" : "(", obj
idx); | | octave_value objelem = obj.subsref(obj.is_cell() ? "{" : "(", obj
idx); | |
| | | | |
| // Copy the Octave array element to the C array. | | // Copy the Octave array element to the C array. | |
|
| int ecode = HELPER::incall(sloav_parent, objelem, sloav_get_eleme
nt_ptr(idx), sloav_esize, sloav_tinfo, sloav_tflags); | | int ecode = HELPER::incall(sloav_parent, objelem, sloav_get_eleme
nt_ptr(idx), sloav_esize, sloav_isptr, sloav_tinfo, sloav_tflags); | |
| if (!SWIG_IsOK(ecode)) { | | if (!SWIG_IsOK(ecode)) { | |
| return ecode; | | return ecode; | |
| } | | } | |
| | | | |
| // Increment the Octave array index. | | // Increment the Octave array index. | |
| sloav_increment_idx(idx); | | sloav_increment_idx(idx); | |
| | | | |
| } | | } | |
| | | | |
| return SWIG_OK; | | return SWIG_OK; | |
| | | | |
| } | | } | |
| | | | |
| // Copy the C array to the returned Octave array. | | // Copy the C array to the returned Octave array. | |
| octave_value sloav_array_out() const { | | octave_value sloav_array_out() const { | |
| | | | |
|
| // Check that C array is non-NULL. | | | |
| if (!sloav_ptr) { | | | |
| return SWIG_MemoryError; | | | |
| } | | | |
| | | | |
| // Create a new Octave array. | | // Create a new Octave array. | |
| dim_vector objdims = sloav_dims; | | dim_vector objdims = sloav_dims; | |
| typename HELPER::OVType objval(objdims); | | typename HELPER::OVType objval(objdims); | |
| octave_value obj(objval); | | octave_value obj(objval); | |
| | | | |
| // Iterate over all elements in the C array. | | // Iterate over all elements in the C array. | |
| Array<octave_idx_type> idx(dim_vector(1, sloav_ndims), 0); | | Array<octave_idx_type> idx(dim_vector(1, sloav_ndims), 0); | |
| std::list<octave_value_list> objidx(1); | | std::list<octave_value_list> objidx(1); | |
| for (int i = 0; i < objdims.numel(); ++i) { | | for (int i = 0; i < objdims.numel(); ++i) { | |
| | | | |
| // Get the scalar index of the Octave array element. | | // Get the scalar index of the Octave array element. | |
| objidx.front()(0) = get_scalar_idx(idx, objdims) + 1; | | objidx.front()(0) = get_scalar_idx(idx, objdims) + 1; | |
| | | | |
| // Copy the C array element to the Octave array. | | // Copy the C array element to the Octave array. | |
|
| octave_value objelem = HELPER::outcall(sloav_parent, sloav_get_el
ement_ptr(idx), sloav_tinfo, sloav_tflags); | | octave_value objelem = HELPER::outcall(sloav_parent, sloav_get_el
ement_ptr(idx), sloav_isptr, sloav_tinfo, sloav_tflags); | |
| obj = obj.subsasgn(obj.is_cell() ? "{" : "(", objidx, objelem); | | obj = obj.subsasgn(obj.is_cell() ? "{" : "(", objidx, objelem); | |
| | | | |
| // Increment the Octave array index. | | // Increment the Octave array index. | |
| sloav_increment_idx(idx); | | sloav_increment_idx(idx); | |
| | | | |
| } | | } | |
| | | | |
| return obj; | | return obj; | |
| | | | |
| } | | } | |
| | | | |
| skipping to change at line 487 | | skipping to change at line 479 | |
| octave_value subsref(const std::string& type, const std::list<octave_
value_list>& idx) { | | octave_value subsref(const std::string& type, const std::list<octave_
value_list>& idx) { | |
| return sloav_array_out().subsref(type, idx); | | return sloav_array_out().subsref(type, idx); | |
| } | | } | |
| octave_value_list subsref(const std::string& type, const std::list<oc
tave_value_list>& idx, int nargout) { | | octave_value_list subsref(const std::string& type, const std::list<oc
tave_value_list>& idx, int nargout) { | |
| return sloav_array_out().subsref(type, idx, nargout); | | return sloav_array_out().subsref(type, idx, nargout); | |
| } | | } | |
| | | | |
| // Do subscript assignment, and copy result back to C array. | | // Do subscript assignment, and copy result back to C array. | |
| octave_value subsasgn(const std::string& type, const std::list<octave
_value_list>& idx, const octave_value& rhs) { | | octave_value subsasgn(const std::string& type, const std::list<octave
_value_list>& idx, const octave_value& rhs) { | |
| octave_value obj = sloav_array_out().subsasgn(type, idx, rhs); | | octave_value obj = sloav_array_out().subsasgn(type, idx, rhs); | |
|
| if (!SWIG_IsOK(sloav_array_in(obj))) { | | int ecode = sloav_array_in(obj); | |
| std::string nm = type_name (); | | if (!SWIG_IsOK(ecode)) { | |
| error("failed to perform indexed assignment for %s type", nm.c_st | | std::string n = type_name(); | |
| r()); | | std::string e = SWIG_ErrorType(ecode).string_value(); | |
| | | error("failed to perform indexed assignment for %s type: %s", n.c | |
| | | _str(), e.c_str()); | |
| return octave_value(); | | return octave_value(); | |
| } | | } | |
|
| | | count++; | |
| return octave_value(this); | | return octave_value(this); | |
| } | | } | |
| | | | |
| // Save and load from ASCII. | | // Save and load from ASCII. | |
| bool save_ascii (std::ostream& os) { | | bool save_ascii (std::ostream& os) { | |
| return sloav_array_out().save_ascii(os); | | return sloav_array_out().save_ascii(os); | |
| } | | } | |
| bool load_ascii(std::istream& is) { | | bool load_ascii(std::istream& is) { | |
| octave_value obj = sloav_array_out(); | | octave_value obj = sloav_array_out(); | |
| return obj.load_ascii(is) && SWIG_IsOK(sloav_array_in(obj)); | | return obj.load_ascii(is) && SWIG_IsOK(sloav_array_in(obj)); | |
| | | | |
| skipping to change at line 786 | | skipping to change at line 781 | |
| // Octave array-related types. | | // Octave array-related types. | |
| typedef OVCLASS OVClass; | | typedef OVCLASS OVClass; | |
| typedef OVTYPE OVType; | | typedef OVTYPE OVType; | |
| | | | |
| // Extract an OVType from an octave_value. | | // Extract an OVType from an octave_value. | |
| static OVType ovvalue(octave_value& ov) { | | static OVType ovvalue(octave_value& ov) { | |
| return ov.OVVALUE(); | | return ov.OVVALUE(); | |
| } | | } | |
| | | | |
| // Convert the octave_value objelem to an array element stored at e
lemptr. | | // Convert the octave_value objelem to an array element stored at e
lemptr. | |
|
| static int incall(const octave_value& parent, octave_value& objelem | | static int incall(const octave_value& parent, octave_value& objelem | |
| , void *elemptr, const size_t esize, swig_type_info *const tinfo, const int | | , void *elemptr, const size_t esize, const bool isptr, swig_type_info *cons | |
| tflags) { | | t tinfo, const int tflags) | |
| | | { | |
| int ecode = INCALL; | | int ecode = INCALL; | |
| if (!SWIG_IsOK(ecode)) { | | if (!SWIG_IsOK(ecode)) { | |
| return ecode; | | return ecode; | |
| } | | } | |
| return ecode; | | return ecode; | |
| } | | } | |
| | | | |
| // Convert the array element stored at elemptr to an octave_value. | | // Convert the array element stored at elemptr to an octave_value. | |
|
| static octave_value outcall(const octave_value& parent, void *elemp
tr, swig_type_info *const tinfo, const int tflags) { | | static octave_value outcall(const octave_value& parent, void *elemp
tr, const bool isptr, swig_type_info *const tinfo, const int tflags) { | |
| return OUTCALL; | | return OUTCALL; | |
| } | | } | |
| | | | |
| }; | | }; | |
| | | | |
| // ACFTYPE-specific array view class fragment. | | // ACFTYPE-specific array view class fragment. | |
| class OCTINTERP_API %swiglal_oct_array_view_class(ACFTYPE) : public %
swiglal_oct_array_view_tmpl(ACFTYPE) { | | class OCTINTERP_API %swiglal_oct_array_view_class(ACFTYPE) : public %
swiglal_oct_array_view_tmpl(ACFTYPE) { | |
| | | | |
| private: | | private: | |
| | | | |
| // Octave type constructs. | | // Octave type constructs. | |
| DECLARE_OCTAVE_ALLOCATOR; | | DECLARE_OCTAVE_ALLOCATOR; | |
| DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA; | | DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA; | |
| | | | |
| protected: | | protected: | |
| | | | |
| public: | | public: | |
| | | | |
|
| | | virtual ~%swiglal_oct_array_view_class(ACFTYPE)() | |
| | | { } | |
| | | | |
| %swiglal_oct_array_view_class(ACFTYPE)() | | %swiglal_oct_array_view_class(ACFTYPE)() | |
| : %swiglal_oct_array_view_tmpl(ACFTYPE)() | | : %swiglal_oct_array_view_tmpl(ACFTYPE)() | |
| { } | | { } | |
| | | | |
| %swiglal_oct_array_view_class(ACFTYPE)(const octave_value& parent, | | %swiglal_oct_array_view_class(ACFTYPE)(const octave_value& parent, | |
| void* ptr, | | void* ptr, | |
| const size_t esize, | | const size_t esize, | |
| const size_t ndims, | | const size_t ndims, | |
| const size_t dims[], | | const size_t dims[], | |
| const size_t strides[], | | const size_t strides[], | |
|
| | | const bool isptr, | |
| swig_type_info* tinfo, | | swig_type_info* tinfo, | |
| const int tflags) | | const int tflags) | |
|
| : %swiglal_oct_array_view_tmpl(ACFTYPE)(parent, ptr, esize, ndims
, dims, strides, tinfo, tflags) | | : %swiglal_oct_array_view_tmpl(ACFTYPE)(parent, ptr, esize, ndims
, dims, strides, isptr, tinfo, tflags) | |
| { } | | { } | |
| | | | |
| }; | | }; | |
| | | | |
| // Octave type constructs. | | // Octave type constructs. | |
| DEFINE_OCTAVE_ALLOCATOR(%swiglal_oct_array_view_class(ACFTYPE)); | | DEFINE_OCTAVE_ALLOCATOR(%swiglal_oct_array_view_class(ACFTYPE)); | |
| DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(%swiglal_oct_array_view_class(ACF
TYPE), | | DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(%swiglal_oct_array_view_class(ACF
TYPE), | |
| %swiglal_oct_array_view_ovtype(AC
FTYPE), | | %swiglal_oct_array_view_ovtype(AC
FTYPE), | |
| OVCLASS::static_class_name()); | | OVCLASS::static_class_name()); | |
| | | | |
| | | | |
| skipping to change at line 852 | | skipping to change at line 852 | |
| %fragment(%swiglal_array_copyin_frag(ACFTYPE), "header", | | %fragment(%swiglal_array_copyin_frag(ACFTYPE), "header", | |
| fragment=%swiglal_oct_array_view_frag(ACFTYPE)) | | fragment=%swiglal_oct_array_view_frag(ACFTYPE)) | |
| { | | { | |
| SWIGINTERN int %swiglal_array_copyin_func(ACFTYPE)(const octave_value&
parent, | | SWIGINTERN int %swiglal_array_copyin_func(ACFTYPE)(const octave_value&
parent, | |
| octave_value obj, | | octave_value obj, | |
| void* ptr, | | void* ptr, | |
| const size_t esize, | | const size_t esize, | |
| const size_t ndims, | | const size_t ndims, | |
| const size_t dims[], | | const size_t dims[], | |
| const size_t strides
[], | | const size_t strides
[], | |
|
| | | const bool isptr, | |
| swig_type_info *tinf
o, | | swig_type_info *tinf
o, | |
| const int tflags) | | const int tflags) | |
| { | | { | |
| // Create a local array view, then use its sloav_array_in() | | // Create a local array view, then use its sloav_array_in() | |
| // member to copy the input Octave array to the viewed C array. | | // member to copy the input Octave array to the viewed C array. | |
|
| %swiglal_oct_array_view_class(ACFTYPE) arrview(parent, ptr, esize, nd
ims, dims, strides, tinfo, tflags); | | %swiglal_oct_array_view_class(ACFTYPE) arrview(parent, ptr, esize, nd
ims, dims, strides, isptr, tinfo, tflags); | |
| return arrview.sloav_array_in(obj); | | return arrview.sloav_array_in(obj); | |
| } | | } | |
| } | | } | |
| | | | |
| // Output copy conversion fragment for arrays of type ACFTYPE. | | // Output copy conversion fragment for arrays of type ACFTYPE. | |
| %fragment(%swiglal_array_copyout_frag(ACFTYPE), "header", | | %fragment(%swiglal_array_copyout_frag(ACFTYPE), "header", | |
| fragment=%swiglal_oct_array_view_frag(ACFTYPE)) | | fragment=%swiglal_oct_array_view_frag(ACFTYPE)) | |
| { | | { | |
| SWIGINTERN octave_value %swiglal_array_copyout_func(ACFTYPE)(const octa
ve_value& parent, | | SWIGINTERN octave_value %swiglal_array_copyout_func(ACFTYPE)(const octa
ve_value& parent, | |
| void* ptr, | | void* ptr, | |
| const size
_t esize, | | const size
_t esize, | |
| const size
_t ndims, | | const size
_t ndims, | |
| const size
_t dims[], | | const size
_t dims[], | |
| const size
_t strides[], | | const size
_t strides[], | |
|
| | | const bool
isptr, | |
| swig_type_
info *tinfo, | | swig_type_
info *tinfo, | |
| const int
tflags) | | const int
tflags) | |
| { | | { | |
| // Create a local array view, then use its sloav_array_out() | | // Create a local array view, then use its sloav_array_out() | |
| // member to copy the viewed C array to the output Octave array. | | // member to copy the viewed C array to the output Octave array. | |
|
| %swiglal_oct_array_view_class(ACFTYPE) arrview(parent, ptr, esize, nd
ims, dims, strides, tinfo, tflags); | | %swiglal_oct_array_view_class(ACFTYPE) arrview(parent, ptr, esize, nd
ims, dims, strides, isptr, tinfo, tflags); | |
| return arrview.sloav_array_out(); | | return arrview.sloav_array_out(); | |
| } | | } | |
| } | | } | |
| | | | |
| // Output view conversion fragment for arrays of type ACFTYPE. | | // Output view conversion fragment for arrays of type ACFTYPE. | |
| %fragment(%swiglal_array_viewout_frag(ACFTYPE), "header", | | %fragment(%swiglal_array_viewout_frag(ACFTYPE), "header", | |
| fragment=%swiglal_oct_array_view_frag(ACFTYPE)) | | fragment=%swiglal_oct_array_view_frag(ACFTYPE)) | |
| { | | { | |
| SWIGINTERN octave_value %swiglal_array_viewout_func(ACFTYPE)(const octa
ve_value& parent, | | SWIGINTERN octave_value %swiglal_array_viewout_func(ACFTYPE)(const octa
ve_value& parent, | |
| void* ptr, | | void* ptr, | |
| const size
_t esize, | | const size
_t esize, | |
| const size
_t ndims, | | const size
_t ndims, | |
| const size
_t dims[], | | const size
_t dims[], | |
| const size
_t strides[], | | const size
_t strides[], | |
|
| | | const bool
isptr, | |
| swig_type_
info *tinfo, | | swig_type_
info *tinfo, | |
| const int
tflags) | | const int
tflags) | |
| { | | { | |
| // Return an Octave array view of the C array. | | // Return an Octave array view of the C array. | |
| octave_base_value *objval = | | octave_base_value *objval = | |
|
| new %swiglal_oct_array_view_class(ACFTYPE)(parent, ptr, esize, ndim
s, dims, strides, tinfo, tflags); | | new %swiglal_oct_array_view_class(ACFTYPE)(parent, ptr, esize, ndim
s, dims, strides, isptr, tinfo, tflags); | |
| return octave_value(objval); | | return octave_value(objval); | |
| } | | } | |
| } | | } | |
| | | | |
| %enddef // %swiglal_oct_array_frags | | %enddef // %swiglal_oct_array_frags | |
| | | | |
| // Array conversion fragments for generic arrays, e.g. SWIG-wrapped types. | | // Array conversion fragments for generic arrays, e.g. SWIG-wrapped types. | |
| %swiglal_oct_array_frags(SWIGTYPE, "swiglal_as_SWIGTYPE", "swiglal_from_SWI
GTYPE", | | %swiglal_oct_array_frags(SWIGTYPE, "swiglal_as_SWIGTYPE", "swiglal_from_SWI
GTYPE", | |
|
| %arg(swiglal_as_SWIGTYPE(parent, objelem, elemptr, | | %arg(swiglal_as_SWIGTYPE(parent, objelem, elemptr, | |
| esize, tinfo, tflags)), | | esize, isptr, tinfo, tflags)), | |
| %arg(swiglal_from_SWIGTYPE(parent, elemptr, tinfo, | | %arg(swiglal_from_SWIGTYPE(parent, elemptr, isptr, | |
| tflags)), | | tinfo, tflags)), | |
| octave_cell, Cell, cell_value); | | octave_cell, Cell, cell_value); | |
| | | | |
| // Array conversion fragments for arrays of LAL strings. | | // Array conversion fragments for arrays of LAL strings. | |
|
| %swiglal_oct_array_frags(LALCHAR, "SWIG_AsNewLALCHARPtr", "SWIG_FromLALCHAR | | %swiglal_oct_array_frags(LALchar, "SWIG_AsNewLALcharPtr", "SWIG_FromLALchar | |
| Ptr", | | Ptr", | |
| %arg(SWIG_AsNewLALCHARPtr(objelem, %reinterpret_ca | | %arg(SWIG_AsNewLALcharPtr(objelem, %reinterpret_ca | |
| st(elemptr, CHAR**))), | | st(elemptr, char**))), | |
| %arg(SWIG_FromLALCHARPtr(*%reinterpret_cast(elempt | | %arg(SWIG_FromLALcharPtr(*%reinterpret_cast(elempt | |
| r, CHAR**))), | | r, char**))), | |
| octave_cell, Cell, cell_value); | | octave_cell, Cell, cell_value); | |
| | | | |
| // Macro which generates array conversion function fragments to/from Octave | | // Macro which generates array conversion function fragments to/from Octave | |
| // arrays for real/fragment TYPEs which use SWIG_AsVal/From fragments. | | // arrays for real/fragment TYPEs which use SWIG_AsVal/From fragments. | |
| %define %swiglal_oct_array_asvalfrom_frags(TYPE, OVCLASS, OVTYPE, OVVALUE) | | %define %swiglal_oct_array_asvalfrom_frags(TYPE, OVCLASS, OVTYPE, OVVALUE) | |
| %swiglal_oct_array_frags(TYPE, SWIG_AsVal_frag(TYPE), SWIG_From_frag(TYPE), | | %swiglal_oct_array_frags(TYPE, SWIG_AsVal_frag(TYPE), SWIG_From_frag(TYPE), | |
| %arg(SWIG_AsVal(TYPE)(objelem, %reinterpret_cast(e
lemptr, TYPE*))), | | %arg(SWIG_AsVal(TYPE)(objelem, %reinterpret_cast(e
lemptr, TYPE*))), | |
| %arg(SWIG_From(TYPE)(*%reinterpret_cast(elemptr, T
YPE*))), | | %arg(SWIG_From(TYPE)(*%reinterpret_cast(elemptr, T
YPE*))), | |
| OVCLASS, OVTYPE, OVVALUE); | | OVCLASS, OVTYPE, OVVALUE); | |
| %enddef | | %enddef | |
| | | | |
End of changes. 27 change blocks. |
| 50 lines changed or deleted | | 51 lines changed or added | |
|
| swiglal_python.i | | swiglal_python.i | |
| | | | |
| skipping to change at line 44 | | skipping to change at line 44 | |
| import_array(); | | import_array(); | |
| %} | | %} | |
| | | | |
| // Name of PyObject containing the SWIG wrapping of the 'this' | | // Name of PyObject containing the SWIG wrapping of the 'this' | |
| // pointer, i.e. the struct whose members are being accessed. | | // pointer, i.e. the struct whose members are being accessed. | |
| %header %{ | | %header %{ | |
| #define swiglal_self() self | | #define swiglal_self() self | |
| #define swiglal_no_self() NULL | | #define swiglal_no_self() NULL | |
| %} | | %} | |
| | | | |
|
| | | // Name of PyObject containing the SWIG wrapping of the | |
| | | // first argument to a function. | |
| | | %header %{ | |
| | | #define swiglal_1starg() obj0 | |
| | | %} | |
| | | | |
| ////////// SWIG directives for operators ////////// | | ////////// SWIG directives for operators ////////// | |
| | | | |
| // These macros apply the correct python:slot directives | | // These macros apply the correct python:slot directives | |
| // to map Python __operator__ functions (which may be | | // to map Python __operator__ functions (which may be | |
| // defined in %extend) to the correct PyTypeObject slots. | | // defined in %extend) to the correct PyTypeObject slots. | |
| | | | |
| // Unary operators which do not return a new object. | | // Unary operators which do not return a new object. | |
| %define %swiglal_py_ury_op(NAME, FUNCTYPE, SLOT) | | %define %swiglal_py_ury_op(NAME, FUNCTYPE, SLOT) | |
| %pythonmaybecall *::__##NAME##__; | | %pythonmaybecall *::__##NAME##__; | |
| %feature("python:slot", #SLOT, functype=#FUNCTYPE) *::__##NAME##__; | | %feature("python:slot", #SLOT, functype=#FUNCTYPE) *::__##NAME##__; | |
| | | | |
| skipping to change at line 109 | | skipping to change at line 115 | |
| %enddef | | %enddef | |
| %swiglal_py_cmp_op(eq, Py_EQ); | | %swiglal_py_cmp_op(eq, Py_EQ); | |
| %swiglal_py_cmp_op(ge, Py_GE); | | %swiglal_py_cmp_op(ge, Py_GE); | |
| %swiglal_py_cmp_op(gt, Py_GT); | | %swiglal_py_cmp_op(gt, Py_GT); | |
| %swiglal_py_cmp_op(le, Py_LE); | | %swiglal_py_cmp_op(le, Py_LE); | |
| %swiglal_py_cmp_op(lt, Py_LT); | | %swiglal_py_cmp_op(lt, Py_LT); | |
| %swiglal_py_cmp_op(ne, Py_NE); | | %swiglal_py_cmp_op(ne, Py_NE); | |
| | | | |
| ////////// General fragments, typemaps, and macros ////////// | | ////////// General fragments, typemaps, and macros ////////// | |
| | | | |
|
| // Helper fragment and macro for typemap for functions which return 'int'. | | | |
| // Drops the first return value (which is the 'int') from the output argume | | | |
| nt | | | |
| // list if the argument list contains at least 2 items (the 'int' and some | | | |
| // other output argument). | | | |
| %fragment("swiglal_maybe_drop_first_retval", "header") { | | | |
| SWIGINTERN PyObject* swiglal_maybe_drop_first_retval(PyObject* out) { | | | |
| if (!PySequence_Check(out)) { | | | |
| return out; | | | |
| } | | | |
| Py_ssize_t len = PySequence_Length(out); | | | |
| if (len <= 1) { | | | |
| return out; | | | |
| } | | | |
| PyObject* old = out; | | | |
| if (len == 2) { | | | |
| out = PySequence_GetItem(old, 1); | | | |
| } else { | | | |
| out = PySequence_GetSlice(old, 1, len); | | | |
| } | | | |
| Py_CLEAR(old); | | | |
| return out; | | | |
| } | | | |
| } | | | |
| #define %swiglal_maybe_drop_first_retval() \ | | | |
| resultobj = swiglal_maybe_drop_first_retval(resultobj) | | | |
| | | | |
| // SWIG conversion fragments and typemaps for GSL complex numbers. | | // SWIG conversion fragments and typemaps for GSL complex numbers. | |
| %swig_cplxflt_convn(gsl_complex_float, gsl_complex_float_rect, GSL_REAL, GS
L_IMAG); | | %swig_cplxflt_convn(gsl_complex_float, gsl_complex_float_rect, GSL_REAL, GS
L_IMAG); | |
| %swig_cplxdbl_convn(gsl_complex, gsl_complex_rect, GSL_REAL, GSL_IMAG); | | %swig_cplxdbl_convn(gsl_complex, gsl_complex_rect, GSL_REAL, GSL_IMAG); | |
| %typemaps_primitive(%checkcode(CPLXFLT), gsl_complex_float); | | %typemaps_primitive(%checkcode(CPLXFLT), gsl_complex_float); | |
| %typemaps_primitive(%checkcode(CPLXDBL), gsl_complex); | | %typemaps_primitive(%checkcode(CPLXDBL), gsl_complex); | |
| | | | |
| // SWIG conversion fragments and typemaps for LAL complex numbers. | | // SWIG conversion fragments and typemaps for LAL complex numbers. | |
|
| %swig_cplxflt_convn(COMPLEX8, CX8rect, CX8re, CX8im); | | %swig_cplxflt_convn(COMPLEX8, crectf, crealf, cimagf); | |
| %swig_cplxdbl_convn(COMPLEX16, CX16rect, CX16re, CX16im); | | %swig_cplxdbl_convn(COMPLEX16, crect, creal, cimag); | |
| %typemaps_primitive(%checkcode(CPLXFLT), COMPLEX8); | | %typemaps_primitive(%checkcode(CPLXFLT), COMPLEX8); | |
| %typemaps_primitive(%checkcode(CPLXDBL), COMPLEX16); | | %typemaps_primitive(%checkcode(CPLXDBL), COMPLEX16); | |
| | | | |
| // Typemaps which convert to/from the C broken-down date/time struct. | | // Typemaps which convert to/from the C broken-down date/time struct. | |
| // Uses some code from PyLAL: Copyright (C) 2006 Kipp Cannon | | // Uses some code from PyLAL: Copyright (C) 2006 Kipp Cannon | |
| %typemap(in) struct tm* (struct tm temptm) { | | %typemap(in) struct tm* (struct tm temptm) { | |
| | | | |
| // Set 'tm' struct to zero | | // Set 'tm' struct to zero | |
| memset(&temptm, 0, sizeof(temptm)); | | memset(&temptm, 0, sizeof(temptm)); | |
| | | | |
| | | | |
| skipping to change at line 374 | | skipping to change at line 354 | |
| } | | } | |
| idx[j] = 0; | | idx[j] = 0; | |
| } | | } | |
| } | | } | |
| | | | |
| } // fragment swiglal_py_array_helpers | | } // fragment swiglal_py_array_helpers | |
| | | | |
| // Fragment defining helper functions for the NumPy object-view array descr
iptors. | | // Fragment defining helper functions for the NumPy object-view array descr
iptors. | |
| %fragment("swiglal_py_array_objview", "header") { | | %fragment("swiglal_py_array_objview", "header") { | |
| | | | |
|
| // Struct which associates a SWIG type descriptor with a NumPy array desc | | // Struct which associates a SWIG type descriptor with two NumPy array de | |
| riptor. | | scriptors, | |
| | | // one for arrays of data blocks (_noptr), and one for arrays of pointers | |
| | | (_isptr). | |
| typedef struct { | | typedef struct { | |
| swig_type_info* tinfo; | | swig_type_info* tinfo; | |
|
| PyArray_Descr* descr; | | PyArray_Descr* descr_noptr; | |
| | | PyArray_Descr* descr_isptr; | |
| } swiglal_py_array_type_pair; | | } swiglal_py_array_type_pair; | |
| | | | |
| // Static array of SWIG type/NumPy array descriptor pairs. This array sho
uld | | // Static array of SWIG type/NumPy array descriptor pairs. This array sho
uld | |
| // always be long enough to accommodate all possible swig_type_info*, sin
ce | | // always be long enough to accommodate all possible swig_type_info*, sin
ce | |
| // they are always members of the SWIG-generated global array swig_types[
]. | | // they are always members of the SWIG-generated global array swig_types[
]. | |
| // This array in turn is always one longer than the total number of types
, | | // This array in turn is always one longer than the total number of types
, | |
| // so there should always be a sentinal NULL element at the end. | | // so there should always be a sentinal NULL element at the end. | |
| static swiglal_py_array_type_pair swiglal_py_array_types[sizeof(swig_type
s) / sizeof(swig_types[0])]; | | static swiglal_py_array_type_pair swiglal_py_array_types[sizeof(swig_type
s) / sizeof(swig_types[0])]; | |
| | | | |
| // This function maps a SWIG type descriptor to a NumPy array descriptor, | | // This function maps a SWIG type descriptor to a NumPy array descriptor, | |
| // or returns the first NULL element if a mapping doesn't exist yet. | | // or returns the first NULL element if a mapping doesn't exist yet. | |
|
| SWIGINTERN PyArray_Descr* *swiglal_py_array_descr_from_tinfo(swig_type_in
fo* tinfo) { | | SWIGINTERN PyArray_Descr** swiglal_py_array_descr_from_tinfo(const bool i
sptr, swig_type_info* tinfo) { | |
| size_t i = 0; | | size_t i = 0; | |
| while (swiglal_py_array_types[i].tinfo != NULL && swiglal_py_array_type
s[i].tinfo != tinfo) | | while (swiglal_py_array_types[i].tinfo != NULL && swiglal_py_array_type
s[i].tinfo != tinfo) | |
| ++i; | | ++i; | |
| if (swiglal_py_array_types[i].tinfo == NULL) | | if (swiglal_py_array_types[i].tinfo == NULL) | |
| swiglal_py_array_types[i].tinfo = tinfo; | | swiglal_py_array_types[i].tinfo = tinfo; | |
|
| return &swiglal_py_array_types[i].descr; | | return isptr ? &swiglal_py_array_types[i].descr_isptr : &swiglal_py_arr
ay_types[i].descr_noptr; | |
| } | | } | |
| | | | |
| // This function maps a NumPy array descriptor to a SWIG type descriptor, | | // This function maps a NumPy array descriptor to a SWIG type descriptor, | |
| // or returns NULL element if a mapping doesn't exist. | | // or returns NULL element if a mapping doesn't exist. | |
|
| SWIGINTERN swig_type_info* swiglal_py_array_tinfo_from_descr(PyArray_Desc
r* descr) { | | SWIGINTERN void swiglal_py_array_tinfo_from_descr(bool *isptr, swig_type_
info** tinfo, PyArray_Descr* descr) { | |
| size_t i = 0; | | size_t i = 0; | |
|
| while (swiglal_py_array_types[i].descr != NULL && swiglal_py_array_type | | while ( ( swiglal_py_array_types[i].descr_noptr != NULL || swiglal_py_ | |
| s[i].descr != descr) | | array_types[i].descr_isptr != NULL ) && | |
| | | ( swiglal_py_array_types[i].descr_noptr != descr && swiglal_py_ | |
| | | array_types[i].descr_isptr != descr ) ) | |
| ++i; | | ++i; | |
|
| return swiglal_py_array_types[i].tinfo; | | *isptr = (swiglal_py_array_types[i].descr_isptr == descr); | |
| | | *tinfo = swiglal_py_array_types[i].tinfo; | |
| } | | } | |
| | | | |
| // Array of NumPy types that a NumPy object-view array can be safely cast
to. | | // Array of NumPy types that a NumPy object-view array can be safely cast
to. | |
| static int swiglal_py_array_objview_copyswap_cancastto[2] = {NPY_OBJECT,
NPY_NOTYPE}; | | static int swiglal_py_array_objview_copyswap_cancastto[2] = {NPY_OBJECT,
NPY_NOTYPE}; | |
| | | | |
| // NumPy array descriptor function for copying/byte-swapping an array ele
ment. | | // NumPy array descriptor function for copying/byte-swapping an array ele
ment. | |
| static void swiglal_py_array_objview_copyswap(void* dst, void* src, int s
wap, void* arr) { | | static void swiglal_py_array_objview_copyswap(void* dst, void* src, int s
wap, void* arr) { | |
| | | | |
| // Check input. | | // Check input. | |
| assert(arr != NULL); | | assert(arr != NULL); | |
| | | | |
| skipping to change at line 473 | | skipping to change at line 457 | |
| // NumPy array descriptor function which gets an element from the viewed
array. | | // NumPy array descriptor function which gets an element from the viewed
array. | |
| static PyObject* swiglal_py_array_objview_##ACFTYPE##_getitem(void* elemp
tr, void* arr) { | | static PyObject* swiglal_py_array_objview_##ACFTYPE##_getitem(void* elemp
tr, void* arr) { | |
| | | | |
| // Check input. | | // Check input. | |
| assert(elemptr != NULL); | | assert(elemptr != NULL); | |
| assert(arr != NULL); | | assert(arr != NULL); | |
| PyArrayObject* nparr = (PyArrayObject*)arr; | | PyArrayObject* nparr = (PyArrayObject*)arr; | |
| assert(nparr->descr != NULL); | | assert(nparr->descr != NULL); | |
| | | | |
| // Look up the SWIG type descriptor for this array. | | // Look up the SWIG type descriptor for this array. | |
|
| swig_type_info* tinfo = swiglal_py_array_tinfo_from_descr(nparr->descr) | | bool isptr; | |
| ; | | swig_type_info* tinfo = NULL; | |
| | | swiglal_py_array_tinfo_from_descr(&isptr, &tinfo, nparr->descr); | |
| assert(tinfo != NULL); | | assert(tinfo != NULL); | |
| | | | |
| // Get the Python object wrapping the C array element. | | // Get the Python object wrapping the C array element. | |
| const int tflags = 0; | | const int tflags = 0; | |
| PyObject* parent = nparr->base; | | PyObject* parent = nparr->base; | |
| return OUTCALL; | | return OUTCALL; | |
| | | | |
| } | | } | |
| | | | |
| // NumPy array descriptor function which assigns an element in the viewed
array. | | // NumPy array descriptor function which assigns an element in the viewed
array. | |
| static int swiglal_py_array_objview_##ACFTYPE##_setitem(PyObject* objelem
, void* elemptr, void* arr) { | | static int swiglal_py_array_objview_##ACFTYPE##_setitem(PyObject* objelem
, void* elemptr, void* arr) { | |
| | | | |
| // Check input. | | // Check input. | |
| assert(elemptr != NULL); | | assert(elemptr != NULL); | |
| assert(arr != NULL); | | assert(arr != NULL); | |
| PyArrayObject* nparr = (PyArrayObject*)arr; | | PyArrayObject* nparr = (PyArrayObject*)arr; | |
| assert(nparr->descr != NULL); | | assert(nparr->descr != NULL); | |
| | | | |
| // Look up the SWIG type descriptor for this array. | | // Look up the SWIG type descriptor for this array. | |
|
| swig_type_info* tinfo = swiglal_py_array_tinfo_from_descr(nparr->descr) | | bool isptr; | |
| ; | | swig_type_info* tinfo = NULL; | |
| | | swiglal_py_array_tinfo_from_descr(&isptr, &tinfo, nparr->descr); | |
| assert(tinfo != NULL); | | assert(tinfo != NULL); | |
| | | | |
| // Set the C array element to the supplied Python object. | | // Set the C array element to the supplied Python object. | |
| const int tflags = 0; | | const int tflags = 0; | |
| const size_t esize = nparr->descr->elsize; | | const size_t esize = nparr->descr->elsize; | |
| PyObject* parent = nparr->base; | | PyObject* parent = nparr->base; | |
| int ecode = INCALL; | | int ecode = INCALL; | |
| if (!SWIG_IsOK(ecode)) { | | if (!SWIG_IsOK(ecode)) { | |
| SWIG_Error(ecode, "failure in swiglal_py_array_objview_" #ACFTYPE "_s
etitem()"); | | SWIG_Error(ecode, "failure in swiglal_py_array_objview_" #ACFTYPE "_s
etitem()"); | |
| return -1; | | return -1; | |
| | | | |
| skipping to change at line 582 | | skipping to change at line 570 | |
| 0, // alignment | | 0, // alignment | |
| (PyArray_ArrayDescr*)NULL, // subarray | | (PyArray_ArrayDescr*)NULL, // subarray | |
| (PyObject*)NULL, // fields | | (PyObject*)NULL, // fields | |
| (PyObject*)NULL, // names | | (PyObject*)NULL, // names | |
| &swiglal_py_array_objview_##ACFTYPE##_arrfuncs, // f | | &swiglal_py_array_objview_##ACFTYPE##_arrfuncs, // f | |
| }; | | }; | |
| | | | |
| // This function returns the NumPy array descriptor appropriate for the | | // This function returns the NumPy array descriptor appropriate for the | |
| // supplied SWIG type descriptor. If no array descriptor exists, it creat
es | | // supplied SWIG type descriptor. If no array descriptor exists, it creat
es | |
| // one from the array descriptor for type ACFTYPE. | | // one from the array descriptor for type ACFTYPE. | |
|
| SWIGINTERN PyArray_Descr* swiglal_py_array_objview_##ACFTYPE##_descr(swig
_type_info* tinfo, const int esize) { | | SWIGINTERN PyArray_Descr* swiglal_py_array_objview_##ACFTYPE##_descr(cons
t bool isptr, swig_type_info* tinfo, const int esize) { | |
| | | | |
| // Lookup existing NumPy array descriptor for SWIG type descriptor. | | // Lookup existing NumPy array descriptor for SWIG type descriptor. | |
|
| PyArray_Descr* *pdescr = swiglal_py_array_descr_from_tinfo(tinfo); | | PyArray_Descr* *pdescr = swiglal_py_array_descr_from_tinfo(isptr, tinfo
); | |
| | | | |
| // Create NumPy array descriptor if none yet exists. | | // Create NumPy array descriptor if none yet exists. | |
| if (*pdescr == NULL) { | | if (*pdescr == NULL) { | |
| *pdescr = PyArray_DescrNew(&swiglal_py_array_objview_##ACFTYPE##_arrd
escr); | | *pdescr = PyArray_DescrNew(&swiglal_py_array_objview_##ACFTYPE##_arrd
escr); | |
| if (*pdescr == NULL) { | | if (*pdescr == NULL) { | |
| return NULL; | | return NULL; | |
| } | | } | |
| (*pdescr)->typeobj = SwigPyObject_type(); | | (*pdescr)->typeobj = SwigPyObject_type(); | |
| (*pdescr)->elsize = esize; | | (*pdescr)->elsize = esize; | |
| (*pdescr)->alignment = 1; | | (*pdescr)->alignment = 1; | |
| | | | |
| skipping to change at line 630 | | skipping to change at line 618 | |
| %fragment(%swiglal_array_copyin_frag(ACFTYPE), "header", | | %fragment(%swiglal_array_copyin_frag(ACFTYPE), "header", | |
| fragment="swiglal_py_array_helpers", fragment=INFRAG) | | fragment="swiglal_py_array_helpers", fragment=INFRAG) | |
| { | | { | |
| SWIGINTERN int %swiglal_array_copyin_func(ACFTYPE)(PyObject* parent, | | SWIGINTERN int %swiglal_array_copyin_func(ACFTYPE)(PyObject* parent, | |
| PyObject* obj, | | PyObject* obj, | |
| void* ptr, | | void* ptr, | |
| const size_t esize, | | const size_t esize, | |
| const size_t ndims, | | const size_t ndims, | |
| const size_t dims[], | | const size_t dims[], | |
| const size_t strides
[], | | const size_t strides
[], | |
|
| | | const bool isptr, | |
| swig_type_info *tinf
o, | | swig_type_info *tinf
o, | |
| const int tflags) | | const int tflags) | |
| { | | { | |
| int ecode = 0; | | int ecode = 0; | |
| npy_intp idx[ndims]; | | npy_intp idx[ndims]; | |
| | | | |
| // Check that C array is non-NULL. | | // Check that C array is non-NULL. | |
| if (ptr == NULL) { | | if (ptr == NULL) { | |
| return SWIG_MemoryError; | | return SWIG_MemoryError; | |
| } | | } | |
| | | | |
| skipping to change at line 701 | | skipping to change at line 690 | |
| // Output copy conversion fragment for arrays of type ACFTYPE. | | // Output copy conversion fragment for arrays of type ACFTYPE. | |
| %fragment(%swiglal_array_copyout_frag(ACFTYPE), "header", | | %fragment(%swiglal_array_copyout_frag(ACFTYPE), "header", | |
| fragment="swiglal_py_array_helpers", fragment=OUTFRAG) | | fragment="swiglal_py_array_helpers", fragment=OUTFRAG) | |
| { | | { | |
| SWIGINTERN PyObject* %swiglal_array_copyout_func(ACFTYPE)(PyObject* par
ent, | | SWIGINTERN PyObject* %swiglal_array_copyout_func(ACFTYPE)(PyObject* par
ent, | |
| void* ptr, | | void* ptr, | |
| const size_t
esize, | | const size_t
esize, | |
| const size_t
ndims, | | const size_t
ndims, | |
| const size_t
dims[], | | const size_t
dims[], | |
| const size_t
strides[], | | const size_t
strides[], | |
|
| | | const bool is
ptr, | |
| swig_type_inf
o *tinfo, | | swig_type_inf
o *tinfo, | |
| const int tfl
ags) | | const int tfl
ags) | |
| { | | { | |
| PyObject* nparr = NULL; | | PyObject* nparr = NULL; | |
| npy_intp objdims[ndims]; | | npy_intp objdims[ndims]; | |
| npy_intp idx[ndims]; | | npy_intp idx[ndims]; | |
| | | | |
| // Check that C array is non-NULL. | | // Check that C array is non-NULL. | |
| if (ptr == NULL) { | | if (ptr == NULL) { | |
| goto fail; | | goto fail; | |
| | | | |
| skipping to change at line 762 | | skipping to change at line 752 | |
| // Output view conversion fragment for arrays of type ACFTYPE. | | // Output view conversion fragment for arrays of type ACFTYPE. | |
| %fragment(%swiglal_array_viewout_frag(ACFTYPE), "header", | | %fragment(%swiglal_array_viewout_frag(ACFTYPE), "header", | |
| fragment="swiglal_py_array_helpers", fragment=VIEWFRAG, fragmen
t=OUTFRAG) | | fragment="swiglal_py_array_helpers", fragment=VIEWFRAG, fragmen
t=OUTFRAG) | |
| { | | { | |
| SWIGINTERN PyObject* %swiglal_array_viewout_func(ACFTYPE)(PyObject* par
ent, | | SWIGINTERN PyObject* %swiglal_array_viewout_func(ACFTYPE)(PyObject* par
ent, | |
| void* ptr, | | void* ptr, | |
| const size_t
esize, | | const size_t
esize, | |
| const size_t
ndims, | | const size_t
ndims, | |
| const size_t
dims[], | | const size_t
dims[], | |
| const size_t
strides[], | | const size_t
strides[], | |
|
| | | const bool is
ptr, | |
| swig_type_inf
o *tinfo, | | swig_type_inf
o *tinfo, | |
| const int tfl
ags) | | const int tfl
ags) | |
| { | | { | |
| PyObject* nparr = NULL; | | PyObject* nparr = NULL; | |
| npy_intp objdims[ndims]; | | npy_intp objdims[ndims]; | |
| npy_intp objstrides[ndims]; | | npy_intp objstrides[ndims]; | |
| | | | |
|
| // Check that C array is non-NULL. | | | |
| if (ptr == NULL) { | | | |
| goto fail; | | | |
| } | | | |
| | | | |
| // Copy C array dimensions and strides. | | // Copy C array dimensions and strides. | |
| for (int i = 0; i < ndims; ++i) { | | for (int i = 0; i < ndims; ++i) { | |
| objdims[i] = dims[i]; | | objdims[i] = dims[i]; | |
| objstrides[i] = strides[i] * esize; | | objstrides[i] = strides[i] * esize; | |
| } | | } | |
| | | | |
| // Create a new NumPy array view. | | // Create a new NumPy array view. | |
| PyArray_Descr* descr = NPYDESCR; | | PyArray_Descr* descr = NPYDESCR; | |
| if (descr == NULL) { | | if (descr == NULL) { | |
| goto fail; | | goto fail; | |
| | | | |
| skipping to change at line 814 | | skipping to change at line 800 | |
| } | | } | |
| | | | |
| %enddef // %swiglal_py_array_frags | | %enddef // %swiglal_py_array_frags | |
| | | | |
| // Macro which generates array conversion function fragments to/from Python | | // Macro which generates array conversion function fragments to/from Python | |
| // arrays for object arrays, which require additional code for views. | | // arrays for object arrays, which require additional code for views. | |
| %define %swiglal_py_array_objview_frags(ACFTYPE, INFRAG, OUTFRAG, INCALL, O
UTCALL) | | %define %swiglal_py_array_objview_frags(ACFTYPE, INFRAG, OUTFRAG, INCALL, O
UTCALL) | |
| %swiglal_py_array_objview(ACFTYPE, INFRAG, OUTFRAG, INCALL, OUTCALL); | | %swiglal_py_array_objview(ACFTYPE, INFRAG, OUTFRAG, INCALL, OUTCALL); | |
| %swiglal_py_array_frags(ACFTYPE, INFRAG, OUTFRAG, INCALL, OUTCALL, | | %swiglal_py_array_frags(ACFTYPE, INFRAG, OUTFRAG, INCALL, OUTCALL, | |
| %swiglal_py_array_objview_frag(ACFTYPE), | | %swiglal_py_array_objview_frag(ACFTYPE), | |
|
| NPY_OBJECT, %arg(swiglal_py_array_objview_##ACFTYPE
##_descr(tinfo, esize))); | | NPY_OBJECT, %arg(swiglal_py_array_objview_##ACFTYPE
##_descr(isptr, tinfo, esize))); | |
| %enddef | | %enddef | |
| | | | |
| // Array conversion fragments for generic arrays, e.g. SWIG-wrapped types. | | // Array conversion fragments for generic arrays, e.g. SWIG-wrapped types. | |
| %swiglal_py_array_objview_frags(SWIGTYPE, "swiglal_as_SWIGTYPE", "swiglal_f
rom_SWIGTYPE", | | %swiglal_py_array_objview_frags(SWIGTYPE, "swiglal_as_SWIGTYPE", "swiglal_f
rom_SWIGTYPE", | |
|
| %arg(swiglal_as_SWIGTYPE(parent, objelem, e | | %arg(swiglal_as_SWIGTYPE(parent, objelem, e | |
| lemptr, esize, tinfo, tflags)), | | lemptr, esize, isptr, tinfo, tflags)), | |
| %arg(swiglal_from_SWIGTYPE(parent, elemptr, | | %arg(swiglal_from_SWIGTYPE(parent, elemptr, | |
| tinfo, tflags))); | | isptr, tinfo, tflags))); | |
| | | | |
| // Array conversion fragments for arrays of LAL strings. | | // Array conversion fragments for arrays of LAL strings. | |
|
| %swiglal_py_array_objview_frags(LALCHAR, "SWIG_AsNewLALCHARPtr", "SWIG_From | | %swiglal_py_array_objview_frags(LALchar, "SWIG_AsNewLALcharPtr", "SWIG_From | |
| LALCHARPtr", | | LALcharPtr", | |
| %arg(SWIG_AsNewLALCHARPtr(objelem, %reinter | | %arg(SWIG_AsNewLALcharPtr(objelem, %reinter | |
| pret_cast(elemptr, CHAR**))), | | pret_cast(elemptr, char**))), | |
| %arg(SWIG_FromLALCHARPtr(*%reinterpret_cast | | %arg(SWIG_FromLALcharPtr(*%reinterpret_cast | |
| (elemptr, CHAR**)))); | | (elemptr, char**)))); | |
| | | | |
| // Macro which generates array conversion function fragments to/from Python | | // Macro which generates array conversion function fragments to/from Python | |
| // arrays for real/fragment TYPEs which use SWIG_AsVal/From fragments. | | // arrays for real/fragment TYPEs which use SWIG_AsVal/From fragments. | |
| %define %swiglal_py_array_asvalfrom_frags(TYPE, NPYTYPE) | | %define %swiglal_py_array_asvalfrom_frags(TYPE, NPYTYPE) | |
| %swiglal_py_array_frags(TYPE, SWIG_AsVal_frag(TYPE), SWIG_From_frag(TYPE), | | %swiglal_py_array_frags(TYPE, SWIG_AsVal_frag(TYPE), SWIG_From_frag(TYPE), | |
| %arg(SWIG_AsVal(TYPE)(objelem, %reinterpret_cast(el
emptr, TYPE*))), | | %arg(SWIG_AsVal(TYPE)(objelem, %reinterpret_cast(el
emptr, TYPE*))), | |
| %arg(SWIG_From(TYPE)(*%reinterpret_cast(elemptr, TY
PE*))), | | %arg(SWIG_From(TYPE)(*%reinterpret_cast(elemptr, TY
PE*))), | |
| "swiglal_empty_frag", NPYTYPE, PyArray_DescrFromTyp
e(NPYTYPE)); | | "swiglal_empty_frag", NPYTYPE, PyArray_DescrFromTyp
e(NPYTYPE)); | |
| %enddef | | %enddef | |
| | | | |
| | | | |
End of changes. 21 change blocks. |
| 60 lines changed or deleted | | 45 lines changed or added | |
|