Crates.io | ferrix |
lib.rs | ferrix |
version | 0.1.0 |
source | src |
created_at | 2024-09-16 15:25:15.641827 |
updated_at | 2024-09-16 15:25:15.641827 |
description | A simple matrix library for Rust |
homepage | |
repository | https://github.com/siliconlad/ferrix |
max_upload_size | |
id | 1376502 |
size | 537,628 |
A simple matrix library for Rust.
use ferrix::*;
fn main() {
// Create a 3x3 matrix
let matrix = Matrix3::fill(1.0);
println!("Mat: {}", matrix);
// Create a 3x1 vector
let vector = Vector3::new([1.0, 2.0, 3.0]);
println!("Vec: {}", vector);
// Perform matrix-vector multiplication
let result = matrix * vector;
println!("Result: {}", result);
// Transpose the matrix
let transposed = matrix.t();
println!("Transposed: {}", transposed);
// Perform element-wise operations
let scaled = matrix * 2.0;
let sum = matrix + scaled;
println!("Result: {}", sum);
}
For more comprehensive examples, check out the examples.
To add Ferrix to your project, install it via cargo:
cargo add ferrix
If you find any bugs, please open an issue or submit a pull request.
If you have any suggestions or questions, please open an issue.
Specifically, I'm looking for help with: