next up previous contents index
Next: Structured datatypes Up: Header LALDatatypes.h Previous: Atomic datatypes codes   Contents   Index


Aggregate datatypes

These datatypes store arbitrarily large sets or collections of primitive datatypes. At this level there is no physical interpretation assigned to the objects (such as names or units); the aggregate datatypes simply collect and arrange the primitive datatypes. The following types of aggregate datatypes are defines: vectors, arrays, sequences, vector sequences, and array sequences.




<datatype>Vector
This structure stores an ordered set of $n$ elements of type <datatype>, which can be any primitive datatype. The data are to be interpreted as being a point in an $n$-dimensional vector space. The fields are:
UINT4 length
The number of data $n$.
<datatype> *data
Pointer to the data array. The data are stored sequentially as data[$0,\ldots,n-1$].




<datatype>Array
This structure stores a set of elements of type <datatype>, which can be any primitive datatype, arranged as an $m$-dimensional array. That is, each element can be thought of as having $m$ indecies, $\mathsf{A}_{i_0\cdots i_{m-1}}$, where each index $i_k$ runs over its own range $0,\ldots,n_k-1$. The total number of elements is then $N=n_0\times\cdots\times n_{m-1}$. In memory the array is ``flattened'' so that the elements are stored sequentially in a contiguous block. The fields are:
UINT4Vector *dimLength
Pointer to a vector of length $m$, storing the index ranges $(n_0,\ldots,n_{m-1})$.
<datatype> *data
Pointer to the data array. The data element $\mathsf{A}_{i_0\cdots i_{m-1}}$ is stored as data[ $i_{m-1} + n_{m-2}\times(i_{m-2} +
n_{m-3}\times(\cdots(i_1 + n_0\times i_0)\cdots))$]; that is, the index of data[] runs over the entire range of an index $i_{k+1}$ before incrementing $i_k$.




<datatype>Sequence
This structure stores an ordered set of $l$ elements of type <datatype>, which can be any primitive datatype. It is identical to <datatype>Vector, except that the elements are to be interpreted as $l$ consecutive elements rather than the components of an $l$-dimensional vector. The fields are:
UINT4 length
The number of data $l$.
<datatype> *data
Pointer to the data array. The data are stored sequentially as data[$0,\ldots,l-1$].




<datatype>VectorSequence
This structure stores an ordered set of $l$ elements of type <datatype>Vector, where <datatype> can be any primitive datatype. Mathematically the sequence can be written as $\{\vec{v}^{(0)},\ldots,\vec{v}^{(l-1)}\}$, where each element $\vec{v}^{(j)}=(v^{(j)}_0,\ldots,v^{(i)}_{n-1})$ is a vector of length $n$. In memory the elements are ``flattened''; that is, they are stored sequentially in a contiguous block of memory. The fields are:
UINT4 length
The number of vectors $l$.
UINT4 vectorLength
The length $n$ of each vector.
<datatype> *data
Pointer to the data array. The data element $v^{(j)}_i$ is stored as data[$j\times n + i$]; that is, the index of data[] runs over the internal index of each vector element before incrementing to the next vector element.




<datatype>ArraySequence
This structure stores an ordered set of $l$ elements of type <datatype>Array, where <datatype> can be any primitive datatype. The indexing of an array sequence can get quite complicated; it helps to read first the documentation for data arrays, above. Mathematically the data can be written as a set $\{\mathsf{A}^{(j)}_{i_0\cdots i_{m-1}}$, where the sequence number $j$ runs from 0 to $l-1$, and each array index $i_k$ runs over its own range $0,\ldots,n_k-1$. The total number of data in a given array element is then $N=n_0\times\cdots\times n_{m-1}$, and the total number of data in the sequence is $N\times l$. In memory the array is ``flattened'' so that the elements are stored sequentially in a contiguous block. The fields are:
UINT4 length
The number $l$ of array elements in the sequence.
UINT4 arrayDim
The number of data $N$ (not the number of indecies $m$) in each array element of the sequence.
UINT4Vector *dimLength
Pointer to a vector of length $m$, storing the index ranges $(n_0,\ldots,n_{m-1})$.
<datatype> *data
Pointer to the data. The element $\mathsf{A}^{(j)}_{i_0\cdots i_{m-1}}$ is stored as data[ $j\times N + i_{m-1} + n_{m-2}\times(i_{m-2} +
n_{m-3}\times(\cdots(i_1 + n_0\times i_0)\cdots))$]; that is, the index of data[] runs over the internal indecies of each array element before incrementing to the next array element.


next up previous contents index
Next: Structured datatypes Up: Header LALDatatypes.h Previous: Atomic datatypes codes   Contents   Index
LAL test account 2003-10-23