1
0
forked from leto/LeMA
2024-12-30 21:45:51 +01:00
2024-12-30 21:45:51 +01:00
2024-12-27 23:41:16 +01:00
2024-12-24 14:36:00 +01:00

LeMA : Matrices simply

LeMA (short for "Leto Matrix") is a lightweight C++ header-only library designed to simplify matrix manipulation. LeMA will eventually be used for graphical and machine learning usage in my other projects.

Features

  • Lightweight: Just a single header file.
  • Easy to Use: Intuitive functions.
  • Somewhat complete: Supports addition, subtraction, multiplication, and more.
  • Ready to Integrate: Designed to work seamlessly with C++ code.
  • Not a movie: Is not about the 1999 hit movie by the Wachowski transexual sisters.

Getting Started

Installation

  1. Clone or download the repository.

    git clone https://git.letonet.fr/leto/lema.git
    
  2. Include the matrices.h file in your project.

    #include "matrices.h"
    

That's it! You're ready to use LeMA.

Example Usage

Creating a Matrix

#include "matrices.h"
#include <iostream>

int main() {
    Matrix mat(3, 2); // Create a 3 rows, 2 columns matrix
    mat.Print("Weights"); // LeMA can print matrices in terminal for easy debugging
    return 0;
}

Matrix Addition

#include "matrices.h"

int main() {
    Matrix a(2,2);
    a.Set(2.0F); // Fill A with 2s
    
    Matrix b = a;
    Matrix result = a + &b; // Basic operations are possible with pointers

    result.Print("A + B"); // Is full of 4s !
    return 0;
}

Matrix Multiplication

#include "matrices.h"

int main() {
    Matrix a(3, 3);
    Matrix b(3, 1); // Let's multiply by a vector

    Matrix result = a * &b;

    result.Print("A x B"); // Result is a 3 by 1 vector

    return 0;
}

Contributing

Contributions are welcome. This git server is mostly private but still accepts account creation upon request. Contact me anywhere about an account and git permissions.

License

This project is licensed under the https://en.wikipedia.org/wiki/WTFPL Licence.


Happy coding with LeMA.

Description
No description provided
Readme 61 KiB
Languages
C++ 100%