# Class TriangularSolver_DDRB

java.lang.Object
org.ejml.dense.block.TriangularSolver_DDRB

```public class TriangularSolver_DDRB
extends Object```

Contains triangular solvers for `DMatrixRBlock` block aligned sub-matrices.

For a more detailed description of a similar algorithm see: Page 30 in "Fundamentals of Matrix Computations" 2nd Ed. by David S. Watkins or any description of a block triangular solver in any other computational linear algebra book.

• ## Constructor Summary

Constructors
Constructor Description
`TriangularSolver_DDRB()`
• ## Method Summary

Modifier and Type Method Description
`static void` ```invert​(int blockLength, boolean upper, DSubmatrixD1 T, @Nullable GrowArray<DGrowArray> workspace)```
Inverts an upper or lower triangular block submatrix.
`static void` ```invert​(int blockLength, boolean upper, DSubmatrixD1 T, DSubmatrixD1 T_inv, @Nullable GrowArray<DGrowArray> workspace)```
Inverts an upper or lower triangular block submatrix.
`static void` ```solve​(int blockLength, boolean upper, DSubmatrixD1 T, DSubmatrixD1 B, boolean transT)```
Performs an in-place solve operation on the provided block aligned sub-matrices.

B = T-1 B

where T is a triangular matrix.
`static void` ```solveBlock​(int blockLength, boolean upper, DSubmatrixD1 T, DSubmatrixD1 B, boolean transT, boolean transB)```
Performs an in-place solve operation where T is contained in a single block.

B = T-1 B

where T is a triangular matrix contained in an inner block.
`static void` ```solveL​(int blockLength, DSubmatrixD1 L, DSubmatrixD1 B, boolean transL)```
Solves lower triangular systems:

B = L-1 B

`static void` ```solveR​(int blockLength, DSubmatrixD1 R, DSubmatrixD1 B, boolean transR)```
Solves upper triangular systems:

B = R-1 B

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ## Constructor Details

• ### TriangularSolver_DDRB

public TriangularSolver_DDRB()
• ## Method Details

• ### invert

public static void invert​(int blockLength, boolean upper, DSubmatrixD1 T, DSubmatrixD1 T_inv, @Nullable @Nullable GrowArray<DGrowArray> workspace)
Inverts an upper or lower triangular block submatrix. Uses a row-oriented approach.
Parameters:
`upper` - Is it upper or lower triangular.
`T` - Triangular matrix that is to be inverted. Must be block aligned. Not Modified.
`T_inv` - Where the inverse is stored. This can be the same as T. Modified.
`workspace` - Work space variable that is size blockLength*blockLength.
• ### invert

public static void invert​(int blockLength, boolean upper, DSubmatrixD1 T, @Nullable @Nullable GrowArray<DGrowArray> workspace)
Inverts an upper or lower triangular block submatrix. Uses a row oriented approach.
Parameters:
`upper` - Is it upper or lower triangular.
`T` - Triangular matrix that is to be inverted. Overwritten with solution. Modified.
`workspace` - Work space variable that is size blockLength*blockLength.
• ### solve

public static void solve​(int blockLength, boolean upper, DSubmatrixD1 T, DSubmatrixD1 B, boolean transT)

Performs an in-place solve operation on the provided block aligned sub-matrices.

B = T-1 B

where T is a triangular matrix. T or B can be transposed. T is a square matrix of arbitrary size and B has the same number of rows as T and an arbitrary number of columns.

Parameters:
`blockLength` - Size of the inner blocks.
`upper` - If T is upper or lower triangular.
`T` - An upper or lower triangular matrix. Not modified.
`B` - A matrix whose height is the same as T's width. Solution is written here. Modified.
• ### solveBlock

public static void solveBlock​(int blockLength, boolean upper, DSubmatrixD1 T, DSubmatrixD1 B, boolean transT, boolean transB)

Performs an in-place solve operation where T is contained in a single block.

B = T-1 B

where T is a triangular matrix contained in an inner block. T or B can be transposed. T must be a single complete inner block and B is either a column block vector or row block vector.

Parameters:
`blockLength` - Size of the inner blocks in the block matrix.
`upper` - If T is upper or lower triangular.
`T` - An upper or lower triangular matrix that is contained in an inner block. Not modified.
`B` - A block aligned row or column submatrix. Modified.
`transT` - If T is transposed or not.
`transB` - If B is transposed or not.
• ### solveL

public static void solveL​(int blockLength, DSubmatrixD1 L, DSubmatrixD1 B, boolean transL)

Solves lower triangular systems:

B = L-1 B

Reverse or forward substitution is used depending upon L being transposed or not.

Parameters:
`L` - Lower triangular with dimensions m by m. Not modified.
`B` - A matrix with dimensions m by n. Solution is written into here. Modified.
`transL` - Is the triangular matrix transposed?
• ### solveR

public static void solveR​(int blockLength, DSubmatrixD1 R, DSubmatrixD1 B, boolean transR)

Solves upper triangular systems:

B = R-1 B

Only the first B.numRows rows in R will be processed. Lower triangular elements are ignored.

Reverse or forward substitution is used depending upon L being transposed or not.

Parameters:
`R` - Upper triangular with dimensions m by m. Not modified.
`B` - A matrix with dimensions m by n. Solution is written into here. Modified.
`transR` - Is the triangular matrix transposed?