UCFD_SPARSE  v1.1
Documentation
Loading...
Searching...
No Matches
inverse.c File Reference

Compute matrix inverse using LU Decomposition, and forward/backward substitution. More...

#include "inverse.h"
Include dependency graph for inverse.c:

Go to the source code of this file.

Functions

void ludcmp (int n, UCFD_FLOAT A[n][n])
 LU Decomposition function. More...
 
void lusub (int n, UCFD_FLOAT LU[n][n], UCFD_FLOAT *b)
 Forward/Backward Substitution function. More...
 

Detailed Description

Compute matrix inverse using LU Decomposition, and forward/backward substitution.

======================================================================================================================

This file contains LU Decomposition function and substitution function.

         (1) LU Decomposition : ludcmp  
         Decompose the input matrix A by Lower/Upper triangular matrix.  
         A = LU  

         (2) Substitution : lusubst  
         Solve Ax = b by using forward/backward substitution.  
         Input vector `b` is overwritten with the solution vector `x`.  
Note
Input matrix must be the n-by-n square matrix, and Row-major format.
Each function treats target matrix as a one-dimensional array.
Author
Date
Nov 2024
Version
1.0
Copyright
Copyright (c) 2024, Namhyoung Kim and Jin Seok Park, Inha University, All rights reserved.
License
This project is release under the terms of the MIT License (see LICENSE file).

Definition in file inverse.c.

Function Documentation

◆ ludcmp()

void ludcmp ( int  n,
UCFD_FLOAT  A[n][n] 
)

LU Decomposition function.

Decompose matrix A into lower and upper triangular matrix

Definition at line 37 of file inverse.c.

◆ lusub()

void lusub ( int  n,
UCFD_FLOAT  LU[n][n],
UCFD_FLOAT b 
)

Forward/Backward Substitution function.

This function performs Forward/Backward substitution of LU decomposed matrix.

Definition at line 74 of file inverse.c.