|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCommon.MatrixInversion
public class MatrixInversion
This class is responsible for inverting a matrix for solving a linear
equation Ax = b .
This is needed for finding the physical coordinates from screen
coordinates (for example, in showing mouse coordinates on the
viewer in real time).
Here we need to solve the following equation for X_physical
X_physical * Transformation_Matrix = X_screen
We know the screen coordinates (current mouse coordinates), but
need the corresponding physical coodinates.
This is a singleton class.
Field Summary | |
---|---|
private static double |
EPSILON
|
private int[] |
mEqnOrder
Because of partial pivoting, equations may be reordered. |
private static MatrixInversion |
mInstance
Single instance of this class. |
private float[] |
mLUDecomposedMatrix
LU decomposition of matrix (4X4). |
private float[] |
mMultipliers
|
Constructor Summary | |
---|---|
private |
MatrixInversion()
Class constructor. |
Method Summary | |
---|---|
private void |
BackSubstitutor(float[] A,
float[] b)
|
private void |
ForwardSubstitutor(float[] A,
float[] b)
|
static MatrixInversion |
Instance()
Get the singleton instance of the class. |
private boolean |
LUDecomposer(float[] A,
float[] b)
|
private void |
ReorderB(float[] b)
|
boolean |
SolveEqn(float[] A,
float[] b,
boolean decomposed)
|
private boolean |
Solver(float[] A,
float[] b,
boolean decomposed)
Solve the equation Ax = b, putting the answer in b. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private float[] mLUDecomposedMatrix
private int[] mEqnOrder
private float[] mMultipliers
private static final double EPSILON
private static MatrixInversion mInstance
Constructor Detail |
---|
private MatrixInversion()
Method Detail |
---|
public static MatrixInversion Instance()
mLUDecomposedMatrix
private boolean LUDecomposer(float[] A, float[] b)
private void ReorderB(float[] b)
private void ForwardSubstitutor(float[] A, float[] b)
private void BackSubstitutor(float[] A, float[] b)
private boolean Solver(float[] A, float[] b, boolean decomposed)
A
- A 16 element (4X4) array containing coefficient matrix.b
- RHS (4 element array). the array can get reordered
(the inversion process involves partial pivoting). The array is
overwritten with the result.decomposed
- boolean flag: true if A has been LU decomposed
by an earlier invocation to this function with this flag false.
false if this matrix is being sumbitted for the first time.
public boolean SolveEqn(float[] A, float[] b, boolean decomposed)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |