Class Complex.Array

java.lang.Object
smile.math.Complex.Array
Enclosing class:
Complex

public static class Complex.Array extends Object
Packed array of complex numbers for better memory efficiency.
  • Field Details

    • length

      public final int length
      The length of array.
  • Constructor Details

    • Array

      public Array(int length)
      Constructor.
      Parameters:
      length - the length of array.
  • Method Details

    • get

      public Complex get(int i)
      Returns the i-th element.
      Parameters:
      i - the index.
      Returns:
      the i-th element.
    • apply

      public Complex apply(int i)
      Returns the i-th element. For Scala convenience.
      Parameters:
      i - the index.
      Returns:
      the i-th element.
    • set

      public void set(int i, Complex c)
      Sets the i-th element.
      Parameters:
      i - the index.
      c - the new value.
    • set

      public void set(int i, double re)
      Sets the i-th element with a real value.
      Parameters:
      i - the index.
      re - the new value.
    • update

      public void update(int i, Complex c)
      Sets the i-th element. For Scala convenience.
      Parameters:
      i - the index.
      c - the new value.
    • update

      public void update(int i, double re)
      Sets the i-th element. For Scala convenience.
      Parameters:
      i - the index.
      re - the new value.
    • iterator

      public Iterator<Complex> iterator()
      Returns an iterator over the elements.
      Returns:
      an iterator.
    • of

      public static Complex.Array of(Complex... x)
      Creates a packed array of complex values.
      Parameters:
      x - the complex values.
      Returns:
      the packed array of complex values.