DAPPLE provides two new classes of data: Vector
and
Matrix.
You can define one- and two-dimensional data
sets, and manipulate them with many of the usual C++ operators, in
parallel. In addition, you can compute some functions of the entire
vector or matrix, such as summing all the elements. Finally, you can
move elements around, perhaps to sort them.
somefunc(0),
and the last element will be initialized to
somefunc(N-1).
The predefined function called
Identity()
is useful for this purpose:
Identity(i)
returns i,
so
There are other vector types, used the same way:
IdentityR(r,c)
is a predefined function that
returns r.
Integer matrix A2 is initialized so that
every element's value is its column number;
IdentityC(r,c)
is a predefined function that returns
c.
Thus, for matrices, the function initializer takes two
parameters (the row and column) instead of one.
All elements in character matrix B are initialized to the character 'x'. Float matrix C is uninitialized. Double matrix D is initialized from a two-dimensional array called data, which should have the dimensions [N][M]. Finally, all elements in boolean matrix E are initialized to false.