|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmfc.matrix.AbstractComplex2By2
This class is the base for all classes that are or can be represented as a complex 2-by-2 matrix.
Most of its functionallity is implemented
in protected methods. This enables derived classes to specialize and omit
certain functions. For example, it does not make any sense to add Moebius transformations.
To minimize the object count its
4 complex entries a,b,c,d are represented by 8 double values
, e.g.:
aRe, aIm, bRe, bIm, cRe, cIm, dRe, dIm
[ a b ] [ aRe + i aIm bRe + i bIm ] [ ] = [ ] [ c d ] [ dRe + i dIm dRe + i dIm ]
All methods avoid the creation of temporarily used objects in their internal computations unless the opposite is stated in their descriptions.
This class has final member objects, which are
used as dummy variables. Thus, it is definitely not thread-safe.
| Field Summary | |
protected double |
aIm
entry of the matrix |
protected double |
aRe
entry of the matrix |
protected double |
bIm
entry of the matrix |
protected double |
bRe
entry of the matrix |
protected double |
cIm
entry of the matrix |
protected double |
cRe
entry of the matrix |
protected double |
dIm
entry of the matrix |
protected double |
dRe
entry of the matrix |
static double |
EPS
threashold for zero tests; default is 1e-14 |
static double |
EPSILON
Deprecated. superceded by EPS |
static double |
EPSSQR
the square of EPS |
| Constructor Summary | |
protected |
AbstractComplex2By2()
creates an identity matrix |
|
AbstractComplex2By2(AbstractComplex2By2 m)
creates a matrix equaling prescribed matrix |
protected |
AbstractComplex2By2(Complex a,
Complex b,
Complex c,
Complex d)
creates a matrix with the prescribed entries |
protected |
AbstractComplex2By2(double aRe,
double aIm,
double bRe,
double bIm,
double cRe,
double cIm,
double dRe,
double dIm)
creates a matrix with the prescribed entries |
| Method Summary | |
double |
abs()
returns eucleaden norm |
double |
absSqr()
returns square of eucleaden norm |
protected void |
assign(AbstractComplex2By2 s)
assigns this with the prescribed matrix |
protected void |
assign(Complex a,
Complex b,
Complex c,
Complex d)
assigns this with the prescribed entries |
protected void |
assign(double aRe,
double aIm,
double bRe,
double bIm,
double cRe,
double cIm,
double dRe,
double dIm)
assigns this with the prescribed entries |
protected void |
assignAdjoined()
assigns this with its own adjoined |
protected void |
assignAdjoined(AbstractComplex2By2 a)
assigns this with the adjoined of a |
protected void |
assignAdjoinedWith(AbstractComplex2By2 t)
Assign this with t this t*. |
protected void |
assignAdjugate()
assigns this with its own adjugate |
protected void |
assignAdjugate(AbstractComplex2By2 a)
assigns this with the adjugate of a |
protected void |
assignByColumn(Complex2 column1,
Complex2 column2)
Assign this by column. |
protected void |
assignByEigenvectors(Complex eigenvalue1,
Complex2 eigenvector1,
Complex eigenvalue2,
Complex2 eigenvector2)
Assign this by prescribing eigenvectors and
eigenvalues. |
protected void |
assignByEigenvectors(double eigenvalue1Re,
double eigenvalue1Im,
Complex2 eigenvector1,
double eigenvalue2Re,
double eigenvalue2Im,
Complex2 eigenvector2)
Assign this by prescribing eigenvectors and
eigenvalues. |
protected void |
assignConjugate()
assigns this with its own conjugate |
protected void |
assignConjugate(AbstractComplex2By2 a)
assigns this with the conjugateative of a |
protected void |
assignConjugateWith(AbstractComplex2By2 t)
Assign this with t this t-1. |
protected void |
assignDivide(AbstractComplex2By2 m)
assigns this with the product of itself and inverse of m |
protected void |
assignDivide(AbstractComplex2By2 a,
AbstractComplex2By2 b)
assigns this with the product of a and inverse of b |
protected void |
assignDivide(AbstractComplex2By2 m,
Complex z)
assigns this with the product of m and 1/z |
protected void |
assignDivide(AbstractComplex2By2 m,
double r)
assigns this with the product of m and 1/r |
protected void |
assignDivide(AbstractComplex2By2 m,
double x,
double y)
assigns this with the product of m and 1/(x+iy) |
protected void |
assignDivide(Complex z)
assigns this with the product of itself and 1/z |
protected void |
assignDivide(double r)
assigns this with the product of itself and 1/r |
protected void |
assignDivide(double x,
double y)
assigns this with the product of itself and 1/(x+iy) |
protected void |
assignIdentity()
assigns this with the identity matrix |
protected void |
assignInvert()
assigns this with its own inverse |
protected void |
assignInvert(AbstractComplex2By2 m)
assigns this with the inverse of m |
protected void |
assignMinus(AbstractComplex2By2 a)
subtracts a from this |
protected void |
assignMinus(AbstractComplex2By2 a,
AbstractComplex2By2 b)
subtracts b from a and stores the result it this |
protected void |
assignMinus(AbstractComplex2By2 m,
Complex z)
subtracts z to all entries of m and
and assigns this with the result. |
protected void |
assignMinus(AbstractComplex2By2 m,
double x)
subtracts x from all entries of m and
and assigns this with the result. |
protected void |
assignMinus(AbstractComplex2By2 m,
double x,
double y)
subtracts x+iy to all entries of m and
and assigns this with the result. |
protected void |
assignMinus(Complex z)
subtracts z from all entries of this |
protected void |
assignMinus(double x)
subtracts x from all entries of this |
protected void |
assignMinus(double x,
double y)
subtracts x+iy to all entries of this |
protected void |
assignNeg()
assigns this with its own negative |
protected void |
assignNeg(AbstractComplex2By2 a)
assigns this with the negative of a |
protected void |
assignNormalizeDeterminant()
normalizes (determinant equals 1) this |
protected void |
assignNormalizeDeterminant(AbstractComplex2By2 m)
assigns this with m and normalizes (determinant equals 1) it |
protected void |
assignPlus(AbstractComplex2By2 a)
assigns this with the sum of itself and a |
protected void |
assignPlus(AbstractComplex2By2 a,
AbstractComplex2By2 b)
assigns this with the sum of a and b |
protected void |
assignPlus(AbstractComplex2By2 m,
Complex z)
adds z to all entries of m and
and assigns this with the result. |
protected void |
assignPlus(AbstractComplex2By2 m,
double x)
adds x to all entries of m and
and assigns this with the result. |
protected void |
assignPlus(AbstractComplex2By2 m,
double x,
double y)
adds x+iy to all entries of m and
and assigns this with the result. |
protected void |
assignPlus(Complex z)
adds z to all entries of this |
protected void |
assignPlus(double x)
adds x to all entries of this |
protected void |
assignPlus(double x,
double y)
adds x+iy to all entries of this |
protected void |
assignStar()
assigns this with its own transposed and conjugated |
protected void |
assignStar(AbstractComplex2By2 a)
assigns this with the transposed and conjugated of a |
protected void |
assignTimes(AbstractComplex2By2 a)
assigns this with the product of itself and a |
protected void |
assignTimes(AbstractComplex2By2 a,
AbstractComplex2By2 b)
assigns this with the product of a and b |
protected void |
assignTimes(AbstractComplex2By2 m,
Complex z)
assigns this with the product of m and z |
protected void |
assignTimes(AbstractComplex2By2 m,
double r)
assigns this with the product of m and r |
protected void |
assignTimes(AbstractComplex2By2 m,
double x,
double y)
assigns this with the product of m and x+iy |
protected void |
assignTimes(Complex z)
returns product of this and z |
protected void |
assignTimes(double r)
assigns this with the product of itself and r |
protected void |
assignTimes(double x,
double y)
assigns this with the product of itself and x+iy |
protected void |
assignTranspose()
assigns this with its own transposed |
protected void |
assignTranspose(AbstractComplex2By2 a)
assigns this with the transposed of a |
protected void |
assignZero()
assigns this with the zero matrix |
Complex |
determinant()
returns determinant of this |
void |
determinant(Complex det)
assigns det with the determinant of this |
double |
dist(AbstractComplex2By2 s)
returns eucleaden distance of this to s |
double |
distSqr(AbstractComplex2By2 s)
returns square of eucleaden distance of this to s |
static void |
divide(AbstractComplex2By2 a,
AbstractComplex2By2 b,
AbstractComplex2By2 c)
multiplies a and inverse of b and stores
the result in c. |
boolean |
equals(java.lang.Object o)
this is considered to equal o if
their euclidean distance is smaller than |
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 |
Complex |
getC()
returns entry c of this |
void |
getC(Complex c)
assigns c with entry c of this |
Complex |
getD()
returns entry d of this |
void |
getD(Complex d)
assigns d with entry d of this |
Complex[] |
getEigenValues()
returns array containing the two eigenvalues; the first entry contains the eigenvalue with the smaller euclidean norm. |
void |
getEigenValues(Complex[] ev)
assigns the first two entries of array ev to the
eigenvalues of the this;
the first entry contains the eigenvalue with the smaller euclidean norm. |
void |
getEigenValues(Complex smallEV,
Complex bigEV)
assigns smallEV with the smaller eigenvalue of this
and bigEV with the bigger;
both, smallEV and bigEV, may be null. |
static void |
minus(AbstractComplex2By2 a,
AbstractComplex2By2 b,
AbstractComplex2By2 c)
subtracts b from a and stores
the result in c. |
double |
norm()
returns the absulate value of the bigger eigenvalue. |
double |
normSqr()
returns the square of absulate value of the bigger eigenvalue. |
static void |
plus(AbstractComplex2By2 a,
AbstractComplex2By2 b,
AbstractComplex2By2 c)
adds a and b and stores
the result in c. |
protected void |
setA(Complex a)
sets entry a of this with a |
protected void |
setB(Complex b)
sets entry b of this with b |
protected void |
setC(Complex c)
sets entry c of this with c |
protected void |
setD(Complex d)
sets entry d of this with d |
static void |
times(AbstractComplex2By2 a,
AbstractComplex2By2 b,
AbstractComplex2By2 c)
multiplies a and b and stores
the result in c. |
static void |
times(AbstractComplex2By2 m,
Complex2 v,
Complex2 w)
Multiplies m with v and stores the result
in w. |
java.lang.String |
toString()
|
Complex |
trace()
returns trace of this |
void |
trace(Complex trace)
assigns trace with the trace of this |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final double EPSILON
public static final double EPS
public static final double EPSSQR
EPS
protected double aRe
protected double aIm
protected double bRe
protected double bIm
protected double cRe
protected double cIm
protected double dRe
protected double dIm
| Constructor Detail |
protected AbstractComplex2By2()
protected AbstractComplex2By2(double aRe,
double aIm,
double bRe,
double bIm,
double cRe,
double cIm,
double dRe,
double dIm)
protected AbstractComplex2By2(Complex a,
Complex b,
Complex c,
Complex d)
public AbstractComplex2By2(AbstractComplex2By2 m)
| Method Detail |
public Complex getA()
a of this
public void getA(Complex a)
a with entry a of this
a - complex value which is assigned with entry a.protected void setA(Complex a)
a of this with a
public Complex getB()
b of this
public void getB(Complex b)
b with entry b of this
b - complex value which is assigned with entry b.protected void setB(Complex b)
b of this with b
public Complex getC()
c of this
public void getC(Complex c)
c with entry c of this
c - complex value which is assigned with entry c.protected void setC(Complex c)
c of this with c
public Complex getD()
d of this
public void getD(Complex d)
d with entry d of this
d - complex value which is assigned with entry d.protected void setD(Complex d)
d of this with d
protected void assignZero()
protected void assignIdentity()
protected void assign(double aRe,
double aIm,
double bRe,
double bIm,
double cRe,
double cIm,
double dRe,
double dIm)
protected void assign(Complex a,
Complex b,
Complex c,
Complex d)
protected void assign(AbstractComplex2By2 s)
protected void assignTimes(AbstractComplex2By2 a)
public static void times(AbstractComplex2By2 a,
AbstractComplex2By2 b,
AbstractComplex2By2 c)
a and b and stores
the result in c.
protected void assignTimes(AbstractComplex2By2 a,
AbstractComplex2By2 b)
a and b
protected void assignTimes(double r)
r
protected void assignTimes(AbstractComplex2By2 m,
double r)
m and r
protected void assignTimes(double x,
double y)
x+iy
protected void assignTimes(AbstractComplex2By2 m,
double x,
double y)
m and x+iy
protected void assignTimes(Complex z)
z
protected void assignTimes(AbstractComplex2By2 m,
Complex z)
m and z
protected void assignDivide(AbstractComplex2By2 m)
m
public static void divide(AbstractComplex2By2 a,
AbstractComplex2By2 b,
AbstractComplex2By2 c)
a and inverse of b and stores
the result in c.
protected void assignDivide(AbstractComplex2By2 a,
AbstractComplex2By2 b)
a and inverse of b
protected void assignDivide(double r)
1/r
protected void assignDivide(AbstractComplex2By2 m,
double r)
m and 1/r
protected void assignDivide(double x,
double y)
1/(x+iy)
protected void assignDivide(AbstractComplex2By2 m,
double x,
double y)
m and 1/(x+iy)
protected void assignDivide(Complex z)
1/z
protected void assignDivide(AbstractComplex2By2 m,
Complex z)
m and 1/z
protected void assignPlus(AbstractComplex2By2 a)
public static void plus(AbstractComplex2By2 a,
AbstractComplex2By2 b,
AbstractComplex2By2 c)
a and b and stores
the result in c.
protected void assignPlus(AbstractComplex2By2 a,
AbstractComplex2By2 b)
a and b
protected void assignPlus(double x)
x to all entries of this
protected void assignPlus(AbstractComplex2By2 m,
double x)
x to all entries of m and
and assigns this with the result.
protected void assignPlus(double x,
double y)
x+iy to all entries of this
protected void assignPlus(AbstractComplex2By2 m,
double x,
double y)
x+iy to all entries of m and
and assigns this with the result.
protected void assignPlus(Complex z)
z to all entries of this
protected void assignPlus(AbstractComplex2By2 m,
Complex z)
z to all entries of m and
and assigns this with the result.
protected void assignMinus(AbstractComplex2By2 a)
a from this
public static void minus(AbstractComplex2By2 a,
AbstractComplex2By2 b,
AbstractComplex2By2 c)
b from a and stores
the result in c.
protected void assignMinus(AbstractComplex2By2 a,
AbstractComplex2By2 b)
b from a and stores the result it this
protected void assignMinus(double x)
x from all entries of this
protected void assignMinus(AbstractComplex2By2 m,
double x)
x from all entries of m and
and assigns this with the result.
protected void assignMinus(double x,
double y)
x+iy to all entries of this
protected void assignMinus(AbstractComplex2By2 m,
double x,
double y)
x+iy to all entries of m and
and assigns this with the result.
protected void assignMinus(Complex z)
z from all entries of this
protected void assignMinus(AbstractComplex2By2 m,
Complex z)
z to all entries of m and
and assigns this with the result.
protected void assignNeg(AbstractComplex2By2 a)
a
protected void assignNeg()
protected void assignConjugate(AbstractComplex2By2 a)
a
protected void assignConjugate()
protected void assignTranspose(AbstractComplex2By2 a)
a
protected void assignTranspose()
protected void assignStar(AbstractComplex2By2 a)
a
protected void assignStar()
protected void assignAdjugate(AbstractComplex2By2 a)
a
protected void assignAdjugate()
protected void assignInvert(AbstractComplex2By2 m)
m
protected void assignInvert()
protected void assignAdjoined(AbstractComplex2By2 a)
a
protected void assignAdjoined()
protected void assignNormalizeDeterminant(AbstractComplex2By2 m)
m and normalizes (determinant equals 1) it
protected void assignNormalizeDeterminant()
protected void assignByColumn(Complex2 column1,
Complex2 column2)
this by column.
column1 - a Complex2: the first column. Must not be
nullcolumn2 - a Complex2: the second column. Must not be
null
protected void assignConjugateWith(AbstractComplex2By2 t)
throws java.lang.IllegalArgumentException
this with t this t-1.
- Parameters:
t - an AbstractComplex2By2: the matrix with which to
conjugate
- Throws:
java.lang.IllegalArgumentException - if determinant of parameter
t is 0.0.
protected void assignAdjoinedWith(AbstractComplex2By2 t)
this with t this t*.
t - an AbstractComplex2By2: the matrix to adjoin
protected void assignByEigenvectors(double eigenvalue1Re,
double eigenvalue1Im,
Complex2 eigenvector1,
double eigenvalue2Re,
double eigenvalue2Im,
Complex2 eigenvector2)
Assign this by prescribing eigenvectors and
eigenvalues.
The given eigenvectors must be linearly independent.
eigenvalue1Re - a double: real part of the first
eigenvalueeigenvalue1Im - a double: imaginary part of the
first eigenvalueeigenvector1 - a Complex2: first eigenvectoreigenvalue2Re - a double: real part of the second
eigenvalueeigenvalue2Im - a double: imaginary part of the
second eigenvalueeigenvector2 - a Complex2: second eigenvector
protected void assignByEigenvectors(Complex eigenvalue1,
Complex2 eigenvector1,
Complex eigenvalue2,
Complex2 eigenvector2)
Assign this by prescribing eigenvectors and
eigenvalues.
The given eigenvectors must be linearly independent.
eigenvalue1 - a Complex: first eigenvalueeigenvector1 - a Complex2: first eigenvectoreigenvalue2 - a Complex: second eigenvalueeigenvector2 - a Complex2: second eigenvectorpublic final double absSqr()
public final double abs()
public final double distSqr(AbstractComplex2By2 s)
s
public final double dist(AbstractComplex2By2 s)
s
public final Complex determinant()
public final void determinant(Complex det)
det with the determinant of this
det - complex value which is assigned with the determinantpublic final Complex trace()
public final void trace(Complex trace)
trace with the trace of this
trace - complex value which is assigned with the tracepublic final double normSqr()
Complex
public final double norm()
Complex
public final void getEigenValues(Complex smallEV,
Complex bigEV)
smallEV with the smaller eigenvalue of this
and bigEV with the bigger;
both, smallEV and bigEV, may be null.
public final void getEigenValues(Complex[] ev)
ev to the
eigenvalues of the this;
the first entry contains the eigenvalue with the smaller euclidean norm.
if an entry of the array is null an instance of Complex is created.
public final Complex[] getEigenValues()
public boolean equals(java.lang.Object o)
o if
their euclidean distance is smaller than EPS
public java.lang.String toString()
public static void times(AbstractComplex2By2 m,
Complex2 v,
Complex2 w)
m with v and stores the result
in w.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||