Holds multi-dimensional arrays.
This class is used to hold arrays of other DODS data. The elements of the array can be simple or compound data types. There is no limit on the number of dimensions an array can have, or on the size of each dimension. If desired, the user can give each dimension of an array a name. You can, for example, have a 360x180 array of temperatures, covering the whole globe with one-degree squares. In this case, you could name the first dimension ``Longitude'' and the second dimension ``Latitude''. This can help prevent a great deal of confusion. The Array is used as part of the Grid class, where the dimension names are crucial to its structure. The dimension names correspond to ``Map'' vectors, holding the actual values for that column of the array. Each array dimension carries with it its own projection information. The projection inforamtion takes the form of three integers: the start, stop, and stride values. This is clearest with an example. Consider a one-dimensional array 10 elements long. If the start value of the dimension constraint is 3, then the constrained array appears to be seven elements long. If the stop value is changed to 7, then the array appears to be five elements long. If the stride is changed to two, the array will appear to be 3 elements long. Array constraints are written as: #[start:stride:stop]#. \begin{verbatim} A = [1 2 3 4 5 6 7 8 9 10] A[3::] = [4 5 6 7 8 9 10] A[3::7] = [4 5 6 7 8] A[3:2:7] = [4 6 8] A[0:3:9] = [1 4 7 10] \end{verbatim} \note{DODS uses zero-based indexing.}
Array(const Array &rhs)
virtual bool read(const string &dataset, int &error)
void update_length(int size)
void append_dim(int size, string name = "")
name - The name of the new dimension. This defaults to
an empty string. bool add_constraint(Pix p, int start, int stride, int stop)
start - The start index of the constraint.
stride - The stride value of the constraint.
stop - The stop index of the constraint.
void reset_constraint()
void clear_constraint()
Pix first_dim()
void next_dim(Pix &p)
int dimension_size(Pix p, bool constrained = false)
constrained - If this parameter is TRUE, the function
returns the constrained size of the array. If the dimension is
not selected, the function returns zero. If it is FALSE, the
function returns the dimension size whether or not the dimension
is constrained. int dimension_start(Pix p, bool constrained = false)
constrained - If this parameter is TRUE, the function
returns the start index only if the dimension is selected. If
the dimension is not selected, the function returns zero. If it
is FALSE, the function returns the start index whether or not
the dimension is constrained. int dimension_stop(Pix p, bool constrained = false)
constrained - If this parameter is TRUE, the function
returns the stop index only if the dimension is selected. If
the dimension is not selected, the function returns zero. If it
is FALSE, the function returns the stop index whether or not
the dimension is constrained. int dimension_stride(Pix p, bool constrained = false)
constrained - If this parameter is TRUE, the function
returns the stride value only if the dimension is selected. If
the dimension is not selected, the function returns zero. If it
is FALSE, the function returns the stride value whether or not
the dimension is constrained. string dimension_name(Pix p)
unsigned int dimensions(bool constrained = false)
alphabetic index hierarchy of classes
generated by doc++