    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class JSci.maths.ComplexVector

    java.lang.Object
       |
       +----JSci.maths.MathVector
               |
               +----JSci.maths.ComplexVector

public class ComplexVector
extends MathVector

The ComplexVector class encapsulates vectors containing complex numbers.

##

ARRAY_1D
  Storage format identifier.
storageFormat
vector
  Array containing the components of the vector.

##

ComplexVector(Complex[])
  Constructs a vector by wrapping an array.
ComplexVector(int)
  Constructs an empty vector.

##

add(AbelianGroupMember)
  Returns the addition of this vector and another.
add(ComplexVector)
  Returns the addition of this vector and another.
add(DoubleVector)
  Returns the addition of this vector and another.
add(IntegerVector)
  Returns the addition of this vector and another.
conjugate()
  Returns the complex conjugate of this vector.
dimension()
  Returns the vector's dimension.
equals(Object)
  Compares two complex vectors for equality.
getComponent(int)
  Returns a component of this vector.
hashCode()
  Returns a hashcode for this vector.
imag()
  Returns the imaginary part of this complex vector.
infNorm()
  Returns the l(infinity)-norm.
mapComponents(Mapping)
  Applies a function on all the vector components.
negate()
  Returns the negative of this vector.
norm()
  Returns the l2-norm (magnitude).
real()
  Returns the real part of this complex vector.
scalarDivide(Complex)
  Returns the division of this vector by a scalar.
scalarDivide(double)
  Returns the division of this vector by a scalar.
scalarMultiply(Complex)
  Returns the multiplication of this vector by a scalar.
scalarMultiply(double)
  Returns the multiplication of this vector by a scalar.
scalarMultiply(RingMember)
  Returns the multiplication of this vector by a scalar.
scalarProduct(ComplexVector)
  Returns the scalar product of this vector and another.
setComponent(int, Complex)
  Sets the value of a component of this vector.
subtract(AbelianGroupMember)
  Returns the subtraction of this vector by another.
subtract(ComplexVector)
  Returns the subtraction of this vector by another.
subtract(DoubleVector)
  Returns the subtraction of this vector by another.
subtract(IntegerVector)
  Returns the subtraction of this vector by another.
toString()
  Returns a comma delimited string representing the value of this vector.

##

ARRAY_1D

     protected static final int ARRAY_1D

  Storage format identifier.

storageFormat

     protected static final int storageFormat

vector

     protected Complex vector[]

  Array containing the components of the vector.

##

ComplexVector

     public ComplexVector(int dim)

  Constructs an empty vector.

  Parameters:
    dim - the dimension of the vector.

ComplexVector

     public ComplexVector(Complex array[])

  Constructs a vector by wrapping an array.

  Parameters:
    array - an assigned value

##

equals

     public boolean equals(Object a)

  Compares two complex vectors for equality.

  Parameters:
    a - a complex vector
  Overrides:
    equals in class Object

toString

     public String toString()

  Returns a comma delimited string representing the value of this vector.

  Overrides:
    toString in class Object

hashCode

     public int hashCode()

  Returns a hashcode for this vector.

  Overrides:
    hashCode in class Object

real

     public DoubleVector real()

  Returns the real part of this complex vector.

imag

     public DoubleVector imag()

  Returns the imaginary part of this complex vector.

getComponent

     public Complex getComponent(int n)

  Returns a component of this vector.

  Parameters:
    n - index of the vector component
  Throws: VectorDimensionException
    If attempting to access an invalid component.

setComponent

     public void setComponent(int n,
                              Complex z)

  Sets the value of a component of this vector.

  Parameters:
    n - index of the vector component
    z - a complex number
  Throws: VectorDimensionException
    If attempting to access an invalid component.

dimension

     public int dimension()

  Returns the vector's dimension.

  Overrides:
    dimension in class MathVector

norm

     public double norm()

  Returns the l2-norm (magnitude).

  Overrides:
    norm in class MathVector

infNorm

     public double infNorm()

  Returns the l(infinity)-norm.

negate

     public AbelianGroupMember negate()

  Returns the negative of this vector.

  Overrides:
    negate in class MathVector

conjugate

     public ComplexVector conjugate()

  Returns the complex conjugate of this vector.

add

     public AbelianGroupMember add(AbelianGroupMember v)

  Returns the addition of this vector and another.

  Overrides:
    add in class MathVector

add

     public ComplexVector add(ComplexVector v)

  Returns the addition of this vector and another.

  Parameters:
    v - a complex vector
  Throws: VectorDimensionException
    If the vectors are different sizes.

add

     public ComplexVector add(DoubleVector v)

  Returns the addition of this vector and another.

  Parameters:
    v - a double vector
  Throws: VectorDimensionException
    If the vectors are different sizes.

add

     public ComplexVector add(IntegerVector v)

  Returns the addition of this vector and another.

  Parameters:
    v - an integer vector
  Throws: VectorDimensionException
    If the vectors are different sizes.

subtract

     public AbelianGroupMember subtract(AbelianGroupMember v)

  Returns the subtraction of this vector by another.

  Overrides:
    subtract in class MathVector

subtract

     public ComplexVector subtract(ComplexVector v)

  Returns the subtraction of this vector by another.

  Parameters:
    v - a complex vector
  Throws: VectorDimensionException
    If the vectors are different sizes.

subtract

     public ComplexVector subtract(DoubleVector v)

  Returns the subtraction of this vector by another.

  Parameters:
    v - a double vector
  Throws: VectorDimensionException
    If the vectors are different sizes.

subtract

     public ComplexVector subtract(IntegerVector v)

  Returns the subtraction of this vector by another.

  Parameters:
    v - an integer vector
  Throws: VectorDimensionException
    If the vectors are different sizes.

scalarMultiply

     public ModuleMember scalarMultiply(RingMember x)

  Returns the multiplication of this vector by a scalar.

  Overrides:
    scalarMultiply in class MathVector

scalarMultiply

     public ComplexVector scalarMultiply(Complex z)

  Returns the multiplication of this vector by a scalar.

  Parameters:
    z - a complex number

scalarMultiply

     public ComplexVector scalarMultiply(double x)

  Returns the multiplication of this vector by a scalar.

  Parameters:
    x - a double

scalarDivide

     public ComplexVector scalarDivide(Complex z)

  Returns the division of this vector by a scalar.

  Parameters:
    z - a complex number
  Throws: ArithmeticException
    If divide by zero.

scalarDivide

     public ComplexVector scalarDivide(double x)

  Returns the division of this vector by a scalar.

  Parameters:
    x - a double
  Throws: ArithmeticException
    If divide by zero.

scalarProduct

     public Complex scalarProduct(ComplexVector v)

  Returns the scalar product of this vector and another.

  Parameters:
    v - a complex vector
  Throws: VectorDimensionException
    If the vectors are different sizes.

mapComponents

     public ComplexVector mapComponents(Mapping f)

  Applies a function on all the vector components.

  Parameters:
    f - a user-defined function
  Returns:
    a complex vector

    All Packages  Class Hierarchy  This Package  Previous  Next  Index