Class InnerTriangularSolver_DDRB
Contains triangular solvers for inner blocks of a DMatrixRBlock.
for i=1:m
for j=1:i-1
val = 0
for k=j:i-1
val = val - L(i,k) * X(k,j)
end
x(i,j) = val / L(i,i)
end
x(i,i) = 1 / L(i,i)
end
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidinvertLower(double[] L, double[] L_inv, int m, int offsetL, int offsetL_inv) Inverts a square lower triangular matrix: L = L-1static voidinvertLower(double[] L, int m, int offsetL) Inverts a square lower triangular matrix: L = L-1static voidsolveL(double[] L, double[] b, int m, int n, int strideL, int offsetL, int offsetB) Solves for non-singular lower triangular matrices using forward substitution.static voidsolveLTransB(double[] L, double[] b, int m, int n, int strideL, int offsetL, int offsetB) Solves for non-singular lower triangular matrices using forward substitution.static voidsolveTransL(double[] L, double[] b, int m, int n, int strideL, int offsetL, int offsetB) Solves for non-singular transposed lower triangular matrices using backwards substitution:
B = L-TB
where B is a (m by n) matrix, L is a lower triangular (m by m) matrix.static voidsolveTransU(double[] U, double[] b, int m, int n, int strideU, int offsetU, int offsetB) Solves for non-singular upper triangular matrices using forward substitution.static voidsolveU(double[] U, double[] b, int m, int n, int strideU, int offsetU, int offsetB) Solves for non-singular upper triangular matrices using backwards substitution.
-
Constructor Details
-
InnerTriangularSolver_DDRB
public InnerTriangularSolver_DDRB()
-
-
Method Details
-
invertLower
public static void invertLower(double[] L, double[] L_inv, int m, int offsetL, int offsetL_inv) Inverts a square lower triangular matrix: L = L-1
- Parameters:
L- Lower triangular matrix being inverted. Not modified.L_inv- Where the inverse is stored. Can be the same as L. Modified.m- The number of rows and columns.offsetL- which index does the L matrix start at.offsetL_inv- which index does the L_inv matrix start at.
-
invertLower
public static void invertLower(double[] L, int m, int offsetL) Inverts a square lower triangular matrix: L = L-1
- Parameters:
L- Lower triangular matrix being inverted. Over written with inverted matrix. Modified.m- The number of rows and columns.offsetL- which index does the L matrix start at.
-
solveL
public static void solveL(double[] L, double[] b, int m, int n, int strideL, int offsetL, int offsetB) Solves for non-singular lower triangular matrices using forward substitution.
B = L-1B
where B is a (m by n) matrix, L is a lower triangular (m by m) matrix.- Parameters:
L- An m by m non-singular lower triangular matrix. Not modified.b- An m by n matrix. Modified.m- size of the L matrixn- number of columns in the B matrix.strideL- number of elements that need to be added to go to the next row in LoffsetL- initial index in L where the matrix startsoffsetB- initial index in B where the matrix starts
-
solveTransL
public static void solveTransL(double[] L, double[] b, int m, int n, int strideL, int offsetL, int offsetB) Solves for non-singular transposed lower triangular matrices using backwards substitution:
B = L-TB
where B is a (m by n) matrix, L is a lower triangular (m by m) matrix.- Parameters:
L- An m by m non-singular lower triangular matrix. Not modified.b- An m by n matrix. Modified.m- size of the L matrixn- number of columns in the B matrix.strideL- number of elements that need to be added to go to the next row in LoffsetL- initial index in L where the matrix startsoffsetB- initial index in B where the matrix starts
-
solveLTransB
public static void solveLTransB(double[] L, double[] b, int m, int n, int strideL, int offsetL, int offsetB) Solves for non-singular lower triangular matrices using forward substitution.
BT = L-1BT
where B is a (n by m) matrix, L is a lower triangular (m by m) matrix.- Parameters:
L- An m by m non-singular lower triangular matrix. Not modified.b- An n by m matrix. Modified.m- size of the L matrixn- number of columns in the B matrix.offsetL- initial index in L where the matrix startsoffsetB- initial index in B where the matrix starts
-
solveU
public static void solveU(double[] U, double[] b, int m, int n, int strideU, int offsetU, int offsetB) Solves for non-singular upper triangular matrices using backwards substitution.
B = U-1B
where B (m by n) is a matrix, U is a (m by m ) upper triangular matrix.
- Parameters:
U- An m by m non-singular upper triangular matrix. Not modified.b- An m by n matrix. Modified.m- size of the L matrixn- number of columns in the B matrix.offsetU- initial index in L where the matrix startsoffsetB- initial index in B where the matrix starts
-
solveTransU
public static void solveTransU(double[] U, double[] b, int m, int n, int strideU, int offsetU, int offsetB) Solves for non-singular upper triangular matrices using forward substitution.
B = U-TB
where B (m by n) is a matrix, U is a (m by m ) upper triangular matrix.
- Parameters:
U- An m by m non-singular upper triangular matrix. Not modified.b- An m by n matrix. Modified.m- size of the L matrixn- number of columns in the B matrix.offsetU- initial index in L where the matrix startsoffsetB- initial index in B where the matrix starts
-