xgrid

The xgrid operator produces a result array with the same number of dimensions and the same attributes as a source array, but with the size of each dimension multiplied by a supplied integer scale, with replication of the original values.

Synopsis

xgrid(source_array,scale_1[,scale_2[,...]])

Summary

The xgrid operator produces a result array by scaling the dimensions of the input and replicating its values. Within each dimension, the xgrid operator duplicates each cell by the number of times specified by the corresponding scale factor. The xgrid operator takes one scale argument per source dimension.

Example

To scale a 2x1 array into a 2×2 array:

  1. Create a 2x1 array:

    AFL% create array M <v:double>[row=0:1; col=0:0];
    


    The output is:

    Query was executed successfully
  2. Initialize the array with the values 0 and 1:

    AFL% store(build(M, row*1+col), M);


    The output is:

    {row,col} v
    {0,0} 0
    {0,1} 1 
  3. Expand the array by a factor of two in the second dimension (columns):

    AFL% xgrid(M,1,2);


    The output is:

    {row,col} v
    {0,0} 0
    {0,1} 0
    {1,0} 1
    {1,1} 1

Â