By: Zohaib Muhammad University of Engineering & Technology (UET) Lahore, Pakistan. Contact: engr.mz@hotmail.com
Thanks to @Davide Faconti (facontidavide) for his guidance.
No pointers are used, which reduces errors possibility due to dangling pointers or memory leaks. On backend, complete implementation is in 1D. However, to user it looks like a 2D matrix. Therefore it is a memory efficient implementation that take real scenarios into account.
The Matrix class has been created using C++ in Microsoft Visual Studio 2013. Please download complete repository for test. The file matrix.h can be utilized as a source code (matrix library). It can help is finding the followings;
- Inverse of a matrix
- Determinant of a Matrix
- Minor of a matrix
- Transpose of a matrix
- Matrix multiplication
Remaining functionalities will be added soon.
-
You can open the file "Matrix Library.sln" in Visual Studio project. It will show two files "Matrix.h" and "main.cpp". Write a code in main.cpp and call functions provided in Matrix.h.
-
Copy "Matrix.h" into your directory. Include the header file "Matrix.h" and use the member functions.
The code can be used in Ubuntu environment using G++. The Valgrind can help in checking memory leaks. See the link for Valgrind help in Ubuntu environment.
Valgrind Link: https://www.youtube.com/watch?v=pXIZ66_MsMQ&t=65s