A high-performance C library designed for dynamic matrix manipulations and advanced linear algebra operations. This project emphasizes manual memory management and efficient pointer arithmetic to handle complex mathematical transformations.
-
Dynamic Memory Allocation: Implements nested
malloccalls for row-column structuring, ensuring the program only consumes the necessary heap space for any given matrix size. -
Manual Memory Cleanup: Includes a recursive
freelogic to prevent memory leaks, maintaining system stability during large-scale computations. - Advanced Algebraic Operations: Goes beyond basic arithmetic by implementing tensor-based operations like the Kronecker Product.
-
Dimension Validation: Integrated safety checks for matrix multiplication compatibility (e.g.,
$ColsA == RowsB$ ).
- Arithmetic Suite: Robust implementation of Matrix Addition and Subtraction.
- Multiplication Variants:
- Standard Product: Classic dot product implementation for linear transformations.
- Hadamard Product: Element-wise multiplication for specific signal processing use cases.
- Kronecker Product: Implementation of the tensor product, resulting in expanded block matrices.
- Scalar Scaling: Efficient scaling of entire data structures by a constant factor.
- Interactive CLI: A structured menu-driven interface for real-time data input and result visualization.
| Operation | Complexity | Description |
|---|---|---|
| Addition/Subtraction | Basic element-wise processing. | |
| Standard Multiplication | Iterative dot product calculation. | |
| Hadamard Product | Element-wise mapping. | |
| Kronecker Product | Block matrix expansion logic. |
- A standard C compiler (GCC, Clang, or MSVC).
Build the engine using the following command:
gcc -o matrix_engine main.c