edu.unh.sdb.datasource
Class CacheMaker

java.lang.Object
  extended by edu.unh.sdb.datasource.CacheMaker

public class CacheMaker
extends java.lang.Object


Field Summary
static boolean useCubicForOblique
           
static boolean useIsometricCubicForOblique
           
 
Constructor Summary
CacheMaker()
           
 
Method Summary
static IntegerIndexSpaceID computeBestBlockShape(AxisOrdering iteratorOrdering, int[] axisLengths, int elementByteSize, long memAvailable)
           
static void computeCacheArrayDimensions(float[] normal, int[] planeShape, int[] cacheBlockDimensions, int[] cacheArrayDimensions, int projectionAxis, int max2Axis, boolean threaded)
           
static void computeCacheBlockDimensions(int s, int[] cacheBlockDimensions, float[] normal, int[] spaceDimensions, int dimensionality)
           
static boolean computeDimensions(int[] cacheBlockDimensions, int[] cacheArrayDimensions, float[] normal, float[] truePlaneNormal, int[] planeShape, int[] boundingBoxDimensions, int projectionAxis, int dimensionality, int elementByteSize, long memAvailable, boolean threaded)
           
static int computeMaxScaleFactor(int projectionAxis, int[] spaceDimensions)
           
static long computeRequiredMemory(int[] cacheBlockDimensions, int[] cacheArrayDimensions, int elementByteSize)
           
static DataSource createCacheDS(ChunkedDataSource source, ISIterator iter, long memAvailable)
           
static DataSource createCacheDS(DataSource source, ISBounds iterationSpace, AxisOrdering iteratorOrdering, long memAvailable)
           
static DataSource createCacheDS(DataSource source, ISBoundsIterator iter, long memAvailable)
           
static DataSource createCacheDS(DataSource source, ISIterator iter, long memAvailable)
           
static DataSource createCacheDS(ObliquePlaneIteratorInterface iter, int[] cacheBlockDimensions, long memAvailable)
          Create a MultiBlockCache for the given ObliquePlaneIterator using cache blocks of the specified dimensions.
static DataSource createCacheDS(ObliquePlaneIteratorInterface iter, int[] cacheBlockDimensions, long memAvailable, boolean threaded)
          Create a MultiBlockCache for the given ObliquePlaneIterator using cache blocks of the specified dimensions.
static DataSource createCacheDS(ObliquePlaneIteratorInterface iter, long memAvailable)
           
static DataSource createCacheDS(ObliquePlaneIteratorInterface iter, long memAvailable, boolean threaded)
           
static DataSource createThreadedCacheDS(DataSource source, ISBoundsIterator iter, long memAvailable)
           
static DataSource createThreadedCacheDS(DataSource source, ISIterator iter, long memAvailable)
           
static DataSource createThreadedSliceCacheDS(DataSource source, ISBounds iterationSpace, int sliceAxis, long memAvailable)
           
static DataSource createThreadedSliceCacheDS(DataSource source, ISBoundsIterator iter, long memAvailable)
           
static DataSource createThreadedSliceCacheDS(DataSource source, ISIterator iter, long memAvailable)
           
static int findMax(float[] normal)
           
static int findMin(float[] normal)
           
protected static int findSecondMax(float[] vector, int maxindex)
          Return the index of the element with second largest magnitude
static void main(java.lang.String[] args)
           
protected static void massage(float[] vector)
          This method finds the smallest magnitude non-zero coordinate and divides the other coordinates by this value.
static boolean reduceNormal(float[] normal)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

useCubicForOblique

public static boolean useCubicForOblique

useIsometricCubicForOblique

public static boolean useIsometricCubicForOblique
Constructor Detail

CacheMaker

public CacheMaker()
Method Detail

createCacheDS

public static DataSource createCacheDS(DataSource source,
                                       ISIterator iter,
                                       long memAvailable)

createCacheDS

public static DataSource createCacheDS(DataSource source,
                                       ISBounds iterationSpace,
                                       AxisOrdering iteratorOrdering,
                                       long memAvailable)

