To initiate work at SEP within the HCL framework, we implemented the traditional SEP Data Cube as a vector class. We named the class RGF for regular grid function. Each instance of an RGF has an associated RGFSpace, which is a vector space in HCL.
An RGFSpace is defined by its dimension, and an Axis for each dimension. An Axis is a C++ class which has five attributes. These include: number of samples, offset of the first sample, distance between samples, and unit of measurement (in which the offset and distance are measured). The fifth attribute is a descriptive label, e.g. ``geophone position''. Thus, an RGFSpace consists of an integer dimensionality, and an array of Axis objects specifying the physical shape of the grid.
Along with the RGFSpace to which it belongs, an RGF contains an array of ordinates, implemented as a one-dimensional array. The user, however, can index the array as if it were multidimensional. We achieved this by using the C++ feature of overloading the parentheses operator.
Because an RGF is a vector in HCL, we coded the requisite vector operations. These include vector addition and subtraction, multiplication by a scalar, norm, and inner product. We also implemented I/O routines using the SEPlib C functions sreed and srite so we could use existing data files in the SEP Data Cube format.