|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--HFE.LUDecomposition4
This class encapsulates the operations for LUDecomposition
for matrices over the finite field F_4
).
The class provides only operations which are needed in the
HFE package. The class is based upon the Jama package, which
was produced by The MathWorks, Inc. and the National
Institute of Standards and Technology.
Jama can be downloaded from the NIST page
http://math.nist.gov/javanumerics/jama/.
The explenation of LU decomposition is copied from there documentation:
For an m-by-n matrix A with m >= n, the LU decomposition is an m-by-n unit lower triangular matrix L, an n-by-n upper triangular matrix U, and a permutation vector piv of length m so that A(piv,:) = L*U. If m < n, then L is m-by-m and U is m-by-n.
The LU decompostion with pivoting always exists, even if the matrix is singular, so the constructor will never fail. The primary use of the LU decomposition is in the solution of square systems of simultaneous linear equations. This will fail if isNonsingular() returns false.
Field Summary | |
private int[][] |
LU
Array for internal storage of decomposition. |
private int |
m
Row and column dimensions, and pivot sign. |
private int |
n
Row and column dimensions, and pivot sign. |
private int[] |
piv
Internal storage of pivot vector. |
Constructor Summary | |
LUDecomposition4(Matrix4 A)
LU Decomposition |
Method Summary | |
int |
det()
Determinant |
static java.lang.Object[] |
generateNonsingular(int size,
java.util.Random rnd)
Generates a random nonsingular matrix of the given size. |
boolean |
isNonsingular()
Is the matrix nonsingular? |
static void |
main(java.lang.String[] args)
Tests everything in this class |
void |
solve(int[] b,
int[] x)
Solve A*x = b, i.e. |
Matrix4 |
solve(Matrix4 B)
Solve A*X = B |
static void |
testIt()
Tests the functionality of the whole class. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private int[][] LU
private int m
private int n
private int[] piv
Constructor Detail |
public LUDecomposition4(Matrix4 A)
A
- Rectangular matrixMethod Detail |
public static java.lang.Object[] generateNonsingular(int size, java.util.Random rnd)
size
- Number of rows/columns.rnd
- Random number generator.public boolean isNonsingular()
public int det()
public Matrix4 solve(Matrix4 B)
B
- A Matrix with as many rows as A and any number of columns.java.lang.IllegalArgumentException
- Matrix row dimensions must agree.java.lang.RuntimeException
- Matrix is singular.public void solve(int[] b, int[] x)
b
- A vector with as many rows as A; it is treated to be a n*1 matrix.public static void testIt()
public static void main(java.lang.String[] args)
testIt()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |