https://github.com/anvaymayekar/mega-matrix-mania
Mega Matrix Mania is a C-based program for performing key matrix operations like determinant, inverse, rank, scalar multiplication, and more. It includes strong input validation, modular structure, cross-platform compatibility, and a styled terminal interface.
https://github.com/anvaymayekar/mega-matrix-mania
algorithms c logic math matrix programming
Last synced: 8 months ago
JSON representation
Mega Matrix Mania is a C-based program for performing key matrix operations like determinant, inverse, rank, scalar multiplication, and more. It includes strong input validation, modular structure, cross-platform compatibility, and a styled terminal interface.
- Host: GitHub
- URL: https://github.com/anvaymayekar/mega-matrix-mania
- Owner: anvaymayekar
- License: mit
- Created: 2025-07-05T14:24:35.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-05T19:59:23.000Z (12 months ago)
- Last Synced: 2025-07-20T20:16:48.367Z (11 months ago)
- Topics: algorithms, c, logic, math, matrix, programming
- Language: C
- Homepage:
- Size: 134 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐งฎ **Mega Matrix Mania** โ Advanced Terminal Matrix Calculator in C
A robust matrix manipulation program written in **pure C**, designed to perform essential and advanced linear algebra operations including determinant, inverse, rank, row echelon form, scalar multiplication, and more โ right from your terminal interface with **safety-first input mechanisms** and **vibrant ANSI-styled output**.
> ๐ ๏ธ This project was developed as a part of **B.Tech (Engineering)** coursework at **Shah & Anchor Kutchhi Engineering College**, Mumbai by **Anvay Mayekar** for subject **Problem Solving and Programming with C** **(FE - Sem II)**, with a focus on modular design, efficient matrix handling, and real-world C programming principles.
---
## ๐ Highlights & Safety Notes
> โ ๏ธ All input is thoroughly validated via dedicated functions (`get_choice`, `get_scalar`) that prevent segmentation faults, malformed input like `3..3`, alphabets, or overflow issues.
> ๐ง All floating-point values are **truncated with a warning**, not rounded.
> ๐ **Row Echelon Form** logic is **purely iterative** โ no recursion used, ensuring memory safety and performance.
> ๐ฅ๏ธ Terminal outputs are color-coded for better readability.
> ๐ก **Tip:** For operations on larger matrices, increase the value of `MAX` in [`utils.h`](./utils.h).
---
## ๐ File Structure
```
mega-matrix-mania/
โโโ header/ # ๐ All header files (function prototypes, macros)
โ โโโ io.h # โ๏ธ Input/Output function declarations
โ โโโ proto.h # ๐ Unified prototype header for all functions
โ โโโ title.h # ๐ผ๏ธ Title art and splash screen
โ โโโ utils.h # ๐จ Macros: ANSI colors, delays, matrix size
โ
โโโ src/ # โ๏ธ Source code implementation
โ โโโ io.c # ๐ข Handles matrix input/output operations
โ โโโ matrix.c # ๐งฎ Core matrix functions (det, adj, inv, rank, etc.)
โ
โโโ main.c # ๐ง Program entry point with menu logic
โโโ mega-matrix-mania.exe # ๐ฉ Windows executable (compiled binary)
โโโ README.md # ๐ Project overview and usage instructions
```
---
## โ๏ธ Features & Operations
### โ
Supported Matrix Operations
| Option | Operation |
| ------ | --------------------- |
| 0 | Change Matrix Order |
| 1 | Display Matrix |
| 2 | Transpose |
| 3 | Scalar Multiplication |
| 4 | Matrix Multiplication |
| 5 | Determinant |
| 6 | Adjoint |
| 7 | Inverse |
| 8 | Identity Check |
| 9 | Cofactor Matrix |
| 10 | Row Echelon Form |
| 11 | Rank |
| 12 | Exit |
---
## ๐งฐ Tools & Technologies Used





---
## ๐งฑ C Libraries Used
```c
#include
#include
#include
#include
#include
#include // for UNIX
```
> โ ๏ธ No external libraries used. All logic is handwritten in standard ANSI C.
---
## ๐ Input Safety Features
โ๏ธ **get\_choice()**
โ Accepts 1 or 2 inputs like `3` or `3 3`
โ Rejects alphabets, symbols, and malformed input (`3..2`)
โ Provides truncation warnings for decimals (e.g., `2.7` โ `2`)
โ Validates value range (`1โ10`) or custom via `del` variable
โ๏ธ **get\_scalar()**
โ Accepts any real number input (e.g., `-2.5`, `0`, `123`)
โ Rejects invalid or non-numeric entries safely
โ๏ธ **input\_matrix()**
โ Only triggered after valid dimension entry
โ Ensures each matrix element is a valid number (float)
โ๏ธ **Row Echelon**
โ Uses pure **iteration**, not recursion, for efficiency and safety
---
## ๐งพ Compilation Instructions
### ๐ช On Windows:
```bash
gcc -Iheader main.c src/io.c src/matrix.c -o mega-matrix-mania
```
```bash
mega-matrix-mania.exe
```
### ๐ง On Linux/macOS:
```bash
gcc -Iheader main.c src/io.c src/matrix.c -o mega-matrix-mania
```
```bash
./mega-matrix-mania
```
> ๐ง Make sure `gcc` is installed. Use `sudo apt install gcc` (Linux) or MinGW (Windows).
---
## ๐ผ๏ธ Output Sample
```
=== Matrix Operations ===
1. Display Matrix
2. Transpose
...
12. Exit
Choice: 5
Enter matrix order (n): 3
Enter matrix elements:
[1 2 3]
[0 1 4]
[5 6 0]
Determinant: 1.00
```
---
## โ๏ธ License
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT).
You are free to use, modify, and distribute this software with proper attribution.
---
## ๐จโ๐ป Author
> **Anvay Mayekar**
> ๐ B.Tech in Electronics & Computer Science โ SAKEC
>
>[](https://www.github.com/anvaymayekar)
[](https://in.linkedin.com/in/anvaymayekar)
[](https://www.instagram.com/anvaymayekar)
---