numericalMethods.algebra.linear.solve
Class AXB

java.lang.Object
  |
  +--numericalMethods.algebra.linear.solve.AXB

public class AXB
extends java.lang.Object

Computes for a system of equations AX=B with given matrices A and B the solving or minimizing matrix X. The algorithms used are the Householder decomposition and the solver of RX=B.

If the left side matrix is square and regular then the system is solved exactly and if not then it is minimized.

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. 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 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 Ax=b:

optimizedeasy to use
real valued solve(A,b,...) solve(A,x,b)
complex valued solve(A,b,...) solve(A,x,b)
Method versions for AX=B:
optimizedeasy to use
real valued solve(A,B,...) solve(A,X,B)
complex valued solve(A,B,...) solve(A,X,B)
This class does not check any arguments for validity!
For identical arguments results are undefined!

See Also:
Householder, RXB

Constructor Summary
AXB()
           
 
Method Summary
static boolean solve(double[][] A, double[][] X, double[][] B)
          Minimizes a system of real valued equations.
static boolean solve(double[][] A_re, double[][] A_im, double[][] X_re, double[][] X_im, double[][] B_re, double[][] B_im)
          Minimizes a system of complex valued equations.
static boolean solve(double[][] A_re, double[][] A_im, double[][] B_re, double[][] B_im, double[] t0, double[] t1, double[] t2, double[] t3)
          Minimizes a system of complex valued equations.
static boolean solve(double[][] A, double[][] B, double[] t0, double[] t1)
          Minimizes a system of real valued equations.
static boolean solve(double[][] A_re, double[][] A_im, double[] x_re, double[] x_im, double[] b_re, double[] b_im)
          Minimizes a system of complex valued equations.
static boolean solve(double[][] A_re, double[][] A_im, double[] b_re, double[] b_im, double[] t0, double[] t1, double[] t2, double[] t3)
          Minimizes a system of complex valued equations.
static boolean solve(double[][] A, double[] x, double[] b)
          Minimizes a system of real valued equations.
static boolean solve(double[][] A, double[] b, double[] t0, double[] t1)
          Minimizes a system of real valued equations.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AXB

public AXB()
Method Detail

solve

public static boolean solve(double[][] A,
                            double[] b,
                            double[] t0,
                            double[] t1)
Minimizes a system of real valued equations.

Parameters:
A - The left side and destroyed afterwards.
b - The right side and the solution afterwards (for non square left sides the lower part is unchanged).
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.
Returns:
True if system was solvable or minimizable.

solve

public static boolean solve(double[][] A,
                            double[] x,
                            double[] b)
Minimizes a system of real valued equations.

This method temporary allocates:

Parameters:
A - The left side.
x - A vector taking the solution.
b - The right side.
Returns:
True if system was solvable or minimizable.

solve

public static boolean solve(double[][] A_re,
                            double[][] A_im,
                            double[] b_re,
                            double[] b_im,
                            double[] t0,
                            double[] t1,
                            double[] t2,
                            double[] t3)
Minimizes a system of complex valued equations.

Parameters:
A_re - The real part of the left side and destroyed afterwards.
A_im - The imaginary part of the left side and destroyed afterwards.
b_re - The real part of the right side and the solution afterwards (for non square left sides the lower part is unchanged).
b_im - The imaginary part of the right side and the solution afterwards (for non square left sides the lower part is unchanged).
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.
t2 - A double array of same length as the matrix A has columns for storing temporary results during the computation.
t3 - A double array of same length as the matrix A has columns for storing temporary results during the computation.
Returns:
True if system was solvable or minimizable.

solve

public static boolean solve(double[][] A_re,
                            double[][] A_im,
                            double[] x_re,
                            double[] x_im,
                            double[] b_re,
                            double[] b_im)
Minimizes a system of complex valued equations.

This method temporary allocates:

Parameters:
A_re - The real part of the left side.
A_im - The imaginary part of the left side.
x_re - A vector taking the real part of the solution.
x_im - A vector taking the imaginary part of the solution.
b_re - The real part of the right side.
b_im - The imaginary part of the right side.
Returns:
True if system was solvable or minimizable.

solve

public static boolean solve(double[][] A,
                            double[][] B,
                            double[] t0,
                            double[] t1)
Minimizes a system of real valued equations.

Parameters:
A - The left side and destroyed afterwards.
B - The right side and the solution afterwards (for non square left sides the lower part is unchanged).
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.
Returns:
True if system was solvable or minimizable.

solve

public static boolean solve(double[][] A,
                            double[][] X,
                            double[][] B)
Minimizes a system of real valued equations.

This method temporary allocates:

Parameters:
A - The left side.
X - A matrix taking the solution.
B - The right side.
Returns:
True if system was solvable or minimizable.

solve

public static boolean solve(double[][] A_re,
                            double[][] A_im,
                            double[][] B_re,
                            double[][] B_im,
                            double[] t0,
                            double[] t1,
                            double[] t2,
                            double[] t3)
Minimizes a system of complex valued equations.

Parameters:
A_re - The real part of the left side and destroyed afterwards.
A_im - The imaginary part of the left side and destroyed afterwards.
B_re - The real part of the right side and the solution afterwards (for non square left sides the lower part is unchanged).
B_im - The imaginary part of the right side and the solution afterwards (for non square left sides the lower part is unchanged).
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.
t2 - A double array of same length as the matrix A has columns for storing temporary results during the computation.
t3 - A double array of same length as the matrix A has columns for storing temporary results during the computation.
Returns:
True if system was solvable or minimizable.

solve

public static boolean solve(double[][] A_re,
                            double[][] A_im,
                            double[][] X_re,
                            double[][] X_im,
                            double[][] B_re,
                            double[][] B_im)
Minimizes a system of complex valued equations.

This method temporary allocates:

Parameters:
A_re - The real part of the left side.
A_im - The imaginary part of the left side.
X_re - A matrix taking the real part of the solution.
X_im - A matrix taking the imaginary part of the solution.
B_re - The real part of the right side.
B_im - The imaginary part of the right side.
Returns:
True if system was solvable or minimizable.