Package no.uib.cipr.matrix
Class BandLU
- java.lang.Object
-
- no.uib.cipr.matrix.BandLU
-
public class BandLU extends java.lang.Object
Banded 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 BandLU
factor(BandMatrix A)
Creates an LU decomposition of the given matrixBandLU
factor(BandMatrix A, boolean inplace)
Creates an LU decomposition of the given matrixstatic BandLU
factorize(BandMatrix A)
Creates an LU decomposition of the given matrixUnitLowerTriangBandMatrix
getL()
Returns the lower triangular factorBandMatrix
getLU()
Returns the decomposition matrixint[]
getPivots()
Returns the row pivotsUpperTriangBandMatrix
getU()
Returns the upper triangular factorboolean
isSingular()
Checks for singularitydouble
rcond(Matrix A, Matrix.Norm norm)
Computes the reciprocal condition number, using either the infinity norm of the 1 norm.DenseMatrix
solve(DenseMatrix B)
ComputesA\B
, overwritingB
DenseMatrix
transSolve(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+ku
inplace
- 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.One
orNorm.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
-
-