createCacheDS

public static DataSource createCacheDS(DataSource source,
                                       ISBoundsIterator iter,
                                       long memAvailable)

createCacheDS

public static DataSource createCacheDS(ChunkedDataSource source,
                                       ISIterator iter,
                                       long memAvailable)

createCacheDS

public static DataSource createCacheDS(ObliquePlaneIteratorInterface iter,
                                       long memAvailable)

createCacheDS

public static DataSource createCacheDS(ObliquePlaneIteratorInterface iter,
                                       long memAvailable,
                                       boolean threaded)

createCacheDS

public static DataSource createCacheDS(ObliquePlaneIteratorInterface iter,
                                       int[] cacheBlockDimensions,
                                       long memAvailable)
Create a MultiBlockCache for the given ObliquePlaneIterator using cache blocks of the specified dimensions. This method is meant for evaluation purposes, and would not normally be used.


createCacheDS

public static DataSource createCacheDS(ObliquePlaneIteratorInterface iter,
                                       int[] cacheBlockDimensions,
                                       long memAvailable,
                                       boolean threaded)
Create a MultiBlockCache for the given ObliquePlaneIterator using cache blocks of the specified dimensions. This method is meant for evaluation purposes, and would not normally be used.


reduceNormal

public static boolean reduceNormal(float[] normal)

findMax

public static int findMax(float[] normal)

findMin

public static int findMin(float[] normal)

findSecondMax

protected static int findSecondMax(float[] vector,
                                   int maxindex)
Return the index of the element with second largest magnitude


computeDimensions

public static boolean computeDimensions(int[] cacheBlockDimensions,
                                        int[] cacheArrayDimensions,
                                        float[] normal,
                                        float[] truePlaneNormal,
                                        int[] planeShape,
                                        int[] boundingBoxDimensions,
                                        int projectionAxis,
                                        int dimensionality,
                                        int elementByteSize,
                                        long memAvailable,
                                        boolean threaded)

computeRequiredMemory

public static long computeRequiredMemory(int[] cacheBlockDimensions,
                                         int[] cacheArrayDimensions,
                                         int elementByteSize)

computeMaxScaleFactor

public static int computeMaxScaleFactor(int projectionAxis,
                                        int[] spaceDimensions)

computeCacheBlockDimensions

public static void computeCacheBlockDimensions(int s,
                                               int[] cacheBlockDimensions,
                                               float[] normal,
                                               int[] spaceDimensions,
                                               int dimensionality)

computeCacheArrayDimensions

public static void computeCacheArrayDimensions(float[] normal,
                                               int[] planeShape,
                                               int[] cacheBlockDimensions,
                                               int[] cacheArrayDimensions,
                                               int projectionAxis,
                                               int max2Axis,
                                               boolean threaded)

massage

protected static void massage(float[] vector)
This method finds the smallest magnitude non-zero coordinate and divides the other coordinates by this value.


createThreadedCacheDS

public static DataSource createThreadedCacheDS(DataSource source,
                                               ISIterator iter,
                                               long memAvailable)

createThreadedCacheDS

public static DataSource createThreadedCacheDS(DataSource source,
                                               ISBoundsIterator iter,
                                               long memAvailable)

createThreadedSliceCacheDS

public static DataSource createThreadedSliceCacheDS(DataSource source,
                                                    ISIterator iter,
                                                    long memAvailable)

createThreadedSliceCacheDS

public static DataSource createThreadedSliceCacheDS(DataSource source,
                                                    ISBounds iterationSpace,
                                                    int sliceAxis,
                                                    long memAvailable)

createThreadedSliceCacheDS

public static DataSource createThreadedSliceCacheDS(DataSource source,
                                                    ISBoundsIterator iter,
                                                    long memAvailable)

computeBestBlockShape

public static IntegerIndexSpaceID computeBestBlockShape(AxisOrdering iteratorOrdering,
                                                        int[] axisLengths,
                                                        int elementByteSize,
                                                        long memAvailable)

main

public static void main(java.lang.String[] args)