|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object JSci.maths.vectors.MathVector JSci.maths.vectors.AbstractComplexVector JSci.maths.vectors.Complex2Vector
public final class Complex2Vector
An optimised implementation of a 2D complex vector.
Field Summary | |
---|---|
protected double |
xim
|
protected double |
xre
|
protected double |
yim
|
protected double |
yre
|
Fields inherited from class JSci.maths.vectors.MathVector |
---|
N |
Constructor Summary | |
---|---|
Complex2Vector()
Constructs an empty 2-vector. |
|
Complex2Vector(Complex x,
Complex y)
Constructs a 2-vector. |
|
Complex2Vector(double xRe,
double xIm,
double yRe,
double yIm)
|
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. |
AbstractComplexVector |
conjugate()
Returns the complex conjugate of this vector. |
boolean |
equals(java.lang.Object obj,
double tol)
Compares two complex vectors for equality. |
Complex |
getComponent(int n)
Returns a component of this vector. |
double |
getImagComponent(int n)
|
double |
getRealComponent(int n)
|
AbstractDoubleVector |
imag()
Returns the imaginary part of this complex 2-vector. |
double |
infNorm()
Returns the l-norm. |
AbstractComplexVector |
mapComponents(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 2-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(Complex2Vector 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 |
setComponent(int n,
Complex z)
Sets the value of a component of this vector. |
void |
setComponent(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. |
java.lang.String |
toString()
Returns a comma delimited string representing the value of this vector. |
Methods inherited from class JSci.maths.vectors.AbstractComplexVector |
---|
equals, getSet, hashCode, normalize |
Methods inherited from class JSci.maths.vectors.MathVector |
---|
dimension, getInvalidComponentMsg |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected double xre
protected double xim
protected double yre
protected double yim
Constructor Detail |
---|
public Complex2Vector()
public Complex2Vector(Complex x, Complex y)
x
- x coordinate.y
- y coordinate.public Complex2Vector(double xRe, double xIm, double yRe, double yIm)
Method Detail |
---|
public boolean equals(java.lang.Object obj, double tol)
equals
in class AbstractComplexVector
obj
- a complex 2-vectorpublic java.lang.String toString()
toString
in class AbstractComplexVector
public AbstractDoubleVector real()
real
in class AbstractComplexVector
public AbstractDoubleVector imag()
imag
in class AbstractComplexVector
public Complex getComponent(int n)
getComponent
in class AbstractComplexVector
n
- index of the vector component
VectorDimensionException
- If attempting to access an invalid component.public double getRealComponent(int n)
getRealComponent
in class AbstractComplexVector
public double getImagComponent(int n)
getImagComponent
in class AbstractComplexVector
public void setComponent(int n, Complex z)
setComponent
in class AbstractComplexVector
n
- index of the vector componentz
- a complex number
VectorDimensionException
- If attempting to access an invalid component.public void setComponent(int n, double x, double y)
setComponent
in class AbstractComplexVector
n
- index of the vector componentx
- the real part of a complex numbery
- the imaginary part of a complex number
VectorDimensionException
- If attempting to access an invalid component.public double norm()
norm
in interface BanachSpace.Member
norm
in class AbstractComplexVector
public double infNorm()
infNorm
in class AbstractComplexVector
public AbelianGroup.Member negate()
public AbstractComplexVector conjugate()
conjugate
in class AbstractComplexVector
public AbelianGroup.Member add(AbelianGroup.Member vec)
vec
- a group memberpublic AbstractComplexVector add(AbstractComplexVector vec)
add
in class AbstractComplexVector
vec
- a complex 2-vectorpublic AbstractComplexVector add(AbstractDoubleVector vec)
vec
- a double 2-vectorpublic AbstractComplexVector add(AbstractIntegerVector vec)
vec
- an integer 2-vectorpublic AbelianGroup.Member subtract(AbelianGroup.Member vec)
vec
- a group memberpublic AbstractComplexVector subtract(AbstractComplexVector vec)
subtract
in class AbstractComplexVector
vec
- a complex 2-vectorpublic AbstractComplexVector subtract(AbstractDoubleVector vec)
vec
- a double 2-vectorpublic AbstractComplexVector subtract(AbstractIntegerVector vec)
vec
- an integer 2-vectorpublic Module.Member scalarMultiply(Ring.Member x)
x
- a ring memberpublic AbstractComplexVector scalarMultiply(Complex z)
scalarMultiply
in class AbstractComplexVector
z
- a complex number
public AbstractComplexVector scalarMultiply(double k)
scalarMultiply
in class AbstractComplexVector
k
- a double
public VectorSpace.Member scalarDivide(Field.Member x)
x
- a field memberpublic AbstractComplexVector scalarDivide(Complex z)
scalarDivide
in class AbstractComplexVector
z
- a complex number
java.lang.ArithmeticException
- If divide by zero.public AbstractComplexVector scalarDivide(double k)
scalarDivide
in class AbstractComplexVector
k
- a double
java.lang.ArithmeticException
- If divide by zero.public Complex scalarProduct(HilbertSpace.Member vec)
vec
- a Hilbert space vectorpublic Complex scalarProduct(AbstractComplexVector vec)
scalarProduct
in class AbstractComplexVector
vec
- a complex vector
VectorDimensionException
- If the vectors are different sizes.public Complex scalarProduct(Complex2Vector vec)
vec
- a complex 2-vectorpublic AbstractComplexVector mapComponents(ComplexMapping mapping)
mapComponents
in class AbstractComplexVector
mapping
- a user-defined function
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |