-
Notifications
You must be signed in to change notification settings - Fork 23
/
linear_system.h
45 lines (44 loc) · 2.56 KB
/
linear_system.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/****************************************************************************
* ArtraCFD *
* <By Huangrui Mo> *
* Copyright (C) Huangrui Mo <[email protected]> *
* This file is part of ArtraCFD. *
* ArtraCFD is free software: you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
****************************************************************************/
/****************************************************************************
* Header File Guards to Avoid Interdependence
****************************************************************************/
#ifndef ARTRACFD_LINEAR_SYSTEM_H_ /* if undefined */
#define ARTRACFD_LINEAR_SYSTEM_H_ /* set a unique marker */
/****************************************************************************
* Required Header Files
****************************************************************************/
#include "commons.h"
/****************************************************************************
* Data Structure Declarations
****************************************************************************/
/****************************************************************************
* Public Functions Declaration
****************************************************************************/
/*
* Linear System Solver in Matrix Form
*
* Function
* General matrix linear system solver for AX = B.
* Dimension of A is n x n; dimension of X and B is n x m;
* A is the system matrix, X is the solution matrix with each column vector
* stands for a solution vector of a single linear system A * x = b, B is
* the right hand matrix with each column vector stands for a right hand
* vector of a single linear system. If B is a unit matrix, then solution
* matrix X is the inverse matrix of A. In practice, right hand matrix
* and solution matrix can share the same storage even they are declared
* as restricted pointers here. The matrix A will be transformed into
* its LU decomposition.
*/
extern int SolveLinearSystem(const int n, Real A[restrict][n],
const int m, Real X[restrict][m], Real B[restrict][m]);
#endif
/* a good practice: end file with a newline */