Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple linear algebra library

1. features

  • matrix (and vector) ADT
  • matrix linear algebra functions
  • complex matrix operations (determinant, REF, etc..)

2. example of use

#include "matrix.h"

int main()
{
    /* heap-allocate */
    Matrix m1 = emptyMatrix(1, 3);

    /* 
     * use an array of matrix elements `mel`
     * to change a specified row 
     */
    mel arr1[] = {1, 0, -1};
    matrixChangeRow(&m1, arr1, 0);

    /* or */

    /*
     * create a `Matrix` from a flat array
     */
    mel arr2[] = {2, 0, -3, 5, 6, 0, 1, 2, 0};
    Matrix m2 = defineMatrix(arr2, 3, 3);

    printMatrix(m1);
    printf("\n");
    printMatrix(m2);

    /* deallocate */
    freeMatrix(m1);
    freeMatrix(m2);

    return 0;
}

expected print output:

{   1.00   0.00  -1.00   }

{   2.00   0.00  -3.00   }
{   5.00   6.00   0.00   }
{   1.00   2.00   0.00   }

3. notes

  • My first side project while learning C as my first programming language.
  • This is mainly a learning project, the library is not battle tested and not really intended for real use.

About

A simple linear algebra library written in C

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages