MCPcopy Index your code
hub / github.com/AtheMathmo/rulinalg

github.com/AtheMathmo/rulinalg @v0.4.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.4.2 ↗ · + Follow
651 symbols 1,637 edges 48 files 161 documented · 25%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

rulinalg

Build Status

The crate is currently on version 0.4.2.

Read the API Documentation to learn more.


Summary

Rulinalg is a linear algebra library written in Rust that doesn't require heavy external dependencies.

The goal of rulinalg is to provide efficient implementations of common linear algebra techniques in Rust.

Rulinalg was initially a part of rusty-machine, a machine learning library in Rust.

Contributing

This project is currently looking for contributors of all capacities!


Implementation

This project is implemented using Rust.

Currently the library does not make use of any external dependencies - though hopefully we will have BLAS/LAPACK bindings soon.


Usage

The library usage is described well in the API documentation - including example code.

Installation

The library is most easily used with cargo. Simply include the following in your Cargo.toml file:

[dependencies]
rulinalg="0.4.2"

And then import the library using:

extern crate rulinalg;

Then import the modules and you're done!

use rulinalg::matrix::Matrix;

// Create a 2x2 matrix:
let a = Matrix::new(2, 2, vec![
    1.0, 2.0,
    3.0, 4.0,
]);

// Create a 2x3 matrix:
let b = Matrix::new(2, 3, vec![
    1.0, 2.0, 3.0,
    4.0, 5.0, 6.0,
]);

let c = &a * &b; // Matrix product of a and b
// [
        9.0, 12.0, 15.0,
       19.0, 26.0, 33.0,
// ]

More detailed coverage can be found in the API documentation.

Extension points exported contracts — how you extend this code

BaseMatrix (Interface)
Trait for immutable matrix structs. [7 implementers]
src/matrix/base/mod.rs
ElementwiseComparator (Interface)
Trait that describes elementwise comparators for [assert_matrix_eq!](../macro.assert_matrix_eq!.html). Usually you shou [4 …
src/macros/matrix_eq.rs
VectorNorm (Interface)
Trait for vector norms [2 implementers]
src/norm/mod.rs
Ulp (Interface)
Floating point types for which two instances can be compared for Unit in the Last Place (ULP) difference. Implementing
src/ulp.rs
BaseMatrixMut (Interface)
Trait for mutable matrices. [4 implementers]
src/matrix/base/mod.rs
ComparisonFailure (Interface)
(no doc) [3 implementers]
src/macros/matrix_eq.rs
MatrixNorm (Interface)
Trait for matrix norms. [2 implementers]
src/norm/mod.rs
Decomposition (Interface)
Base trait for decompositions. A matrix decomposition, or factorization, is a procedure which takes a matrix `X` and re [1 …
src/matrix/decomposition/mod.rs

Core symbols most depended-on inside this repo

clone
called by 155
src/vector/impl_vec.rs
rows
called by 77
src/matrix/base/impl_base.rs
iter
called by 70
src/vector/impl_vec.rs
cols
called by 66
src/matrix/base/impl_base.rs
row_iter
called by 40
src/matrix/base/mod.rs
iter
called by 38
src/matrix/base/mod.rs
row_stride
called by 36
src/matrix/base/impl_base.rs
raw_slice
called by 25
src/matrix/mod.rs

Shape

Function 417
Method 184
Class 32
Interface 10
Enum 8

Languages

Rust100%

Modules by API surface

src/macros/matrix_eq.rs69 symbols
src/vector/impl_ops.rs55 symbols
src/matrix/permutation_matrix.rs51 symbols
src/matrix/base/mod.rs51 symbols
src/vector/impl_vec.rs44 symbols
src/matrix/impl_mat.rs36 symbols
src/matrix/iter.rs31 symbols
src/matrix/base/impl_base.rs30 symbols
src/matrix/impl_ops.rs25 symbols
src/norm/mod.rs24 symbols
src/matrix/mod.rs21 symbols
src/matrix/decomposition/lu.rs19 symbols

For agents

$ claude mcp add rulinalg \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact