Small school project focused on matrix algebra
- C 95.3%
- NewLisp 2.6%
- CMake 1.4%
- Perl 0.7%
| doc | Some additional fixes in doc. | |
| res | [FIX] small typo in check inside of main.c | |
| src | [FIX] small typo in check inside of main.c | |
| .gitignore | finished most of lang, fixed the adjugate and inverse, as well as memory leaks | |
| CMakeLists.txt | Prettification and some cleanup. | |
| more.pl | [FIX] found leak in fraction string length calculation, used numerator twice, no denominator. :) | |
| README.md | Readme modification. | |
| valgrind-log.txt | [FIX] small typo in check inside of main.c | |
malg
A semester work, focusing on matrix algebra with fractions and a bit of text processing.
Building
Project is build by CMake.
mkdir build
cd build
# TODO: add the rest
cd ..
./build/malg #run from project root
Usage
To get the basic help message run:
malg
Syntax
Syntax is heavily inspired by Lisp and each expression follows same format.
(keyword parameter1 parameter2 ...)
Currently implemented keywords:
matrix- matrix creationmcpy- create a copy of a matrixmcpysx- create a submatrix from a matrix (exclude 1 row and 1 column)madd- matrix additionmsub- matrix subtractionmul- matrix multiplied by scalarmdiv- matrix divided by scalarmmul- matrix multiplicationmpow- matrix to powerminv- inverse matrixmadj- adjugate matrixmtrans- transpose matrixmdet- determinantmrech- matrix to row echelon formsize- 2D sizedata- array of fractionsprint- print supported data
Whenever a word is parsed, it is first checked against a list of known keywords, then it is checked against matrix names. If no match is found, it is considered to be just word.
Some types may get converted to a diferrent data type based on the currently executed expression.
Documentation
Documentation can be found in doc/. One may build it themselves with makefile or just download the .pdf, although it may not be updated.