Class LinAlg<C extends RingElem<C>>
java.lang.Object
edu.jas.vector.LinAlg<C>
- Type Parameters:
C- coefficient type
- All Implemented Interfaces:
Serializable
Linear algebra methods. Implements linear algebra computations and tests,
mainly based on Gauss elimination. Partly based on LU_decomposition.
Computation of Null space basis, row echelon form, inverses and ranks.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMatrix LU decomposition.determinantLU(GenMatrix<C> A, List<Integer> P) Determinant with LU decomposition.Matrix fraction free Gauss elimination.Inverse with LU decomposition.nullSpaceBasis(GenMatrix<C> A) Matrix Null Space basis, cokernel.longRank via null space.longRank via row echelon form.rowEchelonForm(GenMatrix<C> A) Matrix row echelon form construction.Matrix row echelon form construction.Solve linear system of equations.Solve with LU decomposition.
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger logger
-
-
Constructor Details
-
LinAlg
public LinAlg()Constructor.
-
-
Method Details
-
decompositionLU
Matrix LU decomposition. Matrix A is replaced by its LU decomposition. A contains a copy of both matrices L-E and U as A=(L-E)+U such that P*A=L*U. The permutation matrix is not stored as a matrix, but in an integer vector P of size N+1 containing column indexes where the permutation matrix has "1". The last element P[N]=S+N, where S is the number of row exchanges needed for determinant computation, det(P)=(-1)^S- Parameters:
A- a n×n matrix.- Returns:
- permutation vector P and modified matrix A.
-
solveLU
-
solve
-
determinantLU
-
inverseLU
-
nullSpaceBasis
-
rankNS
-
rowEchelonForm
-
rankRE
-
rowEchelonFormSparse
Matrix row echelon form construction. Matrix A is replaced by its row echelon form, an upper triangle matrix with less non-zero entries. No column swaps and transforms are performed as with the Gauss-Jordan algorithm.- Parameters:
A- a n×m matrix.- Returns:
- A sparse row echelon form of A, matrix A is modified.
-
fractionfreeGaussElimination
Matrix fraction free Gauss elimination. Matrix A is replaced by its fraction free LU decomposition. A contains a copy of both matrices L-E and U as A=(L-E)+U such that P*A=L*U. TODO: L is not computed but 0. The permutation matrix is not stored as a matrix, but in an integer vector P of size N+1 containing column indexes where the permutation matrix has "1". The last element P[N]=S+N, where S is the number of row exchanges needed for determinant computation, det(P)=(-1)^S- Parameters:
A- a n×n matrix.- Returns:
- permutation vector P and modified matrix A.
-