# IBM Visualization Data Explorer Programmer's Reference

[ Bottom of Page | Previous Page | Next Page | Table of Contents | Partial Table of Contents | Index ]

### DXMakeGridPositions, DXMakeGridPositionsV

Function

Create an n-dimensional grid of regularly spaced positions.

Syntax
`
#include <dx/dx.h>
`

Array DXMakeGridPositions(int n, int count, int count, int count,...,
float origin, float origin, ..., float delta, float delta, ...)
Array DXMakeGridPositionsV(int n, int *counts, float *origin, float *deltas)

Functional Details

The grids created by these routines are compactly encoded by creating a Product Array of `n` Regular Arrays and are suitable as "positions" components of a Field. This compact encoding is particularly useful when the data lie in or on a lattice of regularly spaced points, since their positions can be computed, thereby saving the space that explicit indexing would require.

`DXMakeGridPositions` is used to enter the grid's specifications as individual arguments of the routine's parameters. `DXMakeGridPositionsV` is used to enter the same arguments as one integer (`n`) and three Arrays.

- The `n` parameter specifies the dimensionality of the grid. The remaining specifications must be consistent with this value.

- The `counts` parameter specifies the number of elements in each of the grid's dimensions (e.g., 5 and 4 if `n`=2).

- The `origin` parameter specifies the vector that defines the grid's origin (e.g., 3.2 and 7.1 for a 2-dimensional grid).

- The `delta` parameter specifies the `n`-dimensional vectors that define the delta values to be used (e.g., if `n`=2, this parameter would have four numbers, to specify two 2-vectors).

The grid constructed by either routine is a Product Array of n terms, each of which is a Regular Array. The first zero-based term describes a line in an `n`-dimensional space with `counts`[0] points (starting at the origin), each point separated from the previous point on the line by the `n`-dimensional vector described by `deltas`[0] through `deltas`[n-1]. For each of the remaining `n`-1 terms, the kth term will have `counts`[k] points (starting at [0 ... 0]), each of which is separated from the previous point on the line by the `n`-dimensional vector described by `deltas`[k*n] through `deltas`[k*n + (n-1)].

The Array created can be deleted with DXDelete. See 4.2 , "Memory Management".

Return Value

Returns the Array or returns `NULL` and sets an error code.

See Also

`DXMakeGridConnections, DXMakeGridConnectionsV, DXQueryGridConnections, DXQueryGridPositions`

"Creating Positions and Connections Grids".

[ Top of Page | Previous Page | Next Page | Table of Contents | Partial Table of Contents | Index ]
[Data Explorer Documentation | QuickStart Guide | User's Guide | User's Reference | Programmer's Reference | Installation and Configuration Guide ]

[Data Explorer Home Page]

[IBM Home Page | Order | Search | Contact IBM | Legal ]