org.jscience.mathematics.algebraic.matrices
Class Complex3Vector

java.lang.Object
  extended by org.jscience.mathematics.algebraic.AbstractHypermatrix
      extended by org.jscience.mathematics.algebraic.AbstractMatrix
          extended by org.jscience.mathematics.algebraic.AbstractVector
              extended by org.jscience.mathematics.algebraic.matrices.AbstractComplexVector
                  extended by org.jscience.mathematics.algebraic.matrices.Complex3Vector
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Algebra.Member, BanachSpace.Member, HilbertSpace.Member, Ring.Member, AbelianGroup.Member, Hypermatrix, Matrix, Module.Member, VectorSpace.Member, Vector, Member

public class Complex3Vector
extends AbstractComplexVector
implements java.lang.Cloneable, java.io.Serializable

An optimised implementation of a 3D complex vector.

See Also:
Serialized Form

Field Summary
 double xim
          DOCUMENT ME!
 double xre
          DOCUMENT ME!
 double yim
          DOCUMENT ME!
 double yre
          DOCUMENT ME!
 double zim
          DOCUMENT ME!
 double zre
          DOCUMENT ME!
 
Constructor Summary
Complex3Vector()
          Constructs an empty 3-vector.
Complex3Vector(Complex[] array)
          Constructs a 3-vector.
Complex3Vector(Complex3Vector vec)
          Constructs a 3-vector.
Complex3Vector(Complex x, Complex y, Complex z)
          Constructs a 3-vector.
Complex3Vector(double xRe, double xIm, double yRe, double yIm, double zRe, double zIm)
          Creates a new Complex3Vector object.
 
Method Summary
 AbelianGroup.Member add(AbelianGroup.Member vec)
          Returns the addition of this vector and another.
 AbstractComplexVector add(AbstractComplexVector vec)
          Returns the addition of this vector and another.
 AbstractComplexVector add(AbstractDoubleVector vec)
          Returns the addition of this vector and another.
 AbstractComplexVector add(AbstractIntegerVector vec)
          Returns the addition of this vector and another.
 java.lang.Object clone()
          Clone vector into a new vector.
 AbstractComplexVector conjugate()
          Returns the complex conjugate of this vector.
 boolean equals(java.lang.Object obj)
          Compares two complex vectors for equality.
 Complex getC1()
          DOCUMENT ME!
 Complex getC2()
          DOCUMENT ME!
 Complex getC3()
          DOCUMENT ME!
 Complex getPrimitiveElement(int n)
          Returns a component of this vector.
 AbstractDoubleVector imag()
          Returns the imaginary part of this complex 3-vector.
 double infNorm()
          Returns the linfinity-norm.
 AbstractComplexVector mapElements(ComplexMapping mapping)
          Applies a function on all the vector components.
 AbelianGroup.Member negate()
          Returns the negative of this vector.
 double norm()
          Returns the l2-norm (magnitude).
 AbstractDoubleVector real()
          Returns the real part of this complex 3-vector.
 AbstractComplexVector scalarDivide(Complex z)
          Returns the division of this vector by a scalar.
 AbstractComplexVector scalarDivide(double k)
          Returns the division of this vector by a scalar.
 VectorSpace.Member scalarDivide(Field.Member x)
          Returns the division of this vector by a scalar.
 AbstractComplexVector scalarMultiply(Complex z)
          Returns the multiplication of this vector by a scalar.
 AbstractComplexVector scalarMultiply(double k)
          Returns the multiplication of this vector by a scalar.
 Module.Member scalarMultiply(Ring.Member x)
          Returns the multiplication of this vector by a scalar.
 Complex scalarProduct(AbstractComplexVector vec)
          Returns the scalar product of this vector and another.
 Complex scalarProduct(Complex3Vector vec)
          Returns the scalar product of this vector and another.
 Complex scalarProduct(HilbertSpace.Member vec)
          Returns the scalar product of this vector and another.
 void setAllElements(Complex c)
          Sets the value of all elements of the vector.
 void setC1(Complex c)
          DOCUMENT ME!
 void setC2(Complex c)
          DOCUMENT ME!
 void setC3(Complex c)
          DOCUMENT ME!
 void setElement(int n, Complex z)
          Sets the value of a component of this vector.
 void setElement(int n, double x, double y)
          Sets the value of a component of this vector.
 AbelianGroup.Member subtract(AbelianGroup.Member vec)
          Returns the subtraction of this vector by another.
 AbstractComplexVector subtract(AbstractComplexVector vec)
          Returns the subtraction of this vector by another.
 AbstractComplexVector subtract(AbstractDoubleVector vec)
          Returns the subtraction of this vector by another.
 AbstractComplexVector subtract(AbstractIntegerVector vec)
          Returns the subtraction of this vector by another.
 Complex[] toPrimitiveArray()
          Projects the vector to an array.
 java.lang.String toString()
          Returns a comma delimited string representing the value of this vector.
 Complex3Vector vectorProduct(Complex3Vector vec)
          Returns the vector product of this vector and another.
 
