Class Grid1Ddouble

  • All Implemented Interfaces:
    Grid1D, java.io.Serializable

    public class Grid1Ddouble
    extends java.lang.Object
    implements Grid1D, java.io.Serializable
    a 1D Grid of doubles
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int length  
      int xDim  
    • Constructor Summary

      Constructors 
      Constructor Description
      Grid1Ddouble​(int xDim)
      creates a new Grid1Ddouble of length xDim without wraparound
      Grid1Ddouble​(int xDim, boolean wrapX)
      creates a new Grid1Ddouble of length xDim with optional wraparound
    • Method Summary

      Modifier and Type Method Description
      void Add​(int x, double val)
      adds to the current field value at the specified index
      void AddAll​(double val)
      adds specified value to all entries of the curr field
      void BoundAll​(double min, double max)
      Bounds all values in the current field between min and max
      double Get​(int x)
      gets the current field value at the specified index
      double GetAvg()
      returns the mean value of the grid
      double[] GetField()
      returns the complete field as an array
      double GetMax()
      returns the max value in the grid
      double GetMin()
      returns the min value in the grid
      double GradientX​(int x)
      returns the gradient of the field in the X direction at the coordinates specified
      double GradientX​(int x, double boundaryCond)
      returns the gradient of the field in the X direction at the coordinates specified, will use the boundary value provided for gradients that go over the boundary
      boolean IsWrapX()  
      int Length()  
      void Scale​(int x, double val)
      multiplies the current field value at the specified index
      void ScaleAll​(double val)
      adds specified value to all entries of the curr field
      void Set​(int x, double val)
      sets the current field value at the specified index
      void SetAll​(double val)
      sets all squares in current the field to the specified value
      void SetAll​(double[] vals)
      copies the array argument into the field
      int Xdim()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • xDim

        public final int xDim
      • length

        public final int length
    • Constructor Detail

      • Grid1Ddouble

        public Grid1Ddouble​(int xDim)
        creates a new Grid1Ddouble of length xDim without wraparound
      • Grid1Ddouble

        public Grid1Ddouble​(int xDim,
                            boolean wrapX)
        creates a new Grid1Ddouble of length xDim with optional wraparound
    • Method Detail

      • Get

        public double Get​(int x)
        gets the current field value at the specified index
      • GetField

        public double[] GetField()
        returns the complete field as an array
      • Set

        public void Set​(int x,
                        double val)
        sets the current field value at the specified index
      • Scale

        public void Scale​(int x,
                          double val)
        multiplies the current field value at the specified index
      • Add

        public void Add​(int x,
                        double val)
        adds to the current field value at the specified index
      • BoundAll

        public void BoundAll​(double min,
                             double max)
        Bounds all values in the current field between min and max
      • SetAll

        public void SetAll​(double val)
        sets all squares in current the field to the specified value
      • AddAll

        public void AddAll​(double val)
        adds specified value to all entries of the curr field
      • ScaleAll

        public void ScaleAll​(double val)
        adds specified value to all entries of the curr field
      • SetAll

        public void SetAll​(double[] vals)
        copies the array argument into the field
      • GetAvg

        public double GetAvg()
        returns the mean value of the grid
      • GetMax

        public double GetMax()
        returns the max value in the grid
      • GetMin

        public double GetMin()
        returns the min value in the grid
      • GradientX

        public double GradientX​(int x)
        returns the gradient of the field in the X direction at the coordinates specified
      • GradientX

        public double GradientX​(int x,
                                double boundaryCond)
        returns the gradient of the field in the X direction at the coordinates specified, will use the boundary value provided for gradients that go over the boundary
      • Xdim

        public int Xdim()
        Specified by:
        Xdim in interface Grid1D
      • Length

        public int Length()
        Specified by:
        Length in interface Grid1D
      • IsWrapX

        public boolean IsWrapX()
        Specified by:
        IsWrapX in interface Grid1D