numericalMethods.algebra.linear.decompose
Class QR

java.lang.Object
  |
  +--numericalMethods.algebra.linear.decompose.QR

public class QR
extends java.lang.Object

Computes for a square matrix A the matrices Q and R complying A=QR. The algorithm used is equivalent to Gram Schmidt orthonormalising.

This algorithm is implemented for both real and complex valued equation systems. And each method is again available in two version.

One version is an optimized version that consumes as few resources as possible.

The other 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!

Method versions for A=QR:

optimizedeasy to use
real valued decompose(Q,R) decompose(A,Q,R)
complex valued decompose(Q,R) decompose(A,Q,R)
This class does not check any arguments for validity!
For identical arguments results are undefined!

See Also:
numericalMethods.algebra.linear.decompose

Constructor Summary
QR()
           
 
Method Summary
static double decompose(double[][] Q, double[][] R)
          Decomposes a real matrix.
static double decompose(double[][] A, double[][] Q, double[][] R)
          Decomposes a real matrix.
static double[] decompose(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[][] R_re, double[][] R_im)
          Decomposes a complex matrix.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QR

public QR()
Method Detail

decompose

public static double decompose(double[][] Q,
                               double[][] R)
Decomposes a real matrix.

Parameters:
Q - The matrix to decompose and afterwards the orthogonal matrix.
R - A matrix taking the right triangular matrix.
Returns:
||det(A)||

decompose

public static double decompose(double[][] A,
                               double[][] Q,
                               double[][] R)
Decomposes a real matrix.

Parameters:
A - The matrix to decompose.
Q - A matrix taking the orthogonal matrix.
R - A matrix taking the right triangular matrix.
Returns:
||det(A)||

decompose

public static double[] decompose(double[][] Q_re,
                                 double[][] Q_im,
                                 double[][] R_re,
                                 double[][] R_im)
Decomposes a complex matrix.

Parameters:
Q_re - The real part of the matrix to decompose and afterwards the real part of the unitary matrix.
Q_im - The imaginary part of the matrix to decompose and afterwards the imaginary part of the unitary matrix.
R_re - A matrix taking the real part of the right triangular matrix.
R_im - A matrix taking the imaginary part of the right triangular matrix.
Returns:
||det(A)||

decompose

public 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.

Parameters:
A_re - The real part of the matrix to decompose.
A_im - The imaginary part of the matrix to decompose.
Q_re - A matrix taking the real part of the unitary matrix.
Q_im - A matrix taking the imaginary part of the unitary matrix.
R_re - A matrix taking the real part of the right triangular matrix.
R_im - A matrix taking the imaginary part of the right triangular matrix.
Returns:
||det(A)||