Skip to content

Latest commit

 

History

62 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Matrix Calculator

A C/Assembly hybrid matrix calculator program supporting basic operations like Addition, Subtraction, Multiplication, Determinant, and Transpose.

Prerequisites

Before running the program, ensure you have the following installed:

  • GNU Compiler Collection (GCC)
    gcc -v
  • Make (GNU Make)
    make -v
    (Note: On Linux, make is usually pre-installed. On Windows, you can use MinGW or MSYS2)

Building and Running

The project comes with a Makefile that supports both Linux and Windows automatically.

  • To compile the program:
    make
  • To run the program:
    make run
  • To clean up compiled files:
    make clean
  • To run tests:
    make test

📖 Tutorial: How to Use the Program

When you run the program (make run), you will be presented with interactive menus. You can navigate these menus using your Arrow Keys (Up/Down) and press Enter to make a selection.

1. Choosing the Input Method

You can choose to input your matrices via the console manually or read them from a file.

Option A: Console Input

If you select console, the program will ask you step-by-step:

  1. How many matrices you want to input.
  2. For each matrix, its dimensions (rows and columns).
  3. The elements of the matrix row by row.

Option B: File Input (Recommended for large matrices)

If you select file, the program will automatically read from a file named input.txt located in the root directory of the project.

How to format input.txt: The format must strictly follow:

  1. The total number of matrices (e.g., 2).
  2. For each matrix:
    • The number of rows and columns separated by a space (e.g., 2 2).
    • The values of the matrix (can be separated by spaces or newlines).

Example input.txt (Two 2x2 matrices):

2
2 2
1.0 2.0
3.0 4.0
2 2
5.0 6.0
7.0 8.0

2. Choosing the Operation

After providing the matrices, you will be prompted to select an operation to perform:

  • Addition (Requires 2 matrices of the same dimensions)
  • Subtraction (Requires 2 matrices of the same dimensions)
  • Multiplication (Requires matrices with compatible dimensions)
  • Determinant (Requires a square matrix)
  • Transpose (Requires 1 matrix)
  • Inverse (Coming soon...)
  • Exit

3. Choosing the Output Method

Finally, choose how you want to see the result:

  • Console: Prints the resulting matrix or determinant value directly to your screen.
  • File: Saves the result to a file named output.txt in the root directory.

Note: If output.txt already exists, it will be overwritten.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages