1
0
forked from leto/LeMA
2024-12-23 22:15:20 +01:00
2024-12-23 18:40:43 +01:00
2024-12-23 21:43:32 +01:00
2024-12-23 21:52:51 +01:00
2024-12-23 22:15:20 +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.

Getting Started

Installation

  1. Clone or download the repository.

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

    #include "lema.h"
    

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

Example Usage

Creating a Matrix

#include "lema.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 "lema.h"
#include <iostream>

int main() {
    Matrix a(2,2);
    Matrix b(2,2);

    a.Set(2.0F); // Fill both matrices
    b.Set(3.0F);

    a.Add(&b);

    a.Print("A + B");
    return 0;
}

Matrix Multiplication

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

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

    Matrix result = a.Multiply(&b);

    result.Print("A x B");

    return 0;
}

Contributing

Contributions are welcome. If you find a bug or have a feature request, feel free to open an issue or submit a pull request.

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%