Class ComplexVector

java.lang.Object
org.jscience.mathematics.vector.Vector<Complex>
org.jscience.mathematics.vector.ComplexVector
All Implemented Interfaces:
javolution.lang.Immutable, javolution.lang.Realtime, javolution.lang.ValueType, GroupAdditive<Vector<Complex>>, Structure<Vector<Complex>>, VectorSpace<Vector<Complex>,Complex>, VectorSpaceNormed<Vector<Complex>,Complex>

public final class ComplexVector extends Vector<Complex> implements VectorSpaceNormed<Vector<Complex>,Complex>

This class represents an optimized vector implementation for complex numbers elements.

  • Field Details

    • XML

      protected static final javolution.xml.XMLFormat<ComplexVector> XML
      Holds the default XML representation. For example: [code] [/code]
  • Method Details

    • valueOf

      public static ComplexVector valueOf(Complex... elements)
      Returns a new vector holding the specified complex numbers.
      Parameters:
      elements - the complex numbers elements.
      Returns:
      the vector having the specified complex numbers.
    • valueOf

      public static ComplexVector valueOf(List<Complex> elements)
      Returns a new vector holding the elements from the specified collection.
      Parameters:
      elements - the collection of floating-points numbers.
      Returns:
      the vector having the specified elements.
    • valueOf

      public static ComplexVector valueOf(Vector<Complex> that)
      Returns a ComplexVector instance equivalent to the specified vector.
      Parameters:
      that - the vector to convert.
      Returns:
      that or new equivalent ComplexVector.
    • getReal

      public double getReal(int i)
      Returns the real value of a complex number from this vector (fast).
      Parameters:
      i - the complex number index.
      Returns:
      the real value of complex at i.
      Throws:
      IndexOutOfBoundsException - (i < 0) || (i >= dimension())
    • getImaginary

      public double getImaginary(int i)
      Returns the imaginary value of a complex number from this vector (fast).
      Parameters:
      i - the complex number index.
      Returns:
      the real value of complex at i.
      Throws:
      IndexOutOfBoundsException - (i < 0) || (i >= dimension())
    • norm

      public Complex norm()
      Returns the Euclidian norm of this vector (square root of the dot product of this vector and itself).
      Specified by:
      norm in interface VectorSpaceNormed<Vector<Complex>,Complex>
      Returns:
      sqrt(this · this).
      See Also:
    • getDimension

      public int getDimension()
      Description copied from class: Vector
      Returns the number of elements held by this vector.
      Specified by:
      getDimension in class Vector<Complex>
      Returns:
      this vector dimension.
    • get

      public Complex get(int i)
      Description copied from class: Vector
      Returns a single element from this vector.
      Specified by:
      get in class Vector<Complex>
      Parameters:
      i - the element index (range [0..n[).
      Returns:
      the element at i.
    • opposite

      public ComplexVector opposite()
      Description copied from class: Vector
      Returns the negation of this vector.
      Specified by:
      opposite in interface GroupAdditive<Vector<Complex>>
      Specified by:
      opposite in class Vector<Complex>
      Returns:
      -this.
    • plus

      public ComplexVector plus(Vector<Complex> that)
      Description copied from class: Vector
      Returns the sum of this vector with the one specified.
      Specified by:
      plus in interface GroupAdditive<Vector<Complex>>
      Specified by:
      plus in class Vector<Complex>
      Parameters:
      that - the vector to be added.
      Returns:
      this + that.
    • minus

      public ComplexVector minus(Vector<Complex> that)
      Description copied from class: Vector
      Returns the difference between this vector and the one specified.
      Overrides:
      minus in class Vector<Complex>
      Parameters:
      that - the vector to be subtracted.
      Returns:
      this - that.
    • times

      public ComplexVector times(Complex k)
      Description copied from class: Vector
      Returns the product of this vector with the specified coefficient.
      Specified by:
      times in interface VectorSpace<Vector<Complex>,Complex>
      Specified by:
      times in class Vector<Complex>
      Parameters:
      k - the coefficient multiplier.
      Returns:
      this · k
    • times

      public Complex times(Vector<Complex> that)
      Description copied from class: Vector
      Returns the dot product of this vector with the one specified.
      Specified by:
      times in class Vector<Complex>
      Parameters:
      that - the vector multiplier.
      Returns:
      this · that
      See Also:
    • copy

      public ComplexVector copy()
      Description copied from class: Vector
      Returns a copy of this vector allocated by the calling thread (possibly on the stack).
      Specified by:
      copy in interface javolution.lang.ValueType
      Specified by:
      copy in class Vector<Complex>
      Returns:
      an identical and independant copy of this matrix.