Crate matrix_basic

Source
Expand description

This is a crate for very basic matrix operations with any type that implement Add, Sub, Mul, Zero, Neg and Copy. Additional properties might be needed for certain operations.

I created it mostly to learn using generic types and traits.

Sayantan Santra (2023)

Modules§

errors

Structs§

Matrix
A generic matrix struct (over any type with Add, Sub, Mul, Zero, Neg and Copy implemented). Look at from to see examples.

Traits§

MatrixFrom
Trait for conversion between matrices of different types. It only has a matrix_from() method. This is needed since negative trait bound are not supported in stable Rust yet, so we’ll have a conflict trying to implement From. I plan to change this to the default From trait as soon as some sort of specialization system is implemented. You can track this issue here.
MatrixInto
Sister trait of MatrixFrom. Basically does the same thing, just with a different syntax.
ToMatrix
Trait a type must satisfy to be element of a matrix. This is mostly to reduce writing trait bounds afterwards.