This program solves a system of linear equations using two methods:
-
Gauss method:
It solves the system using the Gauss method with the choice of the leading element by row ans finds the inverse matrix. -
Reflection (Householder) method:
It decomposes the matrix into an orthogonal matrix (Q) and an upper triangular matrix (R) to solve the system via matrix factorization.
The system is represented by the equation:
Where:
-
The matrix A is defined as:
$$a_{ii} = 5i,$$ $$a_{ij} = -(i + \sqrt{j}), \quad i \neq j,$$ $$i, j = 1, N, \quad N = 15.$$ -
The vector b is defined as:
$$b_i = 3\sqrt{i}, \quad i = 1, N.$$
The matrix A and vector b are created dynamically based on these formulas.
-
Clone the repository:
git clone git@github.com:LLIEPJIOK/matrix-equations.git
-
Navigate to the project folder:
cd matrix-equations
-
Run the program:
- Run Gauss method
go run cmd/gauss/main.go
- Run Householder method
go run cmd/householder/main.go