Holds the Grid data type.
The Grid data type is a collection of an Array and a set of ``Map'' vectors. The Map vectors are one-dimensional arrays corresponding to each dimension of the central Array. Using this scheme, a Grid can represent, in a rectilinear array, data which is not in reality rectilinear. An example will help make it clear. Assume that the following array contains measurements of some real quantity, conducted at nine different points in space: \begin{verbatim} A = [ 1 2 3 4 ] [ 2 4 6 8 ] [ 3 6 9 12] \end{verbatim} To locate this Array in the real world, we could note the location of one corner of the grid, and the grid spacing. This would allow us to calculate the location of any of the other points of the Array. This approach will not work, however, unless the grid spacing is precisely regular. If the distance between Row 1 and Row 2 is not the same as the distance between Row 2 and Row 3, the scheme will break down. The solution is to equip the Array with two Map vectors that define the location of each row or column of the array: \begin{verbatim} A = [ 1 2 3 4 ] Row = [ 0 ] [ 2 4 6 8 ] [ 3 ] [ 3 6 9 12] [ 8 ] Column = [ 0 2 8 27] \end{verbatim} The real location of the point in the first row and column of the array is now exactly fixed at (0,0), and the point in the last row and last column is at (8,27). The Grid data type has two parts: an Array, and a singly-linked list of Map vectors to describe the Array. The access functions for this class include a function to return the Array (#array_var()#), and a set of functions for cycling through the list of Map vectors.
Grid(const Grid &rhs)
virtual BaseType* var(const string &name, bool exact_match = true)
BaseType* array_var()
Pix first_map_var()
void next_map_var(Pix &p)
BaseType* map_var(Pix p)
virtual int components(bool constrained = false)
virtual bool projection_yields_grid()
virtual unsigned int val2buf(void *buf, bool reuse = false)
virtual unsigned int buf2val(void **val)
virtual void print_decl(ostream &os, string space = " ", bool print_semi = true, bool constraint_info = false, bool constrained = false)
virtual bool check_semantics(string &msg, bool all = false)
alphabetic index hierarchy of classes
generated by doc++