

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: INNER  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object  +numericalMethods.algebra.linear.decompose.Householder
Computes for a matrix A the matrices Q and R complying A=Q·R. The algorithm used is the Householder algorithm.
This algorithm is implemented for both real and complex valued equation systems. And each method is again available in three versions.
One version is an optimized version that consumes as few resources as possible. Moreover it is possible to pass objects that this method can store temporary results during computation in them. This is for example useful when calling this method multiple times so there is no need for this method to allocate memory again and again. If null is passed for the temporary objects then suitable objects are allocated by the method itself.
The third version is an easy to use version that takes care of for example not changing any arguments where not expected. But this version can sometimes be very resource consuming!
The second version is kind of a mix between the first and the third version giving the orthogonal and triangular matrix while destroying the original matrix. Additionally it is possible to reduce the number of columns of the orthogonal matrix so that only some leading orthonormal vectors are given back.
Method versions for decompose:
This class does not check any arguments for validity!
optimized semi optimized easy to use real valued decompose(A,d,...)
decompose(A,Q,...)
decompose(A,Q,R)
complex valued decompose(A,d,...)
decompose(A,Q,...)
decompose(A,Q,R)
Constructor Summary  
Householder()

Method Summary  
static double 
decompose(double[][] A,
double[][] Q,
double[][] R)
Decomposes a real matrix. 
static double[] 
decompose(double[][] A_re,
double[][] A_im,
double[][] Q_re,
double[][] Q_im,
double[][] R_re,
double[][] R_im)
Decomposes a complex matrix. 
static double[] 
decompose(double[][] A_re,
double[][] A_im,
double[][] Q_re,
double[][] Q_im,
double[] t0,
double[] t1,
double[] t2,
double[] t3)
Decomposes a complex matrix while separating the orthogonal matrix. 
static double 
decompose(double[][] A,
double[][] Q,
double[] t0,
double[] t1)
Decomposes a real matrix while separating the orthogonal matrix. 
static double[] 
decompose(double[][] A_re,
double[][] A_im,
double[] d_re,
double[] d_im,
double[] t0,
double[] t1)
Decomposes a complex matrix storing the result in a merged way. 
static double 
decompose(double[][] A,
double[] d,
double[] t)
Decomposes a real matrix storing the result in a merged way. 
static void 
qTimes(double[][] Q,
double[][] A,
boolean conj,
double[] t)
Computes the product of a matrix with the producing vectors of an orthogonal matrix and a matrix. 
static void 
qTimes(double[][] Q_re,
double[][] Q_im,
double[][] A_re,
double[][] A_im,
boolean conj,
double[] t0,
double[] t1)
Computes the product of a matrix with the producing vectors of an unitary matrix with a matrix. 
static void 
qTimes(double[][] Q_re,
double[][] Q_im,
double[] a_re,
double[] a_im,
boolean conj)
Computes the product of a matrix with the producing vectors of an unitary matrix with a vector. 
static void 
qTimes(double[][] Q,
double[] a,
boolean conj)
Computes the product of a matrix with the producing vectors of an orthogonal matrix and a vector. 
Methods inherited from class java.lang.Object 

Constructor Detail 
public Householder()
Method Detail 
public static double decompose(double[][] A, double[] d, double[] t)
After decomposition the matrix contains the merged right triangular matrix and the producing vectors of the orthogonal matrix. The diagonal belongs to the orthogonal matrix and the diagonal of the right triangular matrix is stored in an extra vector.
For multiplying the orthogonal matrix Q stored by its producing vectors
with another matrix A the method
qTimes
can be used:
Q·A ≡qTimes(Q,A,false,null)
Q^{T}·A ≡qTimes(Q,A,true,null)
A
 The matrix to decompose and afterwards the merged
producing vectors of the orthogonal matrix and of the
right triangular matrix.d
 The diagonal of the right triangular matrix.t
 A double array of same length as the matrix has columns
for storing temporary results during the computation.qTimes
public static double decompose(double[][] A, double[][] Q, double[] t0, double[] t1)
A
 The matrix to decompose and afterwards the right triangular
matrix.Q
 A matrix taking (a part of) the orthogonal matrix.
If one doesn't want all orthonormal vectors it is possible
to pass a matrix beeing not square.
That is still having as much rows as A but having possibly
less columns.t0
 A double array of same length as the matrix has columns
for storing temporary results during the computation.t1
 A double array of same length as the matrix has rows
for storing temporary results during the computation.public static double decompose(double[][] A, double[][] Q, double[][] R)
This method temporary allocates:
A
 The matrix to decompose.Q
 A matrix taking the orthogonal matrix.
It must be square and must have the same number of rows as
A has.R
 A matrix taking the right triangular matrix.
