Skip to content

Matrix_h hosts a fast, efficient and easy to use C linear algebra library

License

Notifications You must be signed in to change notification settings

prithvitewatia/matrix_h

Repository files navigation

Libmatrix

Libmatrix is a fast, efficient and easy to use C linear algerbra library.
Documentation Status License: MIT Contributor Covenant

MOTIVATION

This project was started to develop a linear algebra library written in the C programming language that is simple and easy to use without reducing the performance of the code

KEY FEATURES

  • Simple and easy to use
  • Fast and memory efficient
  • No explicit pointers
  • Error detection

INSTALLATION

Clone the repository into your computer by executing the following command in the terminal

git clone https://github.com/prithvitewatia/matrix_h

cd in the the repository

cd matrix_h

Run the following command

make libmatrix.a

If everything runs fine you will see files libmatrix.a and matrix.o generated in the directory. If not please make sure that you have gcc and make installed and set on the PATH. Link to
gcc: gcc
make: make

Congrats your library is now generated

Usage

  • Copy the matrix.h file and libmatrix.a to your project folder.
  • Include the library in your C file by using the include directive
#include "matrix.h"
  • To build your C file execute the command
gcc yourCfile.c  -L . -lmatrix -o yourOutputfile
  • Run your file by
./yourOutputfile

Happy coding!

EXAMPLES

A program to add to matrices and check if the result is equal to third matrix. example

The output of the above program example

Here is another example in which we calculate rank and determinant. example

Here is its output example

For official documentation visit matrix-h documentation

CAUTION

  • If x and y are two matrices do not use statements such as x=y to copy the contents of y into x. Rather use x=copy_matrix(y) to copy the contents. This is because statement x=y will make the references of x and y same and hence further changes in y will lead to changes in x.
  • Also since floating point numbers are not infinitely precise therefore ieee has two representation of number 0 ie 0 and -0 . This is not a bug. This is just a way of representation in which no information is lost.

FEEDBACK AND SUGGESTIONS

This library is still under development . Write your queries to prithvisinghtewatia@gmail.com