Implementation of numerical algorithms from COURS L3 Pr. TEMGOUA
A comprehensive Python library implementing 10 fundamental numerical algorithms for solving linear systems, matrix decompositions, and iterative methods.
- Overview
- Installation
- Project Structure
- Algorithms Implemented
- Quick Start Guide
- Usage Examples
- Interactive Testing
- Running Tests
- User Guidelines
- References
This library provides Python implementations of classical numerical algorithms for linear algebra, based on the course material from COURS L3 Pr. TEMGOUA. All algorithms are:
- Refactored for numerical stability using machine epsilon
- Well-documented with NumPy-style docstrings
- Validated with a comprehensive unit test suite
- Optimized with NumPy vectorization while maintaining educational clarity
- Python 3.8 or higher
- NumPy
- Tabulate (for interactive results)
# Install dependencies
pip install numpy tabulate
# Verify installation
python -c "from algorithms import algo1_inverse_lower; print('OK')"numerical_algorithms/
├── README.md # Overview and installation
├── user_guideline.md # Detailed algorithm explanations and notations
├── interactive_test.py # Enhanced interactive testing interface
│
├── algorithms/ # Algorithm implementations
│ ├── __init__.py
│ ├── algo1_inverse_lower.py # Inverse of lower triangular matrix
│ ├── algo2_forward_sub.py # Forward substitution
│ ├── algo3_back_sub.py # Back substitution
│ ├── algo4_gauss_elim.py # Gauss elimination
│ ├── algo5_lu_decomp.py # LU decomposition
│ ├── algo6_cholesky.py # Cholesky decomposition
│ ├── algo7_householder_qr.py # Householder QR decomposition
│ ├── algo8_iterative_general.py # General iterative methods
│ ├── algo9_jacobi.py # Jacobi algorithm
│ └── algo10_gauss_seidel.py # Gauss-Seidel method
│
└── tests/ # Unit test suite
├── __init__.py
├── test_algo1.py ... test_algo10.py
└── test_all.py # Consolidated test runner
python interactive_test.pyThis launches a menu-driven interface using tabulate for clear output formatting.
python tests/test_all.pypython tests/test_algo1.py
python tests/test_algo9.py
# ... etc.The interactive test suite provides a user-friendly menu for testing all algorithms with your own data or example matrices.
python interactive_test.pyFor a deep dive into the mathematical notations, implementation details, and step-by-step logic of each algorithm, please refer to the user_guideline.md file.
- COURS L3 Pr. TEMGOUA - Primary source for all algorithms
- Golub, G. H., & Van Loan, C. F. (2013). Matrix Computations (4th ed.)
- Trefethen, L. N., & Bau, D. (1997). Numerical Linear Algebra
**Momeni Gilles **
This educational implementation is provided for learning purposes based on the course material from COURS L3 Pr. TEMGOUA.