Giter Club home page Giter Club logo

matrix-calculator's Introduction

Matrix-Calculator

Programmed a calculator that computes matrix expressions such as addition, multiplication, and transposition.

Description

When working with matrices, students often have to spend lots of time evaluating the entire expression. Hence, to help students with their assignments, this program permits users to enter the matrix problems in a text file, which would be scanned and evaluated. This program could solve order operations involving addition, multiplication, and transposition. Every time the program creates a new matrix or solves an expression, it adds the result to a matrix binary search tree. The program prints out the solution of the latest expression when it reaches the end of the file.

Notes/Warnings:
  • Lines in the text file must not contain leading spaces
  • Matrix name can only be an alphabetical letter
  • Each matrix creation or expression in the text file must be written in the following format:
    • Matrix Creation: [matrix name] = [number of rows] [number of columns] [elements listed in row-major format and enclosed with brackets]
    • Example: A = 3 3 [1 2 3; 4 5 6; 7 8 9;]
    • Matrix Expression: [matrix name] = [expression]
    • Example: C = A + B
  • Excluding all blank lines, the last line of the text file must not be a matrix creation

Get Started

Dependencies

Installing

Reference: https://docs.github.com/en/get-started/quickstart/fork-a-repo
  1. Fork this repository by clicking the Fork button located on the top of the page
  2. Navigate to "Your Repositories" on GitHub and open the forked repo
  3. In the terminal, git clone the repo using the URL or SSH key

Executing Program

Run with makeFile:

In the terminal, type make and make test to run the test cases written in unit_tests.c. Individuals may use the existing code as an example and write their test cases.

Note: To run your test cases, include your input file in tests.in and the expected output in tests.out.exp.

Run with GCC:

In the terminal, type gcc [source file]. By default, this will produce an executable file named a.out (Linux) or a.exe (Windows). If you want the executable file to have a custom name, type gcc -o [name of the executable] [source file]. After compiling the program, run the executable file by entering ./[executable file] [input file].

Author

Zhen Wei Liao - @Zhen
Builts the main program and parts of MatrixCalc.h/unit_test.c.

Contributor:

Professor Kevin McDonnell - @KevinMcDonnell
Builts the majority of unit_tests.c, unit_tests.h, makeFile, and .gitignore.

License

This project is under the MIT License.
Please check the LICENSE.md file for more information.

matrix-calculator's People

Contributors

zhen69 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.