RcdMathLib_doc
Open Source Library for Linear and Non-linear Algebra
lu_decomp.c File Reference

Computes the LU decomposition of the matrix. More...

#include <float.h>
#include <stdio.h>
#include "matrix.h"
#include "vector.h"

Go to the source code of this file.

Functions

uint8_t lu_decomp (uint8_t n, matrix_t A[][n], matrix_t L[][n], matrix_t P[][n])
 Computes the LU decomposition of the matrix. More...
 

Detailed Description

Computes the LU decomposition of the matrix.

Computes the permutation matrix P such that: A = P'*L*U, where L is a lower triangular matrix and U is an upper triangular matrix. It implements the Gaussian Elimination (GE) with pivoting algorithm.

Author
Zakaria Kasmi zkasm.nosp@m.i@in.nosp@m.f.fu-.nosp@m.berl.nosp@m.in.de

Definition in file lu_decomp.c.

Function Documentation

◆ lu_decomp()

uint8_t lu_decomp ( uint8_t  n,
matrix_t  A[][n],
matrix_t  L[][n],
matrix_t  P[][n] 
)

Computes the LU decomposition of the matrix.

Computes the permutation matrix P such that: A = P'*L*U, where L is a lower triangular matrix and U is an upper triangular matrix. It implements the Gaussian Elimination with pivoting algorithm.

Note
Matrix U is stored in the matrix A.
Parameters
[in]ncolumn number of the matrix.
[in,out]A[][]pointer to the matrices A and U.
[out]L[][]pointer to the L matrix.
[out]P[][]pointer to the P matrix.
Returns
the number of changes by computing the LU decomposition.

Definition at line 31 of file lu_decomp.c.

References matrix_get_abs_max_elem_and_index_in_part_column(), matrix_get_diag_mat(), matrix_part_swap_rows(), matrix_swap_rows(), and matrix_t.

Referenced by lu_decomp_test(), and solve_lu_decomp().