Documentation of 'visad.SingletonSet' Java class
SingletonSet
visad

Class SingletonSet

    • 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 object
        java.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 RealTuple
        coord_sys - CoordinateSystem
        units - Units
        errors - ErrorEstimate
        Throws:
        VisADException - Couldn't create the necessary VisAD object
        java.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 the units argument (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 or null.
        units - The units of the numeric values or null.
        errors - Error estimates for the values or null.
        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 is null.
        See Also:
        CoordinateSystem.getCoordinateSystemUnits()
    • Method Detail

      • isMissing

        public boolean isMissing()
        Check if the samples are missing.
        Specified by:
        isMissing in interface Data
        Overrides:
        isMissing in class SampledSet
        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 neighbors is the return value, then neighbors[i][j] is the index of the jth neighbor of sample i.

        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:
        getNeighbors in interface SetIface
        Overrides:
        getNeighbors in class Set
        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 VisADException
        convert an array of 1-D indices to an array of values in R^DomainDimension
        Specified by:
        indexToValue in interface SetIface
        Specified by:
        indexToValue in class Set
        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 VisADException
        convert an array of 1-D indices to an array of doubles in R^DomainDimension
        Specified by:
        indexToDouble in interface SetIface
        Overrides:
        indexToDouble in class Set
        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 VisADException
        convert an array of values in R^DomainDimension to an array of 1-D indices
        Specified by:
        valueToIndex in interface SetIface
        Specified by:
        valueToIndex in class Set
        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 VisADException
        convert an array of doubles in R^DomainDimension to an array of 1-D indices
        Specified by:
        doubleToIndex in interface SetIface
        Overrides:
        doubleToIndex in class Set
        Returns:
        indices
        Throws:
        VisADException - couldn't create the necessary VisAD object
      • valueToInterp

        public void valueToInterp(float[][] value,
                                  int[][] indices,
                                  float[][] weights)
                           throws VisADException
        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)
        Specified by:
        valueToInterp in interface SimpleSetIface
        Specified by:
        valueToInterp in class SimpleSet
        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] is null.
        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] is null.
        Throws:
        VisADException - VisAD failure.
      • doubleToInterp

        public void doubleToInterp(double[][] value,
                                   int[][] indices,
                                   double[][] weights)
                            throws VisADException
        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)
        Throws:
        VisADException
      • getDoubles

        public double[][] getDoubles(boolean copy)
                              throws VisADException
        Get the values from the RealTuple as an array of doubles
        Specified by:
        getDoubles in interface SetIface
        Overrides:
        getDoubles in class Set
        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.
        Specified by:
        equals in interface SetIface
        Specified by:
        equals in class Set
        Returns:
        true if equal, otherwise false
      • hashCode

        public int hashCode()
        Returns the hash code of this instance.
        Overrides:
        hashCode in class java.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:
        cloneButType in interface SetIface
        Specified by:
        cloneButType in class Set
        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 VisADException
        Create string representation of this Set with a given prefix
        Specified by:
        longString in interface Data
        Overrides:
        longString in class Set
        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

You see the box below because you did not login.