org.ejml.alg.dense.misc
Class DeterminantFromMinor

java.lang.Object
  extended by org.ejml.alg.dense.misc.DeterminantFromMinor

public class DeterminantFromMinor
extends Object

Computes the determinant of a matrix using Laplace expansion. This is done using minor matrices as is shown below:

|A| = Sum{ i=1:k ; aij Cij }

Cij = (-1)i+j Mij

Where M_ij is the minor of matrix A formed by eliminating row i and column j from A.

This is significantly more computationally expensive than using LU decomposition, but its computation has the advantage being independent of the matrices value.

Author:
Peter Abeles
See Also:
LUDecompositionAlt

Constructor Summary
DeterminantFromMinor(int width)
           
DeterminantFromMinor(int width, int minWidth)
           
 
Method Summary
 double compute(RowD1Matrix64F mat)
          Computes the determinant for the specified matrix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeterminantFromMinor

public DeterminantFromMinor(int width)
Parameters:
width - The width of the matrices that it will be computing the determinant for

DeterminantFromMinor

public DeterminantFromMinor(int width,
                            int minWidth)
Parameters:
width - The width of the matrices that it will be computing the determinant for
minWidth - At which point should it use a predefined function to compute the determinant.
Method Detail

compute

public double compute(RowD1Matrix64F mat)
Computes the determinant for the specified matrix. It must be square and have the same width and height as what was specified in the constructor.

Parameters:
mat - The matrix whose determinant is to be computed.
Returns:
The determinant.


Copyright © 2012. All Rights Reserved.