next up previous
Next: Array section and type Up: Global variables Previous: Global scalar and data

Global array

collapsed dimension

  on(p) 
    float [[ ]] a = new float [[100]];

non-collapsed dimension

  Range x = new BlockRange(100, p.dim(0)) ;

  on(q) 
    float [[#]] b = new float [[x]];

multi-dimension array

  Range x = new BlockRange(100, p.dim(0)) ;  
  Range y = new CyclicRange(100, p.dim(1)) ;
  float [[#,#]] c = new float [[x, y]];

array of array

  float [[#,#]][] d;
  Range x[];
  Range y[];
  int[] size = {100, 200, 400};
  for (int l = 0; l < size.length; l++) {
    x[l] = new BlockRange(size[l], p.dim(0)) ;  
    y[l] = new BlockRange(size[l], p.dim(1)) ;  
    d[l] = new float [[x[l], y[l]]];
  }

will create an array show as in figure gif.

   figure43
Figure: Array of distributed array



Guansong Zhang
Thu Nov 13 17:36:47 EST 1997