next up previous contents
Next: 2.3.13 Single Value Access Up: 2.3 Variables Previous: 2.3.11 Dimension Variance

2.3.12 Majority

     

The variable majority of a CDF describes how variable values within each variable array   (record) are stored. Each variable in a CDF has the same majority. The majority can be either row major or column major.

For example,   an array for an rVariable with [VARY,VARY] dimension variances in a 2-dimensional CDF with dimension sizes [2,4] and row majority would be stored as follows:

  v(1,1), v(1,2), v(1,3), v(1,4), v(2,1), v(2,2), v(2,3), v(2,4)

where v(i,j) is the value at indices (i,j). If the CDF had column majority, the array would be stored as follows:

  v(1,1), v(2,1), v(1,2), v(2,2), v(1,3), v(2,3), v(1,4), v(2,4)

In each case v(1,1) is stored at the low address.

An application needs to be concerned with the majority of a CDF in the following cases:

  1. When performing a variable hyper read,   the values placed in the buffer by the CDF library will be in the variable majority of the CDF. The application must process the values according to that majority.

    When performing a variable hyper write,   the CDF library expects the values in the buffer to be in the variable majority of the CDF. The application must place the values into the buffer in that majority.

  2. When sequential   access is used, the values are read/written in the order imposed by the variable majority of the CDF.
  3. When single   value reads/writes are performed, the majority could have an effect. The CDF library uses a caching scheme to optimizegif the random access to variable values. If all of the values of a record are to be read/written, there may be an increase in performance   if the values are accessed with (rather than against) the majority. For example, if the majority is row-major, increment the last index the fastest.
  4. When performing a multiple variable read/write, the full-physical records in the buffer will/must be in the variable majority of the CDF.

A CDF's variable majority is specified   when the CDF is created when using the Standard Interface but is set to the default variable majority for your CDF distribution when created using the Internal Interface. The majority of an existing CDF may be changed   using the Internal Interface only if variable values have not yet been written. (Variables may exist and explicit pad values may have been specified, however.)



next up previous contents
Next: 2.3.13 Single Value Access Up: 2.3 Variables Previous: 2.3.11 Dimension Variance



cdfsupport@nssdca.gsfc.nasa.gov