Documentation of 'visad.LinearNDSet' Java class
LinearNDSet
visad

Class LinearNDSet

    • Constructor Detail

      • LinearNDSet

        public LinearNDSet(MathType type,
                           Linear1DSet[] l)
                    throws VisADException
        Construct an N-dimensional set as the product of N Linear1DSets, with null errors, CoordinateSystem and Units are defaults from type.
        Parameters:
        type - MathType for this LinearNDSet. Must be consistent with MathType-s of sets.
        l - Linear1DSets that make up this LinearNDSet.
        Throws:
        VisADException - problem creating VisAD objects.
      • LinearNDSet

        public LinearNDSet(MathType type,
                           double[] firsts,
                           double[] lasts,
                           int[] lengths)
                    throws VisADException
        Construct an N-dimensional set as the product of N arithmetic progressions (lengths[i] samples between firsts[i] and lasts[i]), with null errors, CoordinateSystem and Units are defaults from type
        Parameters:
        type - MathType for this LinearNDSet.
        firsts - array of first values for each of the arithmetic progressions
        lasts - array of last values for each of the arithmetic progressions
        lengths - array of number of samples for each of the arithmetic progressions
        Throws:
        VisADException - problem creating VisAD objects.
      • LinearNDSet

        public LinearNDSet(MathType type,
                           double[] firsts,
                           double[] lasts,
                           int[] lengths,
                           CoordinateSystem coord_sys,
                           Unit[] units,
                           ErrorEstimate[] errors)
                    throws VisADException
        Construct an N-dimensional set as the product of N arithmetic progressions (lengths[i] samples between firsts[i] and lasts[i]), coordinate_system and units must be compatible with defaults for type, or may be null; errors may be null.
        Parameters:
        type - MathType for this LinearNDSet.
        firsts - array of first values for each of the arithmetic progressions
        lasts - array of last values for each of the arithmetic progressions
        lengths - array of number of samples for each of the arithmetic progressions
        coord_sys - CoordinateSystem for this set. May be null, but if not, must be consistent with type.
        units - Unit-s for the values in sets. May be null, but must be convertible with default of type if not null.
        errors - ErrorEstimate-s for values in sets, may be null
        Throws:
        VisADException - problem creating VisAD objects.
      • LinearNDSet

        public LinearNDSet(MathType type,
                           double[] firsts,
                           double[] lasts,
                           int[] lengths,
                           CoordinateSystem coord_sys,
                           Unit[] units,
                           ErrorEstimate[] errors,
                           boolean cache)
                    throws VisADException
        Construct an N-dimensional set as the product of N arithmetic progressions (lengths[i] samples between firsts[i] and lasts[i]), coordinate_system and units must be compatible with defaults for type, or may be null; errors may be null.
        Parameters:
        type - MathType for this LinearNDSet.
        firsts - array of first values for each of the arithmetic progressions
        lasts - array of last values for each of the arithmetic progressions
        lengths - array of number of samples for each of the arithmetic progressions
        coord_sys - CoordinateSystem for this set. May be null, but if not, must be consistent with type.
        units - Unit-s for the values in sets. May be null, but must be convertible with default of type if not null.
        errors - ErrorEstimate-s for values in sets, may be null
        cache - if true, enumerate and cache the samples. This will result in a larger memory footprint, but will reduce the time to return samples from calls to SampledSet.getSamples().
        Throws:
        VisADException - problem creating VisAD objects.
      • LinearNDSet

        public LinearNDSet(MathType type,
                           Linear1DSet[] l,
                           CoordinateSystem coord_sys,
                           Unit[] units,
                           ErrorEstimate[] errors)
                    throws VisADException
        Construct an N-dimensional set as the product of N Linear1DSets; coordinate_system and units must be compatible with defaults for type, or may be null; errors may be null
        Parameters:
        type - MathType for this LinearNDSet. Must be consistent with MathType-s of sets.
        l - Linear1DSets that make up this LinearNDSet.
        coord_sys - CoordinateSystem for this set. May be null, but if not, must be consistent with type.
        units - Unit-s for the values in sets. May be null, but must be convertible with default of type if not null.
        errors - ErrorEstimate-s for values in sets, may be null
        Throws:
        VisADException - problem creating VisAD objects.
      • LinearNDSet

        public LinearNDSet(MathType type,
                           Linear1DSet[] l,
                           CoordinateSystem coord_sys,
                           Unit[] units,
                           ErrorEstimate[] errors,
                           boolean cache)
                    throws VisADException
        Construct an N-dimensional set as the product of N Linear1DSets; coordinate_system and units must be compatible with defaults for type, or may be null; errors may be null
        Parameters:
        type - MathType for this LinearNDSet. Must be consistent with MathType-s of sets.
        l - Linear1DSets that make up this LinearNDSet.
        coord_sys - CoordinateSystem for this set. May be null, but if not, must be consistent with type.
        units - Unit-s for the values in sets. May be null, but must be convertible with default of type if not null.
        errors - ErrorEstimate-s for values in sets, may be null
        cache - if true, enumerate and cache the samples. This will result in a larger memory footprint, but will reduce the time to return samples from calls to SampledSet.getSamples().
        Throws:
        VisADException - problem creating VisAD objects.
    • Method Detail

      • create

        public static LinearSet create(MathType type,
                                       double[] firsts,
                                       double[] lasts,
                                       int[] lengths)
                                throws VisADException
        General Factory method for creating the proper linear set (Linear1DSet, Linear2DSet, etc.).
        Throws:
        VisADException
      • 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
        Overrides:
        indexToValue in class GriddedSet
        Parameters:
        index - array of integer indices
        Returns:
        float[domain_dimension][indices.length] array of Set values
        Throws:
        VisADException - a VisAD error occurred
      • gridToValue

        public float[][] gridToValue(float[][] grid)
                              throws VisADException
        transform an array of non-integer grid coordinates to an array of values in R^DomainDimension
        Specified by:
        gridToValue in interface GriddedSetIface
        Overrides:
        gridToValue in class GriddedSet
        Parameters:
        grid - The coordinates of the interpolation grid points for which interpolated sample values are desired. grid[i][j] is the i-th grid coordinate of the j-th interpolation point.
        Returns:
        The interpolated samples of the set. Element [i][j] is the i-th coordinate of the j-th interpolation point.
        Throws:
        VisADException - VisAD failure.
      • valueToGrid

        public float[][] valueToGrid(float[][] value)
                              throws VisADException
        transform an array of values in R^DomainDimension to an array of non-integer grid coordinates
        Specified by:
        valueToGrid in interface GriddedSetIface
        Overrides:
        valueToGrid in class GriddedSet
        Parameters:
        value - The array of points for which non-integer grid coordinates are desired. value[i][j] is the i-th coordinate of the j-th point.
        Returns:
        The array of grid coordinates corresponding to the points. Element [i][j] is the i-th non-integer grid coordinate of the j-th point.
        Throws:
        VisADException - VisAD failure.
      • isMissing

        public boolean isMissing()
        Check to see if this is an empty cross-product.
        Specified by:
        isMissing in interface Data
        Overrides:
        isMissing in class SampledSet
        Returns:
        always false.
      • getFirsts

        public double[] getFirsts()
                           throws VisADException
        Get the array of first values of each of the arithmetic progressions in this cross product.
        Returns:
        array of first values.
        Throws:
        VisADException
      • getLasts

        public double[] getLasts()
                          throws VisADException
        Get the array of last values of each of the arithmetic progressions in this cross product.
        Returns:
        array of last values.
        Throws:
        VisADException
      • getSamples

        public float[][] getSamples(boolean copy)
                             throws VisADException
        Return the array of values in R^N space corresponding to this cross product of arithmetic progressions.
        Specified by:
        getSamples in interface SetIface
        Overrides:
        getSamples in class SampledSet
        Parameters:
        copy - if true, return a copy of the samples.
        Returns:
        array of values in R^N space.
        Throws:
        VisADException - problem creating samples.
      • equals

        public boolean equals(java.lang.Object set)
        Check to see if this LinearNDSet is equal to the Object in question.
        Specified by:
        equals in interface SetIface
        Overrides:
        equals in class GriddedSet
        Parameters:
        set - Object in question
        Returns:
        true if set is a LinearNDSet and each of the Linear1DSet-s that make up this cross product are equal.
      • hashCode

        public int hashCode()
        Returns the hash code for this instance.
        Overrides:
        hashCode in class GriddedSet
        Returns:
        The hash code for this instance.
      • getLinear1DComponent

        public Linear1DSet getLinear1DComponent(int i)
        Get the indexed component.
        Specified by:
        getLinear1DComponent in interface LinearSet
        Parameters:
        i - Index of component
        Returns:
        The requested component
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If an invalid index is specified.
      • cloneButType

        public java.lang.Object cloneButType(MathType type)
                                      throws VisADException
        Return a clone of this object with a new MathType.
        Specified by:
        cloneButType in interface SetIface
        Overrides:
        cloneButType in class GriddedSet
        Parameters:
        type - new MathType.
        Returns:
        new LinearNDSet with type.
        Throws:
        VisADException - if type is not compatible with MathType of component Linear1DSets.
      • longString

        public java.lang.String longString(java.lang.String pre)
                                    throws VisADException
        Extended version of the toString() method.
        Specified by:
        longString in interface Data
        Overrides:
        longString in class GriddedSet
        Parameters:
        pre - prefix for string.
        Returns:
        wordy string describing this LinearNDSet.
        Throws:
        VisADException
      • main

        public static void main(java.lang.String[] args)
                         throws VisADException
        run 'java visad.LinearNDSet' to test the LinearNDSet class
        Throws:
        VisADException

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.