This program is a C program that performs various operations on square matrices. The basic features of the program and usage instructions are described below.
-
Initialization:
- The program starts by prompting the user to enter the size of a square matrix (
matrix_size
).
- The program starts by prompting the user to enter the size of a square matrix (
-
Matrix Creation:
- The user is given the option to manually input matrix elements or fill them with random values within a specified range.
-
Conversion to Upper Triangular Matrix:
- The
upperTriangularize
function converts the input matrix to an upper triangular form.
- The
-
Printing Matrices to Screen:
- The
printMatrix
function prints the original matrix and the upper triangular matrix to the screen.
- The
-
Determinant Calculation:
- The
calcDet
function calculates the determinant of the upper triangular matrix.
- The
-
Solving Equations using Cramer's Method:
- The
solveUsingCramer
function solves equations using Cramer's method and prints the results to the screen.
- The
-
Calculating Matrix Trace and Taking Transpose:
- The program calculates the matrix trace and takes the transpose of the matrix, printing the results to the screen.
-
Memory Cleanup:
- The program releases memory used to prevent memory leaks.
To use the project, you can follow these steps:
- Clone the repository:
git clone https://github.com/akyurekridvan2101/Matrix-tool-kit.git
- Navigate to the project directory:
cd MATRIX-TOOL-KIT/"Matrix tool kit"
- Compile the program:
gcc matrixToolKit.c -o matrix_tool_kit
- Run the program:
./matrix_tool_kit
matrix_3.mp4
This program includes a warning that there may be overflows in long int
size when matrix dimensions or elements are too large. Especially when working with values exceeding the long int
size, correct results may not be obtained.
When matrix dimensions or elements are very large, it may be more reliable to keep the matrix size and elements as small as possible rather than relying on the results of the program. Additionally, it's important to carefully verify the inputs and outputs of the program.
If a matrix's size or elements are too large and unexpected results are obtained, reducing the matrix size and elements or solving the problem with a different method may correct this situation.