Package no.uib.cipr.matrix
Class BandLU
- java.lang.Object
-
- no.uib.cipr.matrix.BandLU
-
public class BandLU extends java.lang.ObjectBanded LU decomposition
-
-
Constructor Summary
Constructors Constructor Description BandLU(int n, int kl, int ku)Constructor for BandLU
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BandLUfactor(BandMatrix A)Creates an LU decomposition of the given matrixBandLUfactor(BandMatrix A, boolean inplace)Creates an LU decomposition of the given matrixstatic BandLUfactorize(BandMatrix A)Creates an LU decomposition of the given matrixUnitLowerTriangBandMatrixgetL()Returns the lower triangular factorBandMatrixgetLU()Returns the decomposition matrixint[]getPivots()Returns the row pivotsUpperTriangBandMatrixgetU()Returns the upper triangular factorbooleanisSingular()Checks for singularitydoublercond(Matrix A, Matrix.Norm norm)Computes the reciprocal condition number, using either the infinity norm of the 1 norm.DenseMatrixsolve(DenseMatrix B)ComputesA\B, overwritingBDenseMatrixtransSolve(DenseMatrix B)ComputesAT\B, overwritingB
-
-
-
Method Detail
-
factorize
public static BandLU factorize(BandMatrix A)
Creates an LU decomposition of the given matrix- Parameters:
A- Matrix to decompose. Not modified- Returns:
- A LU decomposition of the matrix
-
factor
public BandLU factor(BandMatrix A, boolean inplace)
Creates an LU decomposition of the given matrix- Parameters:
A- Matrix to decompose. If the decomposition is in-place, its number of superdiagonals must equalkl+kuinplace- Wheter or not the decomposition should overwrite the passed matrix- Returns:
- The current decomposition
-
factor
public BandLU factor(BandMatrix A)
Creates an LU decomposition of the given matrix- Parameters:
A- Matrix to decompose. It will be overwritten with the decomposition. Its number of superdiagonals must equalkl+ku- Returns:
- The current decomposition
-
getL
public UnitLowerTriangBandMatrix getL()
Returns the lower triangular factor
-
getU
public UpperTriangBandMatrix getU()
Returns the upper triangular factor
-
getLU
public BandMatrix getLU()
Returns the decomposition matrix
-
getPivots
public int[] getPivots()
Returns the row pivots
-
isSingular
public boolean isSingular()
Checks for singularity
-
rcond
public double rcond(Matrix A, Matrix.Norm norm)
Computes the reciprocal condition number, using either the infinity norm of the 1 norm.- Parameters:
A- The matrix this is a decomposition ofnorm- EitherNorm.OneorNorm.Infinity- Returns:
- The reciprocal condition number. Values close to unity indicate a well-conditioned system, while numbers close to zero do not.
-
solve
public DenseMatrix solve(DenseMatrix B) throws MatrixSingularException
ComputesA\B, overwritingB- Throws:
MatrixSingularException
-
transSolve
public DenseMatrix transSolve(DenseMatrix B) throws MatrixSingularException
ComputesAT\B, overwritingB- Throws:
MatrixSingularException
-
-