|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJSci.maths.MathVector
JSci.maths.ComplexVector
JSci.maths.Complex3Vector
public class Complex3Vector
The Complex3Vector class encapsulates complex 3-vectors.
Field Summary |
---|
Fields inherited from class JSci.maths.ComplexVector |
---|
ARRAY_1D, vectorIm, vectorRe |
Fields inherited from class JSci.maths.MathVector |
---|
CLASS_SPECIFIC, N, storageFormat |
Constructor Summary | |
---|---|
Complex3Vector()
Constructs an empty 3-vector. |
|
Complex3Vector(Complex x,
Complex y,
Complex z)
Constructs a 3-vector. |
|
Complex3Vector(double[] real,
double[] imag)
Constructs a 3-vector by wrapping two arrays. |
Method Summary | |
---|---|
Complex3Vector |
add(Complex3Vector v)
Returns the addition of this vector and another. |
Complex3Vector |
add(Double3Vector v)
Returns the addition of this vector and another. |
Complex3Vector |
add(Integer3Vector v)
Returns the addition of this vector and another. |
ComplexVector |
conjugate()
Returns the complex conjugate of this vector. |
boolean |
equals(java.lang.Object a)
Compares two complex vectors for equality. |
Complex |
getComponent(int n)
Returns a component of this vector. |
int |
hashCode()
Returns a hashcode for this vector. |
DoubleVector |
imag()
Returns the imaginary part of this complex 3-vector. |
double |
infNorm()
Returns the l ![]() |
ComplexVector |
mapComponents(ComplexMapping f)
Applies a function on all the vector components. |
Complex3Vector |
multiply(Complex3Vector v)
Returns the vector product of this vector and another. |
double |
norm()
Returns the l2-norm (magnitude). |
DoubleVector |
real()
Returns the real part of this complex 3-vector. |
ComplexVector |
scalarDivide(Complex z)
Returns the division of this vector by a scalar. |
ComplexVector |
scalarDivide(double x)
Returns the division of this vector by a scalar. |
ComplexVector |
scalarMultiply(Complex z)
Returns the multiplication of this vector by a scalar. |
ComplexVector |
scalarMultiply(double x)
Returns the multiplication of this vector by a scalar. |
Complex |
scalarProduct(Complex3Vector 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. |
Complex3Vector |
subtract(Complex3Vector v)
Returns the subtraction of this vector by another. |
Complex3Vector |
subtract(Double3Vector v)
Returns the subtraction of this vector by another. |
Complex3Vector |
subtract(Integer3Vector v)
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.ComplexVector |
---|
add, add, add, add, negate, normalize, scalarDivide, scalarMultiply, scalarProduct, scalarProduct, subtract, subtract, subtract, subtract |
Methods inherited from class JSci.maths.MathVector |
---|
dimension, getInvalidComponentMsg |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Complex3Vector()
public Complex3Vector(double[] real, double[] imag)
real
- an array of real valuesimag
- an array of imaginary valuespublic Complex3Vector(Complex x, Complex y, Complex z)
x
- x coordinatey
- y coordinatez
- z coordinateMethod Detail |
---|
public boolean equals(java.lang.Object a)
equals
in class ComplexVector
a
- a complex 3-vectorpublic java.lang.String toString()
toString
in class ComplexVector
public int hashCode()
hashCode
in class ComplexVector
public DoubleVector real()
real
in class ComplexVector
public DoubleVector imag()
imag
in class ComplexVector
public Complex getComponent(int n)
getComponent
in class ComplexVector
n
- index of the vector component
VectorDimensionException
- If attempting to access an invalid component.public void setComponent(int n, Complex z)
setComponent
in class ComplexVector
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 ComplexVector
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 ComplexVector
public double infNorm()
infNorm
in class ComplexVector
public ComplexVector conjugate()
conjugate
in class ComplexVector
public Complex3Vector add(Complex3Vector v)
v
- a complex 3-vectorpublic Complex3Vector add(Double3Vector v)
v
- a double 3-vectorpublic Complex3Vector add(Integer3Vector v)
v
- an integer 3-vectorpublic Complex3Vector subtract(Complex3Vector v)
v
- a complex 3-vectorpublic Complex3Vector subtract(Double3Vector v)
v
- a double 3-vectorpublic Complex3Vector subtract(Integer3Vector v)
v
- an integer 3-vectorpublic ComplexVector scalarMultiply(Complex z)
scalarMultiply
in class ComplexVector
z
- a complex number
public ComplexVector scalarMultiply(double x)
scalarMultiply
in class ComplexVector
x
- a double
public ComplexVector scalarDivide(Complex z)
scalarDivide
in class ComplexVector
z
- a complex number
java.lang.ArithmeticException
- If divide by zero.public ComplexVector scalarDivide(double x)
scalarDivide
in class ComplexVector
x
- a double
java.lang.ArithmeticException
- If divide by zero.public Complex scalarProduct(Complex3Vector v)
v
- a complex 3-vectorpublic Complex3Vector multiply(Complex3Vector v)
v
- a complex 3-vectorpublic ComplexVector mapComponents(ComplexMapping f)
mapComponents
in class ComplexVector
f
- a user-defined function
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |