GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - p2js/mat-rs: no_std implementation of mathematical matrix types in Rust

BranchesTags
Open more actions menu

Latest commit

 

History

18 Commits
18 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
.gitignore
.gitignore
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
readme.md
readme.md
 
 

Repository files navigation

mat-rs

A no_std implementation of mathematical matrix types in rust

⚠️ WIP

This library is functional, but not done. There are a couple of things on the to-do list:

  • Implement the to_inverse (if even possible) and inverse methods for DMat
  • Add doc comments for types and operations
  • Add one-way interoperability between DMat and Mat (possibly through a common Matrix trait)

Features

This library crate implements two types of matrices:

  • Mat<R, C>, statically sized matrix types using const generics
  • DMat, a dynamically sized matrix type

Both of the matrix variants store f64 values internally.

Usage

Matrices can be initialised using the provided mat![] and dmat![] macros, or using some of the types' provided functions:

use mat_rs::mat::{mat, Mat};

let a = mat![
    1, 2, 3;
    4, 5, 6;
    7, 8, 9
]; //the type will be automatically inferred as Mat<3, 3>

let b = Mat::<3, 3>::identity(); //3x3 identity matrix

assert_eq(a*b, a);
println!("{}", a.determinant()); //0

Operations

For the statically sized Mats, operations are defined only on valid corresponding types. For example, Mat<R, C>::add will be defined only on matrices of the same size.

This also applies to commutative matrices for multiplication, and operations that are only valid on square matrices like determinants and inverses.

Dynamic matrices will currently panic on invalid operations, so it's up to the implementer to verify sizes if necessary before performing operations.

About

no_std implementation of mathematical matrix types in Rust

crates.io/crates/mat-rs

Topics

determinant-calculationmatricesmatrixmatrix-libraryrust

Resources

Readme
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.