org.ejml.alg.block
Class BlockInnerTriangularSolver

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

public class BlockInnerTriangularSolver
extends Object

Contains triangular solvers for inner blocks of a BlockMatrix64F.

Algorithm for lower triangular inverse:

 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
 

Author:
Peter Abeles

Constructor Summary
BlockInnerTriangularSolver()
           
 
Method Summary
static void invertLower(double[] L, double[] L_inv, int m, int offsetL, int offsetL_inv)
           Inverts a square lower triangular matrix: L = L-1
static void invertLower(double[] L, int m, int offsetL)
           Inverts a square lower triangular matrix: L = L-1
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.
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.
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.
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.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockInnerTriangularSolver

public BlockInnerTriangularSolver()
Method Detail

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.
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 matrix
n - number of columns in the B matrix.
strideL - number of elements that need to be added to go to the next row in L
offsetL - initial index in L where the matrix starts
offsetB - 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 matrix
n - number of columns in the B matrix.
strideL - number of elements that need to be added to go to the next row in L
offsetL - initial index in L where the matrix starts
offsetB - 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 matrix
n - number of columns in the B matrix.
offsetL - initial index in L where the matrix starts
offsetB - 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 matrix
offsetU - initial index in L where the matrix starts
offsetB - 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 matrix
offsetU - initial index in L where the matrix starts
offsetB - initial index in B where the matrix starts


Copyright © 2012. All Rights Reserved.