|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.matrix.doubles.linearsystem.Kernel
public class Kernel
The kernel or null space (also nullspace) of a matrix A is the set of all vectors x for which
Ax = 0
The kernel of a matrix with n columns is a linear subspace of n-dimensional Euclidean space.
The kernel of a matrix A is exactly the same as
the kernel of the linear mapping defined by the matrix-vector multiplication,
x → Ax
That is, the set of vectors that map to the zero vector.
By the rank-nullity theorem,
rank of A + dimension of the kernel of A = number of columns in A
This class can be used to solve a system of homogeneous linear equations.
Also, with the transformation matrix T, which turns A into the reduced row echelon form,
we can solve a system of non-homogeneous linear equations.
Specifically, to find a particular solution for a non-homogeneous system of linear equations with a matrix A,
i.e.,
Ax = b
we solve
T %*% A == U
and then
x = T %*% b
where x is a particular solution.
| Nested Class Summary | |
|---|---|
static class |
Kernel.Method
the methods available to do the LU decomposition |
| Field Summary | |
|---|---|
double |
epsilon
a precision parameter: when a number |x| ≤ ε, it is considered 0 |
Kernel.Method |
method
the method to perform the LU decomposition |
int |
ncols
number of columns |
int |
nrows
number of rows |
| Constructor Summary | |
|---|---|
Kernel(Matrix A)
Construct the kernel of a matrix. |
|
Kernel(Matrix A,
Kernel.Method method,
double epsilon)
Construct the kernel of a matrix. |
|
| Method Summary | |
|---|---|
VectorList |
basis()
Get a copy of the basis of the kernel. |
java.util.Map<java.lang.Integer,Vector> |
basisAndFreeVars()
Get a copy of the basis of the kernel and the associated free variables for each basis/column. |
boolean |
isZero()
Check if the kernel is of zero-dimension. |
int |
nullity()
Get the nullity of A. |
int |
rank()
Get the rank of A. |
Matrix |
T()
Get the transformation matrix, T, such that
T %*% A == U
To find a particular solution for a non-homogeneous system of linear equations with the same A,
i.e.,
Ax = b
we do
x = T %*% b
where x is a particular solution. |
Matrix |
U()
Get the upper triangular matrix U, such that
T %*% A == U |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final int nrows
public final int ncols
public final Kernel.Method method
public final double epsilon
| Constructor Detail |
|---|
public Kernel(Matrix A,
Kernel.Method method,
double epsilon)
We compute the basis vectors for the kernel.
That is, we compute T and U
such that
T %*% A == U
While the kernel basis is computed using one of the implementations in Kernel.Method,
the matrices T and U are always computed using Gauss-Jordan elimination.
A - a matrixmethod - the method to compute the orthogonal complement of Aepsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0;
the ε is used to determine the numerical rank of the linear spacepublic Kernel(Matrix A)
We compute the basis vectors for the kernel.
That is, we compute T and U
such that
T %*% A == U
While the kernel basis is computed using one of the implementations in Kernel.Method,
the matrices T and U are always computed using Gauss-Jordan elimination.
A - a matrix| Method Detail |
|---|
public int nullity()
A.
That is, the dimension of the kernel.
public int rank()
A.
That is, the number of linearly independent columns in A.
public java.util.Map<java.lang.Integer,Vector> basisAndFreeVars()
This method is only meaningful when the kernel is computed using Kernel.Method.GAUSSIAN_JORDAN_ELIMINATION.
Using this process, a free variable corresponds to an entry '1' in a column.
E.g., in the example in Wikipedia,
x3 (the 3rd variable) is a free variable, and it corresponds to [3,-5,1,0,0,0]t.
If the kernel basis is computed using a different method, call basis instead.
public VectorList basis()
public boolean isZero()
A has full rank.
true iff the kernel is nullpublic Matrix T()
T, such that
T %*% A == U
To find a particular solution for a non-homogeneous system of linear equations with the same A,
i.e.,
Ax = b
we do
x = T %*% b
where x is a particular solution.
Tpublic Matrix U()
U, such that
T %*% A == U
U matrix
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||