Methods inherited from class org.jscience.mathematics.algebraic.matrices.AbstractComplexVector
abs, equals, getColumn, getElement, getImagElement, getRealElement, getRow, getSubVector, hashCode, mass, multiply, normalize, read, reverse, setColumn, setRow, setSubVector, tensorProduct, toMatrix, transpose
 
Methods inherited from class org.jscience.mathematics.algebraic.AbstractVector
getDimension, getElement, getInvalidElementMsg, toArray, toArray
 
Methods inherited from class org.jscience.mathematics.algebraic.AbstractMatrix
getElement, getInvalidElementMsg, numColumns, numRows, print, print, print, print, toArray
 
Methods inherited from class org.jscience.mathematics.algebraic.AbstractHypermatrix
getDimensions, numDimensions, numElements, numElements, toArray
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jscience.mathematics.algebraic.Matrix
numColumns, numRows, toArray
 
Methods inherited from interface org.jscience.mathematics.algebraic.Hypermatrix
getDimensions, getElement, numDimensions, numElements, numElements, toArray
 

Field Detail

xre

public double xre
DOCUMENT ME!


xim

public double xim
DOCUMENT ME!


yre

public double yre
DOCUMENT ME!


yim

public double yim
DOCUMENT ME!


zre

public double zre
DOCUMENT ME!


zim

public double zim
DOCUMENT ME!

Constructor Detail

Complex3Vector

public Complex3Vector()
Constructs an empty 3-vector.


Complex3Vector

public Complex3Vector(Complex x,
                      Complex y,
                      Complex z)
Constructs a 3-vector.

Parameters:
x - x coordinate.
y - y coordinate.
z - z coordinate.

Complex3Vector

public Complex3Vector(double xRe,
                      double xIm,
                      double yRe,
                      double yIm,
                      double zRe,
                      double zIm)
Creates a new Complex3Vector object.

Parameters:
xRe - DOCUMENT ME!
xIm - DOCUMENT ME!
yRe - DOCUMENT ME!
yIm - DOCUMENT ME!
zRe - DOCUMENT ME!
zIm - DOCUMENT ME!

Complex3Vector

public Complex3Vector(Complex[] array)
Constructs a 3-vector.

Parameters:
array - DOCUMENT ME!

Complex3Vector

public Complex3Vector(Complex3Vector vec)
Constructs a 3-vector.

Parameters:
vec - DOCUMENT ME!
Method Detail

equals

public boolean equals(java.lang.Object obj)
Compares two complex vectors for equality.

Overrides:
equals in class AbstractComplexVector
Parameters:
obj - a complex 3-vector
Returns:
DOCUMENT ME!

toString

public java.lang.String toString()
Returns a comma delimited string representing the value of this vector.

