LU decomposition and direct solver for small dense matrices.
More...
#include <math.h>
#include "fasp.h"
#include "fasp_functs.h"
Go to the source code of this file.
LU decomposition and direct solver for small dense matrices.
Definition in file lu.c.
LU decomposition of A usind Doolittle's method.
 Parameters

A  Pointer to the full matrix 
pivot  Pivoting positions 
n  Size of matrix A 
 Returns
 FASP_SUCCESS if successed; otherwise, error information.
 Note
 Use Doolittle's method to decompose the n x n matrix A into a unit lower triangular matrix L and an upper triangular matrix U such that A = LU. The matrices L and U replace the matrix A. The diagonal elements of L are 1 and are not stored.

The Doolittle method with partial pivoting is: Determine the pivot row and interchange the current row with the pivot row, then assuming that row k is the current row, k = 0, ..., n  1 evaluate in order the following pair of expressions U[k][j] = A[k][j]  (L[k][0]*U[0][j] + ... + L[k][k1]*U[k1][j]) for j = k, k+1, ... , n1 L[i][k] = (A[i][k]  (L[i][0]*U[0][k] + . + L[i][k1]*U[k1][k])) / U[k][k] for i = k+1, ... , n1.
 Author
 Xuehai Huang
 Date
 04/02/2009
Definition at line 46 of file lu.c.
Solving Ax=b using LU decomposition.
 Parameters

A  Pointer to the full matrix 
b  Right hand side array 
pivot  Pivoting positions 
x  Pointer to the solution array 
n  Size of matrix A 
 Returns
 FASP_SUCCESS if successed; otherwise, error information.
 Note
 This routine uses Doolittle's method to solve the linear equation Ax = b. This routine is called after the matrix A has been decomposed into a product of a unit lower triangular matrix L and an upper triangular matrix U with pivoting. The solution proceeds by solving the linear equation Ly = b for y and subsequently solving the linear equation Ux = y for x.
 Author
 Xuehai Huang
 Date
 04/02/2009
Definition at line 117 of file lu.c.