public class ObliquePlaneIterator extends DataBlock implements ObliquePlaneIteratorInterface
Modifier and Type | Class and Description |
---|---|
protected class |
ObliquePlaneIterator.IOThread |
attributeOrder, axisOrdering, axisWeights, bounds, dataOrder, dimensionality, numAttributes, pointOrder, recordDesc
Constructor and Description |
---|
ObliquePlaneIterator(IndexSpaceID planeShape,
IndexSpaceID startpoint,
float[] normal,
int numsteps,
boolean threaded,
DataSource source)
Construct an ObliquePlaneIterator that represents data using a datablock
with shape specified by the first argument.
|
ObliquePlaneIterator(IndexSpaceID planeShape,
IndexSpaceID startpoint,
float[] normal,
int numsteps,
DataSource source)
Construct an ObliquePlaneIterator that represents data using a datablock
with shape specified by the first argument.
|
Modifier and Type | Method and Description |
---|---|
protected static int |
chooseProjectionAxis(float[] vector)
Return the axis along which the iterator will project the plane.
|
protected ISBoundsIterator |
createPrefetchIterator(ISBounds planeBounds,
ISBounds iterationSpace,
IndexSpaceID blockDimensions) |
void |
datum(Datum dtm,
IndexSpaceID did)
Return by reference the Datum corresponding to the given
IndexSpaceID.
|
void |
datum(Datum dtm,
IndexSpaceID did,
FieldIDMapper mp)
Get the Datum and fill its values in the passed Datum at positions
specified by the corresponding FieldIDMapper.
|
void |
datum(Datum dtm,
IndexSpaceID did,
RecordSpec recSpec)
Get the Datum and fill its values in the passed Datum at positions
specified by the corresponding RecordSpec.
|
void |
datum(Datum d,
int[] coordArray)
Given an array of coordinates, copy the corresponding datum
into the first parameter.
|
Datum |
datum(IndexSpaceID did)
Given an IndexSpaceID, return the corresponding datum.
|
Datum |
datum(IndexSpaceID did,
RecordSpec spec)
Given an IndexSpaceID, return the corresponding datum with attributes
specified in the RecordSpec.
|
void |
deactivate() |
void |
end()
Advance the iterator to the last valid value in the iteration.
|
protected void |
fetch(double[] centerPoint,
ISBoundsIterator planeIterator,
boolean fetchCurrent,
boolean fetchNext)
This method assumes that the underlying datasource is a MultiBlockCache.
|
protected void |
fetchCurrent(int step)
This method assumes that the underlying datasource is a MultiBlockCache.
|
protected void |
fetchCurrentandNext(int step)
This method assumes that the underlying datasource is a MultiBlockCache.
|
protected void |
fetchNext(int step)
This method assumes that the underlying datasource is a MultiBlockCache.
|
protected void |
fetchWorks(double[] centerPoint,
ISBoundsIterator planeIterator,
boolean fetchCurrent,
boolean fetchNext)
This method assumes that the underlying datasource is a MultiBlockCache.
|
protected void |
fillBlock(boolean initial)
This method fills the plane block with data read.
|
protected static int |
findMax(float[] vector)
Return the index of the element with maximum magnitude
|
float[] |
getCenterPoint()
Return the current center point of the plane in space.
|
float[] |
getCenterPoint(float[] point)
Return the current center point of the plane in space.
|
DataSource |
getDataSource()
Return the datasource being iterated over.
|
float[] |
getNormalArray()
Return a copy of the normals array.
|
IndexSpaceID[] |
getPlane3DVertices(IndexSpaceID[] vertices) |
int[] |
getPlaneShapeArray()
Return an array indicating the 2D shape of the iteration plane.
|
int |
getPlaneVolume()
Return the volume of the iteration plane.
|
float[] |
getProjectedNormalArray()
Return a projection of the normals array onto the projection Axis.
|
int |
getProjectionAxis()
Return the axis along which the iterator will project the plane.
|
ISBounds |
getSpaceBounds()
Returns an ISBounds representing the dimensions of the space being
iterated over.
|
int[] |
getSpaceShapeArray()
Returns an array of ints representing the dimensions of the space being
iterated over.
|
Values |
getValues()
return the Values (data) stored in this basicBlock
|
void |
init()
Perform any necessary initialization, and set the iterator value
to the first value in the iteration.
|
boolean |
next()
Advance the iterator by one step.
|
static void |
reduceByCoord(float[] vector,
int axis)
Divide all elements of the vector by the absolute value of the
coordinate at the specified axis.
|
protected void |
removePrefetchThread() |
void |
setDataSource(DataSource source)
Set the datasource being iterated over.
|
void |
setDatum(IndexSpaceID isid,
Datum d)
Set the location specified by the IndexSpaceID to the given datum.
|
static void |
setEffectiveZeros(float[] normal,
int numSteps)
Any component of the normal that is sufficiently small will be set
to zero.
|
protected void |
setFetchPlane(ISBoundsIterator planeIterator,
double[] point,
int step)
Set the iteration space of the 2D plane iterator to correspond to
the given 3D iteration step.
|
void |
setSPCacheBlocks(boolean spBlockShape)
Indicate to this iterator whether the underlying cache has blocks shaped according to
the plane normal.
|
int |
size()
Deprecated.
Use volume()
|
void |
subblock(DataBlock theBlock,
ISBounds dstBounds,
ISBounds srcBounds)
Reads a subblock defined by srcBounds into the region of the Datablock argument
defined by dstBounds.
|
void |
subblock(DataBlock theBlock,
ISBounds dstBounds,
ISBounds srcBounds,
FieldIDMapper mp)
Reads a subblock defined by srcBounds into the region of the Datablock argument
defined by dstBounds.
|
void |
subblock(DataBlock theBlock,
ISBounds dstBounds,
ISBounds srcBounds,
RecordSpec spec)
Reads a subblock defined by srcBounds into the region of the Datablock argument
defined by dstBounds.
|
DataBlock |
subblock(ISBounds db)
Return a new DataBlock that is a subset of this datablock.
|
java.lang.String |
toString()
Write the values of the entire DataBlock index space to a string in
a nice format.
|
boolean |
valid()
Return true if the iterator currently has a valid value, false otherwise.
|
int |
volume()
Return the number of elements in the datablock.
|
setByAttribute, setByte, setBytes, setBytes, setBytesByAttribute, setBytesByPoint, setDouble, setDoubles, setDoubles, setDoublesByAttribute, setDoublesByPoint, setFloat, setFloats, setFloats, setFloatsByAttribute, setFloatsByPoint, setInt, setInts, setInts, setIntsByAttribute, setIntsByPoint, setShort, setShorts, setShorts, setShortsByAttribute, setShortsByPoint, setValues, setValues, setValuesByAttribute, setValuesByPoint
byteSize, computeOffset, computeOffset, copyBounds, createDataBlock, createDataBlock, createDataBlock, createDatum, createDatum, createDatum, createDatum, createDatum, createDatum, datum, dim, getAttributeNames, getAxisOrdering, getAxisWeight, getAxisWeights, getBounds, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytesByAttribute, getBytesByAttribute, getBytesByPoint, getBytesByPoint, getDataOrder, getDimensionsArray, getDouble, getDoubles, getDoubles, getDoubles, getDoubles, getDoubles, getDoubles, getDoublesByAttribute, getDoublesByAttribute, getDoublesByPoint, getDoublesByPoint, getFloat, getFloats, getFloats, getFloats, getFloats, getFloats, getFloats, getFloatsByAttribute, getFloatsByAttribute, getFloatsByPoint, getFloatsByPoint, getInt, getInts, getInts, getInts, getInts, getInts, getInts, getIntsByAttribute, getIntsByAttribute, getIntsByPoint, getIntsByPoint, getLowerBoundsArray, getNumAttributes, getRecordDescriptor, getShort, getShorts, getShorts, getShorts, getShorts, getShorts, getShorts, getShortsByAttribute, getShortsByAttribute, getShortsByPoint, getShortsByPoint, getStorageType, getUpperBoundsArray, getValues, getValuesByAttribute, getValuesByPoint, longVolume, setAxisOrdering, setBounds, setRecordDescriptor, subblock, subblock, subblock, subblock, subblock, subblock, subblock, subblock, useBytesOnly
protected BasicBlock theBlock
protected DataSource theSource
protected int spaceDimensionality
protected int currentStep
protected int numSteps
protected boolean valid
protected double[] currentPoint
protected double[] startPoint
protected double[] prefetchPoint
protected float[] normal
protected double[] shiftTotals
protected int projectionAxis
protected ISIterator planeIterator
protected ISBounds planeBounds
protected ISBounds startBounds
protected ISBoundsIterator fetchIterator
protected ISBounds fetchBounds
protected int[] blockDimensionsArray
protected edu.unh.sdb.datasource.ObliquePlaneIterator.PlaneMapper planemapper
protected int plane0
protected int plane1
protected RegularISPartitioning planePartitioning
protected ISBounds dilatedFetchBounds
protected IntegerIndexSpaceID spaceLocation
protected IntegerIndexSpaceID mainSpaceLocation
protected IntegerIndexSpaceID blockLocation
protected IntegerIndexSpaceID block_plane_offset
protected IndexSpaceID scratchID2D
protected IndexSpaceID mainScratchID2D
protected IndexSpaceID scratchID3D
protected double[] absNormal
protected int[] normalSigns
protected int[] shiftDirections
protected int prefetchInterval
protected boolean threaded
protected ObliquePlaneIterator.IOThread prefetchThread
protected int[] sQBLowerInts
protected int[] sQBUpperInts
protected int[] datumCoords1
protected ISBounds sourceQueryBounds
protected edu.unh.sdb.datasource.CacheContext mainCacheContext
protected RegularISPartitioning cachePartitioning
protected Datum datum
protected DSBlockStencil stencil
protected IndexSpaceID externalScratchID
protected boolean SPBlockShape
protected boolean stoppedPrefetching
public ObliquePlaneIterator(IndexSpaceID planeShape, IndexSpaceID startpoint, float[] normal, int numsteps, DataSource source)
public ObliquePlaneIterator(IndexSpaceID planeShape, IndexSpaceID startpoint, float[] normal, int numsteps, boolean threaded, DataSource source)
public static void setEffectiveZeros(float[] normal, int numSteps)
public void init()
init
in interface SDBIterator
public boolean next()
next
in interface SDBIterator
public boolean valid()
valid
in interface SDBIterator
public void end()
end
in interface SDBIterator
protected void fetch(double[] centerPoint, ISBoundsIterator planeIterator, boolean fetchCurrent, boolean fetchNext)
protected void fetchWorks(double[] centerPoint, ISBoundsIterator planeIterator, boolean fetchCurrent, boolean fetchNext)
protected void fetchNext(int step)
protected void fetchCurrent(int step)
protected void fetchCurrentandNext(int step)
protected ISBoundsIterator createPrefetchIterator(ISBounds planeBounds, ISBounds iterationSpace, IndexSpaceID blockDimensions)
protected void setFetchPlane(ISBoundsIterator planeIterator, double[] point, int step)
protected void fillBlock(boolean initial)
protected void removePrefetchThread()
public void deactivate()
protected static int findMax(float[] vector)
protected static int chooseProjectionAxis(float[] vector)
public int getProjectionAxis()
public static void reduceByCoord(float[] vector, int axis)
public DataSource getDataSource()
getDataSource
in interface ObliquePlaneIteratorInterface
public void setSPCacheBlocks(boolean spBlockShape)
setSPCacheBlocks
in interface ObliquePlaneIteratorInterface
public void setDataSource(DataSource source)
setDataSource
in interface ObliquePlaneIteratorInterface
public float[] getNormalArray()
getNormalArray
in interface ObliquePlaneIteratorInterface
public float[] getProjectedNormalArray()
public int[] getPlaneShapeArray()
getPlaneShapeArray
in interface ObliquePlaneIteratorInterface
public int getPlaneVolume()
public IndexSpaceID[] getPlane3DVertices(IndexSpaceID[] vertices)
public final ISBounds getSpaceBounds()
getSpaceBounds
in interface ObliquePlaneIteratorInterface
public final int[] getSpaceShapeArray()
getSpaceShapeArray
in interface ObliquePlaneIteratorInterface
public final float[] getCenterPoint()
public final float[] getCenterPoint(float[] point)
public int size()
size
in class DataCollection
public int volume()
volume
in class DataCollection
public Datum datum(IndexSpaceID did)
datum
in interface Indexable
datum
in class DataCollection
public void datum(Datum d, int[] coordArray)
datum
in class DataCollection
public Datum datum(IndexSpaceID did, RecordSpec spec)
datum
in interface Indexable
datum
in class DataCollection
public void datum(Datum dtm, IndexSpaceID did, RecordSpec recSpec)
datum
in interface Indexable
datum
in class DataCollection
public void datum(Datum dtm, IndexSpaceID did, FieldIDMapper mp)
datum
in interface Indexable
datum
in class DataCollection
public void datum(Datum dtm, IndexSpaceID did)
datum
in interface Indexable
datum
in class DataCollection
public void setDatum(IndexSpaceID isid, Datum d)
public DataBlock subblock(ISBounds db)
subblock
in interface Indexable
subblock
in class DataCollection
public void subblock(DataBlock theBlock, ISBounds dstBounds, ISBounds srcBounds)
subblock
in interface Indexable
subblock
in class DataCollection
public void subblock(DataBlock theBlock, ISBounds dstBounds, ISBounds srcBounds, FieldIDMapper mp)
subblock
in interface Indexable
subblock
in class DataCollection
public Values getValues()
public void subblock(DataBlock theBlock, ISBounds dstBounds, ISBounds srcBounds, RecordSpec spec)
subblock
in interface Indexable
subblock
in class DataCollection