numericalMethods.algebra.linear
Class Determinant

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

public class Determinant
extends java.lang.Object

Computes the determinant 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 Determinant:

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

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


Constructor Summary
Determinant()
           
 
Method Summary
static double compute(double[][] A)
          Computes the determinant of a real valued square matrix.
static double[] compute(double[][] A_re, double[][] A_im)
          Computes the determinant of a complex valued square matrix.
static double[] compute(double[][] A_re, double[][] A_im, int[] t)
          Computes the determinant of a complex valued square matrix.
static double compute(double[][] A, int[] t)
          Computes the determinant of 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

Determinant

public Determinant()
Method Detail

compute

public static double compute(double[][] A,
                             int[] t)
Computes the determinant of a real valued square matrix.

Parameters:
A - The square matrix and destroyed afterwards.
t - An int array of same size as matrix A has rows for storing temporary results during the computation.
Returns:
The determinant.

compute

public static double compute(double[][] A)
Computes the determinant of a real valued square matrix.

This method temporary allocates:

Parameters:
A - The square matrix.
Returns:
The determinant.

compute

public static double[] compute(double[][] A_re,
                               double[][] A_im,
                               int[] t)
Computes the determinant of a complex valued square matrix.

Parameters:
A_re - The real part of the square matrix and destroyed afterwards.
A_im - The imaginary part of the square matrix and destroyed afterwards.
t - An int array of same size as matrix A has rows for storing temporary results during the computation.
Returns:
The determinant.

compute

public static double[] compute(double[][] A_re,
                               double[][] A_im)
Computes the determinant of 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.
Returns:
The determinant.