Overrides:
toString in class AbstractComplexVector
Returns:
DOCUMENT ME!

real

public AbstractDoubleVector real()
Returns the real part of this complex 3-vector.

Overrides:
real in class AbstractComplexVector
Returns:
DOCUMENT ME!

imag

public AbstractDoubleVector imag()
Returns the imaginary part of this complex 3-vector.

Overrides:
imag in class AbstractComplexVector
Returns:
DOCUMENT ME!

getPrimitiveElement

public Complex getPrimitiveElement(int n)
Returns a component of this vector.

Specified by:
getPrimitiveElement in class AbstractComplexVector
Parameters:
n - index of the vector component
Returns:
DOCUMENT ME!
Throws:
IllegalDimensionException - If attempting to access an invalid component.

setElement

public void setElement(int n,
                       Complex z)
Sets the value of a component of this vector. Should only be used to initialise this vector.

Specified by:
setElement in class AbstractComplexVector
Parameters:
n - index of the vector component
z - a complex number
Throws:
IllegalDimensionException - If attempting to access an invalid component.

setElement

public void setElement(int n,
                       double x,
                       double y)
Sets the value of a component of this vector. Should only be used to initialise this vector.

Overrides:
setElement in class AbstractComplexVector
Parameters:
n - index of the vector component
x - the real part of a complex number
y - the imaginary part of a complex number
Throws:
IllegalDimensionException - If attempting to access an invalid component.

setAllElements

public void setAllElements(Complex c)
Sets the value of all elements of the vector.

Overrides:
setAllElements in class AbstractComplexVector
Parameters:
c - a Complex element

norm

public double norm()
Returns the l2-norm (magnitude).

Specified by:
norm in interface BanachSpace.Member
Overrides:
norm in class AbstractComplexVector
Returns:
DOCUMENT ME!

infNorm

public double infNorm()
Returns the linfinity-norm.

Overrides:
infNorm in class AbstractComplexVector
Returns:
DOCUMENT ME!

getC1

public Complex getC1()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getC2

public Complex getC2()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getC3

public Complex getC3()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setC1

public void setC1(Complex c)
DOCUMENT ME!

Parameters:
c - DOCUMENT ME!

setC2

public void setC2(Complex c)
DOCUMENT ME!

Parameters:
c - DOCUMENT ME!

setC3

public void setC3(Complex c)
DOCUMENT ME!

Parameters:
c - DOCUMENT ME!

negate

public AbelianGroup.Member negate()
Returns the negative of this vector.

Specified by:
negate in interface AbelianGroup.Member
Returns:
DOCUMENT ME!

conjugate

public AbstractComplexVector conjugate()
Returns the complex conjugate of this vector.

Overrides:
conjugate in class AbstractComplexVector
Returns:
a complex 3-vector

add

public AbelianGroup.Member add(AbelianGroup.Member vec)
Returns the addition of this vector and another.

Specified by:
add in interface AbelianGroup.Member
Parameters:
vec - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

add

public AbstractComplexVector add(AbstractComplexVector vec)
Returns the addition of this vector and another.

Overrides:
add in class AbstractComplexVector
Parameters:
vec - a complex 3-vector
Returns:
DOCUMENT ME!
Throws:
IllegalDimensionException - DOCUMENT ME!

add

public AbstractComplexVector add(AbstractDoubleVector vec)
Returns the addition of this vector and another.

Parameters:
vec - a double 3-vector
Returns:
DOCUMENT ME!
Throws:
IllegalDimensionException - DOCUMENT ME!

add

public AbstractComplexVector add(AbstractIntegerVector vec)
Returns the addition of this vector and another.

Parameters:
vec - an integer 3-vector
Returns:
DOCUMENT ME!
Throws:
IllegalDimensionException - DOCUMENT ME!

subtract

public AbelianGroup.Member subtract(AbelianGroup.Member vec)
Returns the subtraction of this vector by another.

