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.


Variable Index

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

Constructor Index

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

Method Index

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

Variables

 o ARRAY_1D
 protected static final int ARRAY_1D
Storage format identifier.

 o storageFormat
 protected static final int storageFormat
 o vector
 protected Complex vector[]
Array containing the components of the vector.

Constructors

 o ComplexVector
 public ComplexVector(int dim)
Constructs an empty vector.

Parameters:
dim - the dimension of the vector.
 o ComplexVector
 public ComplexVector(Complex array[])
Constructs a vector by wrapping an array.

Parameters:
array - an assigned value

Methods

 o equals
 public boolean equals(Object a)
Compares two complex vectors for equality.

Parameters:
a - a complex vector
Overrides:
equals in class Object
 o toString
 public String toString()
Returns a comma delimited string representing the value of this vector.

Overrides:
toString in class Object
 o hashCode
 public int hashCode()
Returns a hashcode for this vector.

Overrides:
hashCode in class Object
 o real
 public DoubleVector real()
Returns the real part of this complex vector.

 o imag
 public DoubleVector imag()
Returns the imaginary part of this complex vector.

 o 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.
 o 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.
 o dimension
 public int dimension()
Returns the vector's dimension.

Overrides:
dimension in class MathVector
 o norm
 public double norm()
Returns the l2-norm (magnitude).

Overrides:
norm in class MathVector
 o infNorm
 public double infNorm()
Returns the l(infinity)-norm.

 o negate
 public AbelianGroupMember negate()
Returns the negative of this vector.

Overrides:
negate in class MathVector
 o conjugate
 public ComplexVector conjugate()
Returns the complex conjugate of this vector.

 o add
 public AbelianGroupMember add(AbelianGroupMember v)
Returns the addition of this vector and another.

Overrides:
add in class MathVector
 o 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.
 o 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.
 o 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.
 o subtract
 public AbelianGroupMember subtract(AbelianGroupMember v)
Returns the subtraction of this vector by another.

Overrides:
subtract in class MathVector
 o 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.
 o 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.
 o 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.
 o scalarMultiply
 public ModuleMember scalarMultiply(RingMember x)
Returns the multiplication of this vector by a scalar.

Overrides:
scalarMultiply in class MathVector
 o scalarMultiply
 public ComplexVector scalarMultiply(Complex z)
Returns the multiplication of this vector by a scalar.

Parameters:
z - a complex number
 o scalarMultiply
 public ComplexVector scalarMultiply(double x)
Returns the multiplication of this vector by a scalar.

Parameters:
x - a double
 o 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.
 o 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.
 o 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.
 o 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