|
|||||||||
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.ComplexVector
public class ComplexVector
An array-based implementation of a complex vector.
Field Summary | |
---|---|
protected double[] |
vectorIm
|
protected double[] |
vectorRe
Arrays containing the components of the vector. |
Fields inherited from class JSci.maths.vectors.MathVector |
---|
N |
Constructor Summary | |
---|---|
ComplexVector(Complex[] array)
Constructs a vector from an array. |
|
ComplexVector(double[] real,
double[] imag)
Constructs a vector by wrapping two arrays. |
|
ComplexVector(int dim)
Constructs an empty vector. |
Method Summary | |
---|---|
AbelianGroup.Member |
add(AbelianGroup.Member v)
Returns the addition of this vector and another. |
AbstractComplexVector |
add(AbstractComplexVector v)
Returns the addition of this vector and another. |
AbstractComplexVector |
add(AbstractDoubleVector v)
Returns the addition of this vector and another. |
AbstractComplexVector |
add(AbstractIntegerVector v)
Returns the addition of this vector and another. |
ComplexVector |
add(ComplexVector v)
|
ComplexVector |
add(DoubleVector v)
|
ComplexVector |
add(IntegerVector v)
|
AbstractComplexVector |
conjugate()
Returns the complex conjugate of this vector. |
boolean |
equals(java.lang.Object a,
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 vector. |
double |
infNorm()
Returns the l-norm. |
AbstractComplexVector |
mapComponents(ComplexMapping f)
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 vector. |
AbstractComplexVector |
scalarDivide(Complex z)
Returns the division of this vector by a scalar. |
AbstractComplexVector |
scalarDivide(double x)
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 x)
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 v)
Returns the scalar product of this vector and another. |
Complex |
scalarProduct(HilbertSpace.Member v)
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 v)
Returns the subtraction of this vector by another. |
AbstractComplexVector |
subtract(AbstractComplexVector v)
Returns the subtraction of this vector by another. |
AbstractComplexVector |
subtract(AbstractDoubleVector v)
Returns the subtraction of this vector by another. |
AbstractComplexVector |
subtract(AbstractIntegerVector v)
Returns the subtraction of this vector by another. |
ComplexVector |
subtract(ComplexVector v)
|
ComplexVector |
subtract(DoubleVector v)
|
ComplexVector |
subtract(IntegerVector v)
|
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[] vectorRe
protected double[] vectorIm
Constructor Detail |
---|
public ComplexVector(int dim)
dim
- the dimension of the vector.public ComplexVector(double[] real, double[] imag)
real
- an array of real valuesimag
- an array of imaginary valuespublic ComplexVector(Complex[] array)
array
- an assigned valueMethod Detail |
---|
public boolean equals(java.lang.Object a, double tol)
equals
in class AbstractComplexVector
a
- a complex 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 v)
v
- a group memberpublic AbstractComplexVector add(AbstractComplexVector v)
add
in class AbstractComplexVector
v
- a complex vector
VectorDimensionException
- If the vectors are different sizes.public ComplexVector add(ComplexVector v)
public AbstractComplexVector add(AbstractDoubleVector v)
v
- a double vector
VectorDimensionException
- If the vectors are different sizes.public ComplexVector add(DoubleVector v)
public AbstractComplexVector add(AbstractIntegerVector v)
v
- an integer vector
VectorDimensionException
- If the vectors are different sizes.public ComplexVector add(IntegerVector v)
public AbelianGroup.Member subtract(AbelianGroup.Member v)
v
- a group memberpublic AbstractComplexVector subtract(AbstractComplexVector v)
subtract
in class AbstractComplexVector
v
- a complex vector
VectorDimensionException
- If the vectors are different sizes.public ComplexVector subtract(ComplexVector v)
public AbstractComplexVector subtract(AbstractDoubleVector v)
v
- a double vector
VectorDimensionException
- If the vectors are different sizes.public ComplexVector subtract(DoubleVector v)
public AbstractComplexVector subtract(AbstractIntegerVector v)
v
- an integer vector
VectorDimensionException
- If the vectors are different sizes.public ComplexVector subtract(IntegerVector v)
public Module.Member scalarMultiply(Ring.Member x)
x
- a ring memberpublic AbstractComplexVector scalarMultiply(Complex z)
scalarMultiply
in class AbstractComplexVector
z
- a complex numberpublic AbstractComplexVector scalarMultiply(double x)
scalarMultiply
in class AbstractComplexVector
x
- a doublepublic 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 x)
scalarDivide
in class AbstractComplexVector
x
- a double
java.lang.ArithmeticException
- If divide by zero.public Complex scalarProduct(HilbertSpace.Member v)
v
- a Hilbert space vectorpublic Complex scalarProduct(AbstractComplexVector v)
scalarProduct
in class AbstractComplexVector
v
- a complex vector
VectorDimensionException
- If the vectors are different sizes.public AbstractComplexVector mapComponents(ComplexMapping f)
mapComponents
in class AbstractComplexVector
f
- a user-defined function
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |