Git Product home page Git Product logo

matrixsolver's Introduction

MatrixSolver

What Do It?

You guessed right! - It solves matrices! This implements a basic college pre-calculus algorthim of solving matrices using two recursive functions.

How to Do It?

Compile the thing

There is a build script build.sh Run the following

chmod +x build.sh
./build.sh

This will generate class code in a build/matrixsolver/ directory. It will also generate a jar file in the build/ directory. This jar file can then be run with the following command.

cd build
java -jar Solver.jar

Note that if a build already exists it will be moved into a directory old_build/

You can also move the entire matrixsolver folder into the src/ folder of a NetBeans project and use NetBeans to build and run.

Run it

The main program has a basic CLI. It will give you a few options:

Application mode? (0 - normal, 1 - inverse, 2 - solve for variables): ??

Enter 0 to solve any matrix so long as it has more columns than rows. Enter 1 to solve for the inverse matrix which requires twice as many columns as rows. Enter 2 to solve for variables (x, y, z, etc...) Which requires one more row than column.

How many rows in the matrix?: ??
How many columns in the matrix?: ??

Fill in when asked. Depending on the first input it may or may not ask for both but may auto fill in according to the requirements. If you give a combination that does not satisfy the row/column requirements the program will stop/

Generate random numbers to fill? (y/n): ??
Be verbose? (y/n): ??

Instead of filling in numbers you can choose to have the matrix filled randomly. It's kinda fun to generate a huge matrix randomly and watch it solve. If you select be verbose the solver will print every step of the solve. If you do not select verbose it will print out the initial matrix and the solved matrix. If you do not select random numbers you will need to fill in the matrix. It will prompt you to fill it in row by row, from left to right. It will ask for the top row, then the second, to the bottom.

Notes

Using Windows

The build script is catered for linux and macOS. If you need to run on windows open build.sh and run the commands at the bottom, javac and jar, which should be able to run in windows. Make sure the jar command is executed in the build directory otherwise it will not be able to find the main class.

ToDo

Add comments, make code prettier.

matrixsolver's People

Contributors

joshs333 avatar

Watchers

James Cloos avatar  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.