Skip to content

Latest commit

 

History

History
58 lines (46 loc) · 1.24 KB

README.md

File metadata and controls

58 lines (46 loc) · 1.24 KB

Matrix equations

Project Description

This program solves a system of linear equations using two methods:

  1. Gauss method:
    It solves the system using the Gauss method with the choice of the leading element by row ans finds the inverse matrix.

  2. 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:

$$A \cdot x = b$$

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.


Installation

  1. Clone the repository:

    git clone git@github.com:LLIEPJIOK/matrix-equations.git 
  2. Navigate to the project folder:

    cd matrix-equations 
  3. Run the program:

    • Run Gauss method
    go run cmd/gauss/main.go  
    • Run Householder method
    go run cmd/householder/main.go