This repository contains a Python script for performing LU decomposition on a given matrix. LU decomposition is a method of factorizing a matrix into a product of a lower triangular matrix (L) and an upper triangular matrix (U). The script allows you to input a matrix through various methods, perform LU decomposition, and display or save the results.
-
Run the script and choose the input mode:
- File: Load matrix from a file.
- Input: Manually input matrix elements.
- Default Matrix: Use a predefined 3x3 matrix.
-
Choose the decomposition method:
- Without Economic Storage: Decompose the matrix without optimizing storage.
- With Economic Storage: Optimize storage during decomposition.
-
View or Save Results:
- View the results in the terminal.
- Save the results to an output.txt file.
python lu_decomposition.py