Documentation of 'visad.Set' Java class
Set
visad

Class Set

    • Constructor Detail

      • Set

        public Set(MathType type,
                   CoordinateSystem coord_sys)
            throws VisADException
        Constructs a Set object with a non-default CoordinateSystem.

        Parameters:
        type - The type of the Set.
        coord_sys - The CoordinateSystem associated with this Set.
        Throws:
        VisADException
      • Set

        public Set(MathType type,
                   CoordinateSystem coord_sys,
                   Unit[] units,
                   ErrorEstimate[] errors)
            throws VisADException
        Constructs a Set object with a non-default CoordinateSystem, non-default Unit-s, and non-default errors. This is the most general constructor.

        Parameters:
        type - The MathType of the set. May be a RealType, a RealTupleType, or a SetType.
        coord_sys - Optional coordinate system for the domain of the set. May be null, in which case the default coordinate system of the domain is used.
        units - Optional units for the values. May be null, in which case the default units of the domain are used. If the ith element is non-null and the RealType of the corresponding domain component is an interval, then the unit that is actually used is units[i].getAbsoluteUnit().
        errors - Error estimates. May be null. errors[i] is the error estimate for the i-th component and may be null.
        Throws:
        VisADException
    • Method Detail

      • getSetUnits

        public Unit[] getSetUnits()
        Returns the units of the values in the set. The units may differ from the default units of the underlying MathType but will be convertible with them.
        Specified by:
        getSetUnits in interface SetIface
        Returns:
        The units of the values in the set. Will not be null. RETURN_VALUE[i] is the unit of the i-th component and may be null.
      • getSetErrors

        public ErrorEstimate[] getSetErrors()
        Returns the error estimates of the values in the set.
        Specified by:
        getSetErrors in interface SetIface
        Returns:
        Error estimates for the set. Will not be null. RETURN_VALUE[i] is the error estimate for the i-th component and may be null.
      • getCoordinateSystem

        public CoordinateSystem getCoordinateSystem()
        Gets the coordinate system of this domain set (DomainCoordinateSystem).
        Specified by:
        getCoordinateSystem in interface SetIface
        Returns:
        The coordinate system of this domain set. This will be the coordinate system passed to the constructor if non-null; otherwise, the (default) coordinate system of the underlying RealTupleType (which may be null).
      • getDimension

        public int getDimension()
        get DomainDimension (i.e., this is a subset of R^DomainDimension)
        Specified by:
        getDimension in interface SetIface
        Returns:
        The rank of the samples in the set.
      • getManifoldDimension

        public int getManifoldDimension()
        for non-SimpleSet, ManifoldDimension = DomainDimension
        Specified by:
        getManifoldDimension in interface SetIface
        Returns:
        The rank of the manifold of the set.
      • getWedge

        public int[] getWedge()
        return an enumeration of sample indices in a spatially coherent order; this is useful for efficiency
        Specified by:
        getWedge in interface SetIface
        Returns:
        Indices of the samples of the set in a zig- zagging pattern with good coherence.
      • getSamples

        public float[][] getSamples()
                             throws VisADException
        return an enumeration of sample values in index order (i.e., not in getWedge order); the return array is organized as float[domain_dimension][number_of_samples]
        Specified by:
        getSamples in interface SetIface
        Returns:
        An enumeration of the samples of the set. Element [i][j] is the i-th coordinate of the j-th sample.
        Throws:
        VisADException - VisAD failure.
        See Also:
        SetIface.getSamples(boolean copy)
      • getSamples

        public float[][] getSamples(boolean copy)
                             throws VisADException
        Description copied from interface: SetIface
        Returns an enumeration of the samples of the set in index order.
        Specified by:
        getSamples in interface SetIface
        Parameters:
        copy - Whether or not to make a copy of the samples of the set.
        Returns:
        An enumeration of the samples of the set. Element [i][j] is the i-th coordinate of the j-th sample.
        Throws:
        VisADException - VisAD failure.
      • getDoubles

        public double[][] getDoubles()
                              throws VisADException
        Description copied from interface: SetIface
        Returns an enumeration of the samples of the set in index order. This is the same as getDoubles(true).
        Specified by:
        getDoubles in interface SetIface
        Returns:
        An enumeration of the samples of the set. Element [i][j] is the i-th coordinate of the j-th sample.
        Throws:
        VisADException - VisAD failure.
        See Also:
        SetIface.getDoubles(boolean copy)
      • getDoubles

        public double[][] getDoubles(boolean copy)
                              throws VisADException
        Description copied from interface: SetIface
        Returns an enumeration of the samples of the set in index order.
        Specified by:
        getDoubles in interface SetIface
        Parameters:
        copy - Whether or not to make a copy of the samples of the set.
        Returns:
        An enumeration of the samples of the set. Element [i][j] is the i-th coordinate of the j-th sample.
        Throws:
        VisADException - VisAD failure.
      • cram_missing

        public void cram_missing(boolean[] range_select)
        Specified by:
        cram_missing in interface SetIface
      • indexToValue

        public abstract float[][] indexToValue(int[] index)
                                        throws VisADException
        return Set values corresponding to Set indices
        Specified by:
        indexToValue in interface SetIface
        Parameters:
        index - array of integer indices
        Returns:
        float[domain_dimension][indices.length] array of Set values
        Throws:
        VisADException - a VisAD error occurred
      • valueToIndex

        public abstract int[] valueToIndex(float[][] value)
                                    throws VisADException
        return Set indices of Set values closest to value elements (return -1 for any value outside Set range)
        Specified by:
        valueToIndex in interface SetIface
        Parameters:
        value - float[domain_dimension][number_of_values] array of Set values
        Returns:
        array of integer indices
        Throws:
        VisADException - a VisAD error occurred
      • computeRanges

        public DataShadow computeRanges(ShadowType type,
                                        DataShadow shadow)
                                 throws VisADException
        Description copied from interface: Data
        Recursive version of computeRanges(), called down through Data object tree.
        Specified by:
        computeRanges in interface Data
        Parameters:
        type - ShadowType generated for MathType of this
        shadow - DataShadow instance whose contained double[][] array and animation sampling Set are modified according to RealType values in this, and used as return value
        Returns:
        DataShadow instance containing double[][] array of RealType ranges, and an animation sampling Set
        Throws:
        VisADException - a VisAD error occurred
      • makeIsoLines

        public VisADGeometryArray[][] makeIsoLines(float[] intervals,
                                                   float lowlimit,
                                                   float highlimit,
                                                   float base,
                                                   float[] fieldValues,
                                                   byte[][] color_values,
                                                   boolean[] swap,
                                                   boolean dash,
                                                   boolean fill,
                                                   ScalarMap[] smap,
                                                   double[] scale,
                                                   double label_size,
                                                   boolean sphericalDisplayCS)
                                            throws VisADException
        return basic lines in array[0], fill-ins in array[1] and labels in array[2]
        Specified by:
        makeIsoLines in interface SetIface
        Throws:
        VisADException
      • indexToDouble

        public double[][] indexToDouble(int[] index)
                                 throws VisADException
        Returns an array of sample-point values corresponding to an array of sample-point indicies.
        Specified by:
        indexToDouble in interface SetIface
        Parameters:
        index - The indicies of the sample points.
        Returns:
        A corresponding array of sample-point values. RETURN_VALUE[i][j] is the jth component of sample-point i.
        Throws:
        VisADException - if a VisAD failure occurs.
      • floatToDouble

        public static double[][] floatToDouble(float[][] value)
      • doubleToFloat

        public static float[][] doubleToFloat(double[][] value)
      • copyFloats

        public static float[][] copyFloats(float[][] samples)
      • copyDoubles

        public static double[][] copyDoubles(double[][] samples)
      • getNeighbors

        public void getNeighbors(int[][] neighbors)
                          throws VisADException

        Returns the indexes of the neighboring points for every point in the set. neighbors.length should be at least getLength(). On return, neighbors[i][j] will be the index of the j -th neighboring point of point i. This method will allocate and set the array neighbors[i] for all i.

        This implementation always throws an UnimplementedException.

        Specified by:
        getNeighbors in interface SetIface
        Parameters:
        neighbors - The array to contain the indexes of the neighboring points.
        Throws:
        java.lang.NullPointerException - if the array is null.
        java.lang.ArrayIndexOutOfBoundsException - if neighbors.length < getLength() .
        VisADException - if a VisAD failure occurs.
      • getNeighbors

        public int[][] getNeighbors(int dimension)
                             throws VisADException

        Returns the indexes of the neighboring points along a manifold dimesion for every point in the set. Elements [i][0] and [i][1] of the returned array are the indexes of the neighboring sample points in the direction of decreasing and increasing manifold index, respectively, for sample point i. If a sample point doesn't have a neighboring point (because it is an exterior point, for example) then the value of the corresponding index will be -1.

        This implementation always throws an UnimplementedException.

        Specified by:
        getNeighbors in interface SetIface
        Parameters:
        dimension - The index of the manifold dimension along which to return the neighboring points.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - if manifoldIndex < 0 || manifoldIndex >= getManifoldDimension() .
        VisADException - if a VisAD failure occurs.
        See Also:
        getManifoldDimension()
      • testNotEqualsCache

        public boolean testNotEqualsCache(Set set)
        test set against a cache of Set-s not equal to this
      • addNotEqualsCache

        public void addNotEqualsCache(Set set)
        add set to a cache of Set-s not equal to this
      • testEqualsCache

        public boolean testEqualsCache(Set set)
        test set against a cache of Set-s equal to this
      • addEqualsCache

        public void addEqualsCache(Set set)
        add set to a cache of Set-s equal to this
      • equalUnitAndCS

        public boolean equalUnitAndCS(Set set)
        test equality of SetUnits and DomainCoordinateSystem between this and set
        Specified by:
        equalUnitAndCS in interface SetIface
      • unitAndCSHashCode

        public int unitAndCSHashCode()
        Returns the hash code of the units and coordinate-system. This is the hash code analogue of equalUnitAndCS(Set).
        Returns:
        The hash code of the units and coordinate system.
      • equals

        public abstract boolean equals(java.lang.Object set)
        test for equality
        Specified by:
        equals in interface SetIface
        Overrides:
        equals in class java.lang.Object
      • clone

        public java.lang.Object clone()
        Clones this instance.
        Overrides:
        clone in class DataImpl
        Returns:
        A clone of this instance.
      • unary

        public Data unary(int op,
                          MathType new_type,
                          int sampling_mode,
                          int error_mode)
                   throws VisADException,
                          java.rmi.RemoteException
        Description copied from class: DataImpl
        Pointwise unary operation applied to this. Applies to Reals, Tuples (recursively to components), and to Field ranges (Field domains implicitly resampled if necessary). Does not apply to Field domains, Sets (regarded as domains of Fields wthout ranges) or Text.
        Specified by:
        unary in interface Data
        Overrides:
        unary in class DataImpl
        Parameters:
        op - may be Data.ABS, Data.ACOS, etc; these include all unary operations defined for Java primitive data types
        new_type - MathType of the result
        sampling_mode - may be Data.NEAREST_NEIGHBOR or Data.WEIGHTED_AVERAGE
        error_mode - may be Data.INDEPENDENT, Data.DEPENDENT or Data.NO_ERRORS;
        Returns:
        result, with MathType = new_type
        Throws:
        VisADException - a VisAD error occurred
        java.rmi.RemoteException - an RMI error occurred
      • cloneButType

        public abstract java.lang.Object cloneButType(MathType type)
                                               throws VisADException
        copy this Set, but give it a new MathType; this is safe, since constructor checks consistency of DomainCoordinateSystem and SetUnits with Type
        Specified by:
        cloneButType in interface SetIface
        Parameters:
        type - The MathType for the clone.
        Returns:
        A clone of this set with the new MathType.
        Throws:
        VisADException - VisAD failure.
      • longString

        public java.lang.String longString(java.lang.String pre)
                                    throws VisADException
        Specified by:
        longString in interface Data
        Overrides:
        longString in class DataImpl
        Parameters:
        pre - String added to start of each line
        Returns:
        a longer String than returned by toString(), indented by pre (a string of blanks)
        Throws:
        VisADException

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.