|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmfc.vector.Complex2
This class represents a complex 2-vector
[ a ] [ aRe + i aIm ] [ b ] = [ bRe + i bIm ]
To minimize the object count its 2 complex entries a,b
are represented by 4 double values
aRe, aIm, bRe, bIm.
All methods avoid the creation of temporarily used objects in their
internal computations unless stated in their describtions.
Creation of many temporarily used instances is expensive and stresses
the garabage collector.
This can cause your java program to be slow and should therefore be avoided.
Thus, operations which result in an instance of Complex
can be performed either with or without creating a vector.
To compute, for example, the product of matrix with a vector you can either use
Complex2 v = m.times( w ),or
v.assignTimes( m, w ).This philosophy is applied to operations which result in other instances, as well. In such a case an instance of the resulting type can be prescribed as a parameter which is than filled by the method.
| Field Summary | |
double |
aIm
entry of the vector |
double |
aRe
entry of the vector |
double |
bIm
entry of the vector |
double |
bRe
entry of the vector |
protected static double |
EPS
threashold for zero tests; default is 1e-14 |
| Constructor Summary | |
|
Complex2()
creates zero vector |
|
Complex2(Complex2 v)
creates a vector equal to the prescribed one |
protected |
Complex2(Complex a,
Complex b)
creates a vector with the prescribed entries |
|
Complex2(double aRe,
double aIm,
double bRe,
double bIm)
creates a vector with the prescribed entries |
| Method Summary | |
void |
assign(Complex2 s)
assigns this with the prescribed vector |
void |
assign(Complex a,
Complex b)
assigns this with the prescribed entries |
void |
assign(double aRe,
double aIm,
double bRe,
double bIm)
assigns this with the prescribed entries |
void |
assignTimes(AbstractComplex2By2 m,
Complex2 v)
assign this with product of matrix m and vector
v. |
void |
assignTimes(Complex z,
Complex2 v)
Assign this with the product of a complex number and a
complex 2-vector. |
void |
assignZero()
assigns this with zero |
Complex2 |
copy()
returns copy of this |
Complex |
getA()
returns entry a of this |
void |
getA(Complex a)
assigns a with entry a of this |
Complex |
getB()
returns entry b of this |
void |
getB(Complex b)
assigns b with entry b of this |
void |
setA(Complex a)
sets entry a of this with a |
void |
setB(Complex b)
sets entry b of this with b |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static final double EPS
public double aRe
public double aIm
public double bRe
public double bIm
| Constructor Detail |
public Complex2()
public Complex2(double aRe,
double aIm,
double bRe,
double bIm)
protected Complex2(Complex a,
Complex b)
public Complex2(Complex2 v)
| Method Detail |
public void assignZero()
public void assign(double aRe,
double aIm,
double bRe,
double bIm)
public final Complex getA()
a of this
public final void getA(Complex a)
a with entry a of this
a - complex value which is assigned with entry a.public final void setA(Complex a)
a of this with a
public final Complex getB()
b of this
public final void getB(Complex b)
b with entry b of this
b - complex value which is assigned with entry b.public final void setB(Complex b)
b of this with b
public final Complex2 copy()
public final void assign(Complex a,
Complex b)
public final void assign(Complex2 s)
public final void assignTimes(AbstractComplex2By2 m,
Complex2 v)
m and vector
v.
public final void assignTimes(Complex z,
Complex2 v)
this with the product of a complex number and a
complex 2-vector.
public java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||