-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathgauss_solve.h
31 lines (25 loc) · 860 Bytes
/
gauss_solve.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
/*----------------------------------------------------------------
* File: gauss_solve.h
*----------------------------------------------------------------
*
* Author: Marek Rychlik ([email protected])
* Date: Sun Sep 22 15:40:51 2024
* Copying: (C) Marek Rychlik, 2020. All rights reserved.
*
*----------------------------------------------------------------*/
#ifndef GAUSS_SOLVE_H
#define GAUSS_SOLVE_H
/* An idiomatic way to swap two l-values X and Y of type TYPE in C
Example:
int x = 1; int y = 2; SWAP(x, y, int);
Now x==2 and y==1.
*/
#define SWAP(X, Y, TYPE) do { \
TYPE tmp = (X); \
(X) = (Y); \
(Y) = tmp; \
} while(0)
void gauss_solve_in_place(const int n, double A[n][n], double b[n]);
void lu_in_place(const int n, double A[n][n]);
void lu_in_place_reconstruct(int n, double A[n][n]);
#endif