Specified by:
subtract in interface AbelianGroup.Member
Parameters:
vec - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

subtract

public AbstractComplexVector subtract(AbstractComplexVector vec)
Returns the subtraction of this vector by another.

Overrides:
subtract in class AbstractComplexVector
Parameters:
vec - a complex 3-vector
Returns:
DOCUMENT ME!
Throws:
IllegalDimensionException - DOCUMENT ME!

subtract

public AbstractComplexVector subtract(AbstractDoubleVector vec)
Returns the subtraction of this vector by another.

Parameters:
vec - a double 3-vector
Returns:
DOCUMENT ME!
Throws:
IllegalDimensionException - DOCUMENT ME!

subtract

public AbstractComplexVector subtract(AbstractIntegerVector vec)
Returns the subtraction of this vector by another.

Parameters:
vec - an integer 3-vector
Returns:
DOCUMENT ME!
Throws:
IllegalDimensionException - DOCUMENT ME!

scalarMultiply

public Module.Member scalarMultiply(Ring.Member x)
Returns the multiplication of this vector by a scalar.

Specified by:
scalarMultiply in interface Module.Member
Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

scalarMultiply

public AbstractComplexVector scalarMultiply(Complex z)
Returns the multiplication of this vector by a scalar.

Overrides:
scalarMultiply in class AbstractComplexVector
Parameters:
z - a complex number
Returns:
a complex 3-vector

scalarMultiply

public AbstractComplexVector scalarMultiply(double k)
Returns the multiplication of this vector by a scalar.

Overrides:
scalarMultiply in class AbstractComplexVector
Parameters:
k - a double
Returns:
a complex 3-vector

scalarDivide

public VectorSpace.Member scalarDivide(Field.Member x)
Returns the division of this vector by a scalar.

Specified by:
scalarDivide in interface VectorSpace.Member
Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

scalarDivide

public AbstractComplexVector scalarDivide(Complex z)
Returns the division of this vector by a scalar.

Overrides:
scalarDivide in class AbstractComplexVector
Parameters:
z - a complex number
Returns:
a complex 3-vector

scalarDivide

public AbstractComplexVector scalarDivide(double k)
Returns the division of this vector by a scalar.

Overrides:
scalarDivide in class AbstractComplexVector
Parameters:
k - a double
Returns:
a complex 3-vector

scalarProduct

public Complex scalarProduct(HilbertSpace.Member vec)
Returns the scalar product of this vector and another.

Specified by:
scalarProduct in interface HilbertSpace.Member
Parameters:
vec - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

scalarProduct

public Complex scalarProduct(AbstractComplexVector vec)
Returns the scalar product of this vector and another.

Overrides:
scalarProduct in class AbstractComplexVector
Parameters:
vec - a complex vector
Returns:
DOCUMENT ME!
Throws:
IllegalDimensionException - If the vectors are different sizes.

scalarProduct

public Complex scalarProduct(Complex3Vector vec)
Returns the scalar product of this vector and another.

Parameters:
vec - a complex 3-vector
Returns:
DOCUMENT ME!

vectorProduct

public Complex3Vector vectorProduct(Complex3Vector vec)
Returns the vector product of this vector and another.

Parameters:
vec - a complex 3-vector
Returns:
DOCUMENT ME!

mapElements

public AbstractComplexVector mapElements(ComplexMapping mapping)
Applies a function on all the vector components.

Overrides:
mapElements in class AbstractComplexVector
Parameters:
mapping - a user-defined function
Returns:
a complex 3-vector

toPrimitiveArray

public Complex[] toPrimitiveArray()
Projects the vector to an array.

Overrides:
toPrimitiveArray in class AbstractComplexVector
Returns:
an double array.

clone

public java.lang.Object clone()
Clone vector into a new vector.

Overrides:
clone in class java.lang.Object
Returns:
the cloned vector.