org.ejml.alg.block
Class BlockTriangularSolver

java.lang.Object
  extended by org.ejml.alg.block.BlockTriangularSolver

public class BlockTriangularSolver
extends Object

Contains triangular solvers for BlockMatrix64F 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.

Author:
Peter Abeles

Constructor Summary
BlockTriangularSolver()
           
 
Method Summary
static void invert(int blockLength, boolean upper, D1Submatrix64F T, D1Submatrix64F T_inv, double[] temp)
          Inverts an upper or lower triangular block submatrix.
static void invert(int blockLength, boolean upper, D1Submatrix64F T, double[] temp)
          Inverts an upper or lower triangular block submatrix.
static void solve(int blockLength, boolean upper, D1Submatrix64F T, D1Submatrix64F 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, D1Submatrix64F T, D1Submatrix64F 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, D1Submatrix64F L, D1Submatrix64F B, boolean transL)
           Solves lower triangular systems:

B = L-1 B

static void solveR(int blockLength, D1Submatrix64F R, D1Submatrix64F 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 Detail

BlockTriangularSolver

public BlockTriangularSolver()
Method Detail

invert

public static void invert(int blockLength,
                          boolean upper,
                          D1Submatrix64F T,
                          D1Submatrix64F T_inv,
                          double[] temp)
Inverts an upper or lower triangular block submatrix.

Parameters:
blockLength -
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.
temp - Work space variable that is size blockLength*blockLength.

invert

public static void invert(int blockLength,
                          boolean upper,
                          D1Submatrix64F T,
                          double[] temp)
Inverts an upper or lower triangular block submatrix.

Parameters:
blockLength -
upper - Is it upper or lower triangular.
T - Triangular matrix that is to be inverted. Overwritten with solution. Modified.
temp - Work space variable that is size blockLength*blockLength.

solve

public static void solve(int blockLength,
                         boolean upper,
                         D1Submatrix64F T,
                         D1Submatrix64F 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,
                              D1Submatrix64F T,
                              D1Submatrix64F 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,
                          D1Submatrix64F L,
                          D1Submatrix64F 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:
blockLength -
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,
                          D1Submatrix64F R,
                          D1Submatrix64F 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:
blockLength -
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?


Copyright © 2012. All Rights Reserved.