It must have the same number of rows and columns as A has.public static double[] decompose(double[][] A_re, double[][] A_im, double[] d_re, double[] d_im, double[] t0, double[] t1)
After decomposition the matrix contains the merged right triangular matrix and the producing vectors of the unitary matrix. The diagonal belongs to the unitary matrix and the diagonal of the right triangular matrix is stored in an extra vector.
For multiplying the unitary matrix Q stored by its producing vectors
with another matrix A the method
qTimes
can be used:
Q·A ≡qTimes(Q_{re},Q_{im},A_{re},A_{im},false,null,null)
Q^{∗}·A ≡qTimes(Q_{re},Q_{im},A_{re},A_{im},true,null,null)
(Note: Q^{∗} means transposed and conjugated.)
A_re
 The real part of the matrix to decompose and afterwards
the real parts of the merged producing vectors of the
unitary matrix and of the right triangular matrix.A_im
 The imaginary part of the matrix to decompose and
afterwards the imaginary parts of the merged producing
vectors of the unitary matrix and of the right
triangular matrix.d_re
 The real part of the diagonal of the right triangular
matrix.d_im
 The imaginary part of the diagonal of the right
triangular matrix.t0
 A double array of same length as the matrix has columns
for storing temporary results during the computation.t1
 A double array of same length as the matrix has columns
for storing temporary results during the computation.qTimes
public static double[] decompose(double[][] A_re, double[][] A_im, double[][] Q_re, double[][] Q_im, double[] t0, double[] t1, double[] t2, double[] t3)
A_re
 The real part of the matrix to decompose and afterwards
the real part of the right triangular matrix.A_im
 The imaginary part of the matrix to decompose and
afterwards the imaginary part of the right triangular
matrix.Q_re
 A matrix taking (a part of) the real part of the
unitary matrix.
If one doesn't want all orthonormal vectors it is
possible to pass a matrix beeing not square.
That is still having as much rows as A but having
possibly less columns.Q_im
 A matrix taking (a part of) the imaginary part of the
unitary matrix.
If one doesn't want all orthonormal vectors it is
possible to pass a matrix beeing not square.
That is still having as much rows as A but having
possibly less columns.t0
 A double array of same length as the matrix has columns
for storing temporary results during the computation.t1
 A double array of same length as the matrix has columns
for storing temporary results during the computation.t2
 A double array of same length as the matrix has rows
for storing temporary results during the computation.t3
 A double array of same length as the matrix has rows
for storing temporary results during the computation.public static double[] decompose(double[][] A_re, double[][] A_im, double[][] Q_re, double[][] Q_im, double[][] R_re, double[][] R_im)
This method temporary allocates:
A_re
 The real part of the matrix to decompose.A_im
 The imaginary part of the matrix to decompose.Q_re
 The real part of a matrix taking the unitary matrix.
It must be square and must have the same number of rows
as A has.Q_im
 The imaginary part of a matrix taking the unitary
matrix.
It must be square and must have the same number of rows
as A has.R_re
 The real part of a matrix taking the right triangular
matrix.
It must have the same number of rows and columns as A
has.R_im
 The imaginary part of a matrix taking the right
triangular matrix.
It must have the same number of rows and columns as A
has.public static void qTimes(double[][] Q, double[] a, boolean conj)
Q
 The matrix with the producing vectors of the orthogonal
matrix.a
 A vector to be multiplied with and afterwards the
result.conj
 If false compute Q·a and if true Q^{T}·a.decompose
public static void qTimes(double[][] Q_re, double[][] Q_im, double[] a_re, double[] a_im, boolean conj)
Q_re
 The real part of the matrix with the producing vectors
of the unitary matrix.Q_im
 The imaginary part of the matrix with the producing
vectors of the unitary matrix.a_re
 The real part of a vector to be multiplied with and
afterwards the result.a_im
 The imaginary part of a vector to be multiplied with
and afterwards the result.conj
 If false compute Q·a and if true Q^{∗}·a.
decompose
public static void qTimes(double[][] Q, double[][] A, boolean conj, double[] t)
Q
 The matrix with the producing vectors of the orthogonal
matrix.A
 A matrix to be multiplied with and afterwards the
result.conj
 If false compute Q·A and if true Q^{T}·A.t
 A double array of same length as the matrix A has
columns for storing temporary results during the
computation.decompose
public static void qTimes(double[][] Q_re, double[][] Q_im, double[][] A_re, double[][] A_im, boolean conj, double[] t0, double[] t1)
Q_re
 The real part of the matrix with the producing vectors
of the unitary matrix.Q_im
 The imaginary part of the matrix with the producing
vectors of the unitary matrix.A_re
 The real part of a matrix to be multiplied with and
afterwards the result.A_im
 The imaginary part of a matrix to be multiplied with
and afterwards the result.conj
 If false compute Q·A and if true Q^{∗}·A.
t0
 A double array of same length as the matrix A has
columns for storing temporary results during the
computation.t1
 A double array of same length as the matrix A has
columns for storing temporary results during the
computation.decompose


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: INNER  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 