public static boolean luDecomposition(double matrix0,
Given a 4x4 array "matrix0", this function replaces it with the
LU decomposition of a row-wise permutation of itself. The input
parameters are "matrix0" and "dimen". The array "matrix0" is also
an output parameter. The vector "row_perm" is an output
parameter that contains the row permutations resulting from partial
pivoting. The output parameter "even_row_xchg" is 1 when the
number of row exchanges is even, or -1 otherwise. Assumes data
type is always double.
This function is similar to luDecomposition, except that it
is tuned specifically for 4x4 matrices.
true if the matrix is nonsingular, or false otherwise.
public static void luBacksubstitution(double matrix1,
Solves a set of linear equations. The input parameters "matrix1",
and "row_perm" come from luDecompostionD4x4 and do not change
here. The parameter "matrix2" is a set of column vectors assembled
into a 4x4 matrix of floating-point values. The procedure takes each
column of "matrix2" in turn and treats it as the right-hand side of the
matrix equation Ax = LUx = b. The solution vector replaces the
original column of the matrix.
If "matrix2" is the identity matrix, the procedure replaces its contents
with the inverse of the matrix from which "matrix1" was originally