numericalMethods.algebra.linear
Class Inversion

java.lang.Object
  |
  +--numericalMethods.algebra.linear.Inversion

public class Inversion
extends java.lang.Object

Computes the inverse of a square matrix.

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 Inversion:

optimizedeasy to use
real valued compute(A,...) compute(A,I)
complex valued compute(A,...) compute(A,I)

This class does not check any arguments for validity!
For identical arguments results are undefined!


Constructor Summary
Inversion()
           
 
Method Summary
static boolean compute(double[][] A, double[][] I)
          Inverts a real valued square matrix.
static boolean compute(double[][] A_re, double[][] A_im, double[][] I_re, double[][] I_im)
          Inverts a complex valued square matrix.
static boolean compute(double[][] A_re, double[][] A_im, double[][] T0, double[][] T1, double[] t0, double[] t1, double[] t2, double[] t3)
          Inverts a complex valued square matrix.
static boolean compute(double[][] A, double[][] T, double[] t0, double[] t1)
          Inverts a real valued square matrix.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Inversion

public Inversion()
Method Detail

compute

public static boolean compute(double[][] A,
                              double[][] T,
                              double[] t0,
                              double[] t1)
Inverts a real valued square matrix.

Parameters:
A - The square matrix to invert and its inverse afterwards.
T - A dual indexed double array of same size as matrix A for storing temporary results during the computation.
t0 - A double array of same size as matrix A has columns for storing temporary results during the computation.
t1 - A double array of same size as matrix A has columns for storing temporary results during the computation.
Returns:
True if matrix was regular and false if it was singular.

compute

public static boolean compute(double[][] A,
                              double[][] I)
Inverts a real valued square matrix.

This method temporary allocates:

Parameters:
A - The square matrix.
I - A matrix taking the inverse.
Returns:
True if matrix was regular and false if it was singular.

compute

public static boolean compute(double[][] A_re,
                              double[][] A_im,
                              double[][] T0,
                              double[][] T1,
                              double[] t0,
                              double[] t1,
                              double[] t2,
                              double[] t3)
Inverts a complex valued square matrix.

Parameters:
A_re - The real part of the square matrix to invert and its inverse afterwards.
A_im - The imaginary part of the square matrix to invert and its inverse afterwards.
T0 - A dual indexed double array of same size as matrix A for storing temporary results during the computation.
T1 - A dual indexed double array of same size as matrix A for storing temporary results during the computation.
t0 - A double array of same size as matrix A has columns for storing temporary results during the computation.
t1 - A double array of same size as matrix A has columns for storing temporary results during the computation.
t2 - A double array of same size as matrix A has columns for storing temporary results during the computation.
t3 - A double array of same size as matrix A has columns for storing temporary results during the computation.
Returns:
True if matrix was regular and false if it was singular.

compute

public static boolean compute(double[][] A_re,
                              double[][] A_im,
                              double[][] I_re,
                              double[][] I_im)
Inverts a complex valued square matrix.

This method temporary allocates:

Parameters:
A_re - The real part of the square matrix.
A_im - The imaginary part of the square matrix.
I_re - A matrix taking the real part of the inverse.
I_im - A matrix taking the imaginary part of the inverse.
Returns:
True if matrix was regular and false if it was singular.