An open API service indexing awesome lists of open source software.

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.

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](https://img.shields.io/badge/C_language-00599C?style=for-the-badge\&logo=c\&logoColor=white)
![GCC](https://img.shields.io/badge/GCC-gnu%20compiler-blue?style=for-the-badge\&logo=gnu\&logoColor=white)
![Windows](https://img.shields.io/badge/Windows-Supported-blue?style=for-the-badge\&logo=windows\&logoColor=white)
![Linux](https://img.shields.io/badge/Linux-Compatible-yellowgreen?style=for-the-badge\&logo=linux\&logoColor=white)
![ANSI Terminal](https://img.shields.io/badge/Terminal-ANSI_Colors-lightgrey?style=for-the-badge)

---

## ๐Ÿงฑ 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
>
>[![GitHub](https://img.shields.io/badge/GitHub-181717.svg?style=for-the-badge\&logo=GitHub\&logoColor=white)](https://www.github.com/anvaymayekar)
[![LinkedIn](https://img.shields.io/badge/LinkedIn-0A66C2.svg?style=for-the-badge\&logo=LinkedIn\&logoColor=white)](https://in.linkedin.com/in/anvaymayekar)
[![Instagram](https://img.shields.io/badge/Instagram-%23E4405F.svg?style=for-the-badge\&logo=Instagram\&logoColor=white)](https://www.instagram.com/anvaymayekar)

---