ucar.nc2.iosp.hdf5
Class Tiling

java.lang.Object
  extended by ucar.nc2.iosp.hdf5.Tiling

public class Tiling
extends Object

A Tiling divides a multidimensional index into tiles. Abstraction of HDF5 chunking.

Index are points in the original multidimensional index. Tiles are points in the tiled space.

Each tile has the same size, given by tileSize.

Since:
Jul 20, 2007
Author:
caron

Constructor Summary
Tiling(int[] shape, int[] tileSize)
          Create a Tiling
 
Method Summary
 int compare(int[] p1, int[] p2)
          Create an ordering of index points based on which tile the point is in.
 int order(int[] pt)
          Get order based on which tile the pt belongs to
 int[] tile(int[] pt)
          Compute the tile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tiling

public Tiling(int[] shape,
              int[] tileSize)
Create a Tiling

Parameters:
shape - overall shape of the dataset's index space
tileSize - tile size. may be larger than the shape.
Method Detail

tile

public int[] tile(int[] pt)
Compute the tile

Parameters:
pt - index point
Returns:
corresponding tile

order

public int order(int[] pt)
Get order based on which tile the pt belongs to

Parameters:
pt - index point
Returns:
order number based on which tile the pt belongs to

compare

public int compare(int[] p1,
                   int[] p2)
Create an ordering of index points based on which tile the point is in.

Parameters:
p1 - index point 1
p2 - index point 2
Returns:
order(p1) - order(p2) : negative if p1 < p2, positive if p1 > p2 , 0 if equal


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.