Package smile.math

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 Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    The length of array.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Array(int length)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(int i)
    Returns the i-th element.
    get(int i)
    Returns the i-th element.
    of(Complex... x)
    Creates a packed array of complex values.
    void
    set(int i, double re)
    Sets the i-th element with a real value.
    void
    set(int i, Complex c)
    Sets the i-th element.
    void
    update(int i, double re)
    Sets the i-th element with a real value.
    void
    update(int i, Complex c)
    Sets the i-th element.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 with a real value. For Scala convenience.
      Parameters:
      i - the index.
      re - the new value.
    • 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.