Class HecDoubleArray

java.lang.Object
hec.heclib.util.HecDoubleArray
All Implemented Interfaces:
Serializable

public class HecDoubleArray extends Object implements Serializable
See Also:
  • Constructor Details

    • HecDoubleArray

      public HecDoubleArray()
    • HecDoubleArray

      public HecDoubleArray(int numberElements)
    • HecDoubleArray

      public HecDoubleArray(double[] doubleArray)
    • HecDoubleArray

      public HecDoubleArray(HecDoubleArray hecDoubleArray)
  • Method Details

    • value

      public HecDouble value(int elementNumber)
    • isDefined

      public boolean isDefined()
    • isDefined

      public boolean isDefined(int elementNumber)
    • isDefined

      public boolean isDefined(intContainer elementNumber)
    • numberElements

      public int numberElements()
    • element

      public HecDouble element(int index)
    • string

      public String string(int elementNumber)
    • string

      public String string(int elementNumber, boolean printCommas)
    • estimatePrecision

      public int estimatePrecision()
    • estimatePrecision

      public int estimatePrecision(int sigDigits)
    • set

      public void set(HecDoubleArray hecDoubleArray)
    • set

      public void set(int index, HecDouble hecDouble)
    • set

      public void set(String stringOfNumbers, String delimiter)
    • set

      public void set(int index, double value)
    • set

      public void set(double[] values)
    • setSize

      public int setSize(int numberElements)
    • resize

      public int resize(int numberElements)
      Resize the array. numberElements is the new size Removes elements from the end, or adds elements to the end Example: For an arrary of 3, then resize(5) resize(2) 10 --> 10 10 11 11 11 12 12 __ __
    • resize

      public int resize(int numberElements, int beginningElement)
      Resize the array. numberElements is the new size beginningElement is where to start deleting elements from, if decreasing beginningElement is where to start adding (undefined) elements to, if increasing Example: For an arrary of 3, then resize(5,1) resize(2,1) 10 --> 10 10 11 __ 12 12 __ 11 12
    • resize

      public int resize(int numberElements, int beginningElementOld, int beginningElementNew)
      Resize the array, while moving elements (a more complex resize) numberElements is the new size beginningElementOld is the position in the old array to start copying from beginningElementNew is the position in the new array to start copying to This function can be used to increase the size of the array (most common), or remove data from the beginning and end of the array. Example: For an arrary of 3, then resize(5,1,2) resize(2,1,1) 10 --> __ __ 11 __ 11 12 11 12 __ Any new values are undefined.
    • setPrecision

      public int setPrecision(int precision)
    • setSignificantDigits

      public int setSignificantDigits(int sigDigits)
    • setUndefined

      public void setUndefined()
    • getDoubleArray

      public double[] getDoubleArray()
      Returns a double[] array containing the data
    • getDoubleArray

      public double[] getDoubleArray(int startElement, int lastElement)
      Returns a double[] array containing the data
    • precision

      public int precision()
    • absoluteMaximum

      public HecDouble absoluteMaximum()
    • absoluteMaximum

      public HecDouble absoluteMaximum(intContainer elementNumber)
    • firstDefined

      public int firstDefined()
    • lastDefined

      public int lastDefined()
    • maximum

      public HecDouble maximum()
    • maximum

      public HecDouble maximum(intContainer elementNumber)
    • minimum

      public HecDouble minimum()
    • minimum

      public HecDouble minimum(intContainer elementNumber)
    • average

      public HecDouble average()
    • sum

      public HecDouble sum()
    • absoluteMinimum

      public HecDouble absoluteMinimum()
    • absoluteMinimum

      public HecDouble absoluteMinimum(intContainer elementNumber)
    • absoluteSum

      public HecDouble absoluteSum()
    • absoluteAverage

      public HecDouble absoluteAverage()
    • numberValidElements

      public int numberValidElements()
    • numberMissingElements

      public int numberMissingElements()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(String delim)
    • merge

      public HecDoubleArray merge(HecDoubleArray remote)
      Returns a new HecDoubleArray with local and passed in arrays merge Does not change local array! Copies HecDoubles Assumes that both arrays are sorted in increasing order
    • index

      public int index(double val, boolean ascending)
      Search the array to determine if the provided value is in the array Returns the element number of that value, or -1 if not found. This is a quicker search if you know the values are in ascending order.
    • index

      public int index(HecDouble val, boolean ascending)