Packages

class Fac_LU[MatT <: MatriD] extends Factorization with Error

The Fac_LU class provides methods to factor an 'm-by-n' matrix into its lower and upper triangular products:

A = LU when partial pivoting is not needed PA = LU where P is the permutation matrix A = QLU where Q = P.inverse

where 'a' is the given matrix, 'l' is an 'm-by-n' lower triangular matrix, and 'u' is an 'n-by-n' upper triangular matrix. The permutation matrix is represented by the 'piv' vector. Once factored, can be used to solve a system of linear equations.

Solve for x in Ax = b: Ax = QLUx = b => LUx = Pb using steps (1) and (2) (1) Solve Ly = Pb using forward substitution for y (2) Solve Ux = y using backward substitution for x

Linear Supertypes
Error, Factorization, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Fac_LU
  2. Error
  3. Factorization
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Fac_LU(a: MatT)

    a

    the given m-by-n rectangular matrix

Value Members

  1. def bsolve(y: VectoD): VectorD

    Solve for 'x' using back substitution in the equation 'u*x = y' where matrix 'u' is upper triangular.

    Solve for 'x' using back substitution in the equation 'u*x = y' where matrix 'u' is upper triangular.

    y

    the constant vector

  2. def det: Double

    Compute the determinant of matrix 'a'.

    Compute the determinant of matrix 'a'. The value of the determinant indicates, among other things, whether there is a unique solution to a system of linear equations (a nonzero determinant).

  3. def factor(): Fac_LU[MatT]

    Factor matrix 'a' into the product of 'l' and 'u'.

    Factor matrix 'a' into the product of 'l' and 'u'.

    Definition Classes
    Fac_LUFactorization
  4. def factor1(): MatriD

    Factor a matrix into the product of two matrices, e.g., 'a = l * l.t', returning only the first matrix.

    Factor a matrix into the product of two matrices, e.g., 'a = l * l.t', returning only the first matrix.

    Definition Classes
    Factorization
  5. def factor12(): (MatriD, MatriD)

    Factor a matrix into the product of two matrices, e.g., 'a = l * l.t' or a = q * r, returning both the first and second matrices.

    Factor a matrix into the product of two matrices, e.g., 'a = l * l.t' or a = q * r, returning both the first and second matrices.

    Definition Classes
    Factorization
  6. def factor2(): MatriD

    Factor a matrix into the product of two matrices, e.g., 'a = l * l.t', returning only the second matrix.

    Factor a matrix into the product of two matrices, e.g., 'a = l * l.t', returning only the second matrix.

    Definition Classes
    Factorization
  7. def factors: (MatriD, MatriD)

    Return the 'l' and 'u' matrices.

    Return the 'l' and 'u' matrices.

    Definition Classes
    Fac_LUFactorization
  8. final def flaw(method: String, message: String): Unit

    Show the flaw by printing the error message.

    Show the flaw by printing the error message.

    method

    the method where the error occurred

    message

    the error message

    Definition Classes
    Error
  9. def inverse: MatriD

    Compute the inverse of matrix 'a' from the LU Factorization.

  10. def permute(d: VectoD): VectoD

    Permute vector 'd', equivalent to 'pd', i.e., multiplying by the permutation matrix 'p'.

    Permute vector 'd', equivalent to 'pd', i.e., multiplying by the permutation matrix 'p'.

    d

    the vector to permute

  11. def permute(c: MatriD): Unit

    Permute matrix 'c', equivalent to 'qc', i.e., multiplying by the inverse of the permutation matrix 'p'.

    Permute matrix 'c', equivalent to 'qc', i.e., multiplying by the inverse of the permutation matrix 'p'.

    c

    the matrix to permute

  12. def rank: Int

    Return the rank (number of independent columns) of 'm-by-n' matrix 'a', by counting the number of non-zero diagonal elements in 'u'.

    Return the rank (number of independent columns) of 'm-by-n' matrix 'a', by counting the number of non-zero diagonal elements in 'u'. If 'rank < n', then 'a' is singular.

    See also

    Fac_QR_RR or SVD

    en.wikipedia.org/wiki/Rank_%28linear_algebra%29

  13. def solve(b: VectoD): VectoD

    Solve for 'x' in the equation 'l*u*x = b' via 'l*y = b' and 'u*x = y'.

    Solve for 'x' in the equation 'l*u*x = b' via 'l*y = b' and 'u*x = y'. Return the solution vector 'x'.

    b

    the constant vector

    Definition Classes
    Fac_LUFactorization
  14. def split(): Unit

    Split 'l' into lower and upper triangular matrices by placing the upper portion in 'u' and clearing, so 'l' is properly lower triangular.