visad
Class SingletonSet
- java.lang.Object
-
- visad.ThingImpl
-
- visad.DataImpl
-
- visad.Set
-
- visad.SimpleSet
-
- visad.SampledSet
-
- visad.SingletonSet
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Data, SampledSetIface, SetIface, SimpleSetIface, Thing
public class SingletonSet extends SampledSet
SingletonSet is the class for Set-s containing one member.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class visad.DataImpl
DataImpl.Syncher
-
-
Field Summary
-
Fields inherited from interface visad.Data
ABS, ACOS, ACOS_DEGREES, ADD, ASIN, ASIN_DEGREES, ATAN, ATAN_DEGREES, ATAN2, ATAN2_DEGREES, CEIL, COS, COS_DEGREES, DEGREES_TO_RADIANS, DEPENDENT, DIVIDE, EXP, FLOOR, INDEPENDENT, INV_ATAN2, INV_ATAN2_DEGREES, INV_DIVIDE, INV_POW, INV_REMAINDER, INV_SUBTRACT, LOG, MAX, MIN, MULTIPLY, NEAREST_NEIGHBOR, NEGATE, NO_ERRORS, NOP, POW, RADIANS_TO_DEGREES, REMAINDER, RINT, ROUND, SIN, SIN_DEGREES, SQRT, SUBTRACT, TAN, TAN_DEGREES, WEIGHTED_AVERAGE
-
-
Constructor Summary
Constructors Constructor and Description SingletonSet(RealTuple d)Construct a SingletonSet with the single sample given by a RealTupleSingletonSet(RealTuple d, CoordinateSystem coord_sys, Unit[] units, ErrorEstimate[] errors)Construct a SingletonSet with the single sample given by a RealTuple, and a non-default CoordinateSystem, Units and ErrorEstimates.SingletonSet(RealTupleType type, double[] values, CoordinateSystem coordSys, Unit[] units, ErrorEstimate[] errors)Constructs from a type, numeric values, units, coordinate system, and error estimates.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.ObjectcloneButType(MathType type)Clone this SingletonSet, but change the MathTypeint[]doubleToIndex(double[][] value)convert an array of doubles in R^DomainDimension to an array of 1-D indicesvoiddoubleToInterp(double[][] value, int[][] indices, double[][] weights)for each of an array of values in R^DomainDimension, compute an array of 1-D indices and an array of weights, to be used for interpolation; indices[i] and weights[i] are null if i-th value is outside grid (i.e., if no interpolation is possible)booleanequals(java.lang.Object set)See if this SingletonSet is equal to the Object in question.RealTuplegetData()Get the RealTuple that this SingletonSet was initialized with.double[][]getDoubles(boolean copy)Get the values from the RealTuple as an array of doublesvoidgetNeighbors(int[][] neighbors)Returns an array of indexes for neighboring points for each point in the set.inthashCode()Returns the hash code of this instance.double[][]indexToDouble(int[] index)convert an array of 1-D indices to an array of doubles in R^DomainDimensionfloat[][]indexToValue(int[] index)convert an array of 1-D indices to an array of values in R^DomainDimensionbooleanisMissing()Check if the samples are missing.java.lang.StringlongString(java.lang.String pre)Create string representation of this Set with a given prefixint[]valueToIndex(float[][] value)convert an array of values in R^DomainDimension to an array of 1-D indicesvoidvalueToInterp(float[][] value, int[][] indices, float[][] weights)for each of an array of values in R^DomainDimension, compute an array of 1-D indices and an array of weights, to be used for interpolation; indices[i] and weights[i] are null if i-th value is outside grid (i.e., if no interpolation is possible)-
Methods inherited from class visad.SampledSet
clone, computeRanges, computeRanges, cram_missing, finalize, getHi, getLow, getNeighbors, getSamples, getSamples, make1DGeometry, make3DGeometry, makePointGeometry, setCacheSizeThreshold, setGeometryArray, setGeometryArray
-
Methods inherited from class visad.SimpleSet
getManifoldDimension
-
Methods inherited from class visad.Set
__getitem__, __len__, addEqualsCache, addNotEqualsCache, copyDoubles, copyFloats, doubleToFloat, equalUnitAndCS, floatToDouble, getCoordinateSystem, getDimension, getDoubles, getLength, getNeighbors, getSetErrors, getSetUnits, getWedge, longString, main, make2DGeometry, makeIsoLines, makeIsoSurface, makeSpatial, merge1DSets, testEqualsCache, testNotEqualsCache, unary, unitAndCSHashCode
-
Methods inherited from class visad.DataImpl
__add__, __add__, __div__, __div__, __mod__, __mod__, __mul__, __mul__, __neg__, __pow__, __pow__, __radd__, __rdiv__, __rmod__, __rmul__, __rpow__, __rsub__, __sub__, __sub__, abs, abs, acos, acos, acosDegrees, acosDegrees, add, add, adjustSamplingError, asin, asin, asinDegrees, asinDegrees, atan, atan, atan2, atan2, atan2Degrees, atan2Degrees, atanDegrees, atanDegrees, binary, binary, ceil, ceil, changeMathType, computeRanges, computeRanges, cos, cos, cosDegrees, cosDegrees, dataClone, divide, divide, exp, exp, floor, floor, getType, local, log, log, max, max, min, min, multiply, multiply, negate, negate, notifyReferences, pow, pow, remainder, remainder, rint, rint, round, round, sin, sin, sinDegrees, sinDegrees, sqrt, sqrt, subtract, subtract, tan, tan, tanDegrees, tanDegrees, toString, unary
-
Methods inherited from class visad.ThingImpl
addReference, removeReference
-
Methods inherited from interface visad.SetIface
equalUnitAndCS, getCoordinateSystem, getDimension, getDoubles, getLength, getManifoldDimension, getNeighbors, getSetErrors, getSetUnits, getWedge, make2DGeometry, makeIsoLines, makeIsoSurface, makeSpatial, merge1DSets
-
Methods inherited from interface visad.Data
abs, abs, acos, acos, acosDegrees, acosDegrees, add, add, adjustSamplingError, asin, asin, asinDegrees, asinDegrees, atan, atan, atan2, atan2, atan2Degrees, atan2Degrees, atanDegrees, atanDegrees, binary, binary, ceil, ceil, changeMathType, computeRanges, computeRanges, cos, cos, cosDegrees, cosDegrees, dataClone, divide, divide, exp, exp, floor, floor, getType, local, log, log, longString, max, max, min, min, multiply, multiply, negate, negate, pow, pow, remainder, remainder, rint, rint, round, round, sin, sin, sinDegrees, sinDegrees, sqrt, sqrt, subtract, subtract, tan, tan, tanDegrees, tanDegrees, unary, unary
-
Methods inherited from interface visad.Thing
addReference, removeReference
-
-
-
-
Constructor Detail
-
SingletonSet
public SingletonSet(RealTuple d) throws VisADException, java.rmi.RemoteException
Construct a SingletonSet with the single sample given by a RealTuple- Parameters:
d- sample as a RealTuple- Throws:
VisADException- Couldn't create the necessary VisAD objectjava.rmi.RemoteException- Couldn't create the necessary remote object
-
SingletonSet
public SingletonSet(RealTuple d, CoordinateSystem coord_sys, Unit[] units, ErrorEstimate[] errors) throws VisADException, java.rmi.RemoteException
Construct a SingletonSet with the single sample given by a RealTuple, and a non-default CoordinateSystem, Units and ErrorEstimates.- Parameters:
d- sample as a RealTuplecoord_sys- CoordinateSystemunits- Unitserrors- ErrorEstimate- Throws:
VisADException- Couldn't create the necessary VisAD objectjava.rmi.RemoteException- Couldn't create the necessary remote object
-
SingletonSet
public SingletonSet(RealTupleType type, double[] values, CoordinateSystem coordSys, Unit[] units, ErrorEstimate[] errors) throws VisADException, java.rmi.RemoteException
Constructs from a type, numeric values, units, coordinate system, and error estimates.- Parameters:
type- The type for this instance.values- The numeric values in units of theunitsargument (if non-null); otherwise, in units of the coordinate system argument (if non-null); otherwise, in the default units of the type argument.coordSys- The coordinate system transformation for this instance ornull.units- The units of the numeric values ornull.errors- Error estimates for the values ornull.- Throws:
VisADException- if a VisAD failure occurs.java.rmi.RemoteException- if a Java RMI failure occurs.java.lang.NullPointerException- if the type or values argument isnull.- See Also:
CoordinateSystem.getCoordinateSystemUnits()
-
-
Method Detail
-
isMissing
public boolean isMissing()
Check if the samples are missing.- Specified by:
isMissingin interfaceData- Overrides:
isMissingin classSampledSet- Returns:
- false by definition, a SingletonSet never has missing samples since it is initialized with a RealTuple..
-
getNeighbors
public void getNeighbors(int[][] neighbors)
Returns an array of indexes for neighboring points for each point in the set. If
neighborsis the return value, thenneighbors[i][j]is the index of thejth neighbor of samplei.This implementation places an array of length zero into the single element of the input array. The length is zero because instances of this class have no neighboring sample points.
- Specified by:
getNeighborsin interfaceSetIface- Overrides:
getNeighborsin classSet- Parameters:
neighbors- The array to hold the indicial arrays for each sample point.- Throws:
java.lang.ArrayIndexOutOfBoundsException- if the length of the argument array is zero.
-
indexToValue
public float[][] indexToValue(int[] index) throws VisADExceptionconvert an array of 1-D indices to an array of values in R^DomainDimension- Specified by:
indexToValuein interfaceSetIface- Specified by:
indexToValuein classSet- Parameters:
index- array of integer indices- Returns:
- float array of values
- Throws:
VisADException- couldn't create the necessary VisAD object
-
indexToDouble
public double[][] indexToDouble(int[] index) throws VisADExceptionconvert an array of 1-D indices to an array of doubles in R^DomainDimension- Specified by:
indexToDoublein interfaceSetIface- Overrides:
indexToDoublein classSet- Parameters:
index- The indicies of the sample points.- Returns:
- double array of values
- Throws:
VisADException- couldn't create the necessary VisAD object
-
valueToIndex
public int[] valueToIndex(float[][] value) throws VisADExceptionconvert an array of values in R^DomainDimension to an array of 1-D indices- Specified by:
valueToIndexin interfaceSetIface- Specified by:
valueToIndexin classSet- Parameters:
value- float[domain_dimension][number_of_values] array of Set values- Returns:
- indices
- Throws:
VisADException- couldn't create the necessary VisAD object
-
doubleToIndex
public int[] doubleToIndex(double[][] value) throws VisADExceptionconvert an array of doubles in R^DomainDimension to an array of 1-D indices- Specified by:
doubleToIndexin interfaceSetIface- Overrides:
doubleToIndexin classSet- Returns:
- indices
- Throws:
VisADException- couldn't create the necessary VisAD object
-
valueToInterp
public void valueToInterp(float[][] value, int[][] indices, float[][] weights) throws VisADExceptionfor each of an array of values in R^DomainDimension, compute an array of 1-D indices and an array of weights, to be used for interpolation; indices[i] and weights[i] are null if i-th value is outside grid (i.e., if no interpolation is possible)- Specified by:
valueToInterpin interfaceSimpleSetIface- Specified by:
valueToInterpin classSimpleSet- Parameters:
value- An array of points.value[i][j]is the i-th coordinate of the j-th points.indices- Indices of the neighboring samples in the set. If the j-th points lies within the set, then returned element [i][j] is the index of the i-th neighboring sample in the set; otherwise, returned array [j] isnull.weights- Weights for interpolating the neighboring samples in the set. If the j-th points lies within the set, then returned element [i][j] is the weight of the i-th neighboring sample in the set; otherwise, returned array [j] isnull.- Throws:
VisADException- VisAD failure.
-
doubleToInterp
public void doubleToInterp(double[][] value, int[][] indices, double[][] weights) throws VisADExceptionfor each of an array of values in R^DomainDimension, compute an array of 1-D indices and an array of weights, to be used for interpolation; indices[i] and weights[i] are null if i-th value is outside grid (i.e., if no interpolation is possible)- Throws:
VisADException
-
getDoubles
public double[][] getDoubles(boolean copy) throws VisADExceptionGet the values from the RealTuple as an array of doubles- Specified by:
getDoublesin interfaceSetIface- Overrides:
getDoublesin classSet- Parameters:
copy- Whether or not to make a copy of the samples of the set.- Returns:
- samples as doubles.
- Throws:
VisADException- couldn't create the necessary VisAD object
-
getData
public RealTuple getData()
Get the RealTuple that this SingletonSet was initialized with.- Returns:
- RealTuple
-
equals
public boolean equals(java.lang.Object set)
See if this SingletonSet is equal to the Object in question. They are equal if they are the same object and have the same Units, CoordinateSystem, dimension and their getData() returns are the equal.
-
hashCode
public int hashCode()
Returns the hash code of this instance.- Overrides:
hashCodein classjava.lang.Object- Returns:
- The hash code of this instance.
-
cloneButType
public java.lang.Object cloneButType(MathType type) throws VisADException
Clone this SingletonSet, but change the MathType- Specified by:
cloneButTypein interfaceSetIface- Specified by:
cloneButTypein classSet- Parameters:
type- new MathType- Returns:
- clone of this set with new MathType
- Throws:
VisADException- couldn't create the new SingletonSet
-
longString
public java.lang.String longString(java.lang.String pre) throws VisADExceptionCreate string representation of this Set with a given prefix- Specified by:
longStringin interfaceData- Overrides:
longStringin classSet- Parameters:
pre- Prefix for the string.- Returns:
- String of the form pre + "SingletonSet: " + getData().toString()
- Throws:
VisADException- couldn't create the longString
-
-
DMelt 3.0 © DataMelt by jWork.ORG