#vector-math

ferrix

A simple matrix library for Rust

1 unstable release

0.1.0 Sep 16, 2024

#873 in Math

Download history 126/week @ 2024-09-13 26/week @ 2024-09-20 12/week @ 2024-09-27 4/week @ 2024-10-04

168 downloads per month

MIT license

225KB
3.5K SLoC

Ferrix Logo

A simple matrix library for Rust.

Example

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.

Installation

To add Ferrix to your project, install it via cargo:

cargo add ferrix

Contributing

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:

  • Creating more examples to illustrate the library's capabilities
    • This would help identify missing features
    • Opportunity for feedback on how to improve the library
  • Implementing a linear algebra crate on top of this one
  • Aggressively increasing the performance of the library

Dependencies

~335–460KB