Crates.io | mini-matrix |
lib.rs | mini-matrix |
version | 0.1.6 |
source | src |
created_at | 2024-08-05 15:17:58.078606 |
updated_at | 2024-08-13 20:32:44.438325 |
description | A mini linear algebra library implemented in Rust. |
homepage | |
repository | |
max_upload_size | |
id | 1326159 |
size | 4,167,724 |
This project is a Rust library for basic linear algebra operations, including vector and matrix manipulations. It provides functionalities to perform various exercises related to vectors and matrices.
The crate is currently on version 0.1.5.
The main
function allows you to run different exercises based on a command-line argument specifying the exercise number.
To run a specific exercise, use the following command:
cargo run <exercise_number>
mini_matrix
is a lightweight linear algebra library written in Rust, designed to provide fundamental matrix and vector operations without heavy external dependencies. This project serves as an introduction to both Rust programming and linear algebra concepts, specifically tailored as a learning exercise from the 42 cursus.
Contributions are welcome! Please see the contribution guidelines for more details.
This project is implemented using Rust, a systems programming language known for its performance and safety features.
You can find the documentation for this project docs.
The library is most easily used with cargo. Simply include the following in your Cargo.toml
file:
[dependencies]
num = "0.4.3"
or use the following command:
cargo add mini_matrix
And then import the library using:
#[macro_use]
extern crate mini_matrix;
Then import the modules and you're done!
use mini_matrix::Matrix;
// Create a 2x2 matrix:
let a = Matrix::from([
[1.0, 2.0],
[3.0, 4.0],
]);
// Create a 2x3 matrix:
let b = Matrix::from([
[1.0, 2.0],
[4.0, 5.0],
]);
let c = a * b; // Matrix product of a and b
let expected = Matrix::from([[5.0, 14.0], [11.0, 32.0]]);
assert_eq!(c, expected);