org.ejml.alg.dense.decomposition
Class TriangularSolver

java.lang.Object
  extended by org.ejml.alg.dense.decomposition.TriangularSolver

public class TriangularSolver
extends Object

This contains algorithms for solving systems of equations where T is a non-singular triangular matrix:

T*x = b

where x and b are vectors, and T is an n by n matrix. T can either be a lower or upper triangular matrix.

These functions are designed for use inside of other algorithms. To use them directly is dangerous since no sanity checks are performed.

Author:
Peter Abeles

Constructor Summary
TriangularSolver()
           
 
Method Summary
static void invertLower(double[] L, double[] L_inv, int m)
           
static void invertLower(double[] L, int m)
           Inverts a square lower triangular matrix: L = L-1
static void solveL(double[] L, double[] b, int n)
           Solves for non-singular lower triangular matrices using forward substitution.
static void solveL(double[] L, double[] b, int m, int n)
          L is a m by m matrix B is a m by n matrix
static void solveTranL(double[] L, double[] b, int n)
           This is a forward substitution solver for non-singular lower triangular matrices.
static void solveU(double[] U, double[] b, int n)
           This is a forward substitution solver for non-singular upper triangular matrices.
static void solveU(double[] U, double[] b, int sideLength, int minRow, int maxRow)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TriangularSolver

public TriangularSolver()
Method Detail

invertLower

public static void invertLower(double[] L,
                               int m)

Inverts a square lower triangular matrix: L = L-1

Parameters:
L -
m -

invertLower

public static void invertLower(double[] L,
                               double[] L_inv,
                               int m)

solveL

public static void solveL(double[] L,
                          double[] b,
                          int n)

Solves for non-singular lower triangular matrices using forward substitution.
b = L-1b

where b is a vector, L is an n by n matrix.

Parameters:
L - An n by n non-singular lower triangular matrix. Not modified.
b - A vector of length n. Modified.
n - The size of the matrices.

solveL

public static void solveL(double[] L,
                          double[] b,
                          int m,
                          int n)
L is a m by m matrix B is a m by n matrix

Parameters:
L -
b -
m -
n -

solveTranL

public static void solveTranL(double[] L,
                              double[] b,
                              int n)

This is a forward substitution solver for non-singular lower triangular matrices.
b = (LT)-1b

where b is a vector, L is an n by n matrix.

L is a lower triangular matrix, but it comes up with a solution as if it was an upper triangular matrix that was computed by transposing L.

Parameters:
L - An n by n non-singular lower triangular matrix. Not modified.
b - A vector of length n. Modified.
n - The size of the matrices.

solveU

public static void solveU(double[] U,
                          double[] b,
                          int n)

This is a forward substitution solver for non-singular upper triangular matrices.
b = U-1b

where b is a vector, U is an n by n matrix.

Parameters:
U - An n by n non-singular upper triangular matrix. Not modified.
b - A vector of length n. Modified.
n - The size of the matrices.

solveU

public static void solveU(double[] U,
                          double[] b,
                          int sideLength,
                          int minRow,
                          int maxRow)


Copyright © 2011. All Rights Reserved.