definitive 0.1.0

The definitive and final vector & matrix library for Rust


The definitive vector and matrix library for Rust

use definitive::Vector;

let a = Vector::new([2, 3, 1]);
let b = Vector::new([8, 0, 0]);

let c = a + b * (b * 2);


Definitive provides the default feature simd which enables and disables hand written SIMD implementations of certain Vector and Matrix variants. Hand optimized variants are documented under their own traits


This crate supports #![no_std] environments, and support can be enabled by disabling the std feature

Current issues

The biggest issue currently is supporting arbritrary matrices, as type signature such as the following are not allowed. As far as I can tell, we might get this someday, but const generics are still in their infancy.

struct Matrix<T, const N: usize, const L: [usize; {N}]>([T; { L.iter().product() }]);

Another issue I'm facing is with specialization. I want to allow vec * scalar operations, but I cannot for the life of me figure out a way to do that without adding an unnecessary Copy bound on the vec's T. This is in most cases non issue, and does not cause any inefficiencies as the members of the vec are not actually copied anywhere. In future this bound might get removed, as I learn how to actually use the type system D:


  • Vector

    • Clone
    • Copy
    • Debug
    • Display
    • Eq
      • PartialEq
    • Add
      • AddAssign
    • Sub
      • SubAssign
    • Mul
      • MulAssign
    • Div
      • DivAssign
    • Rem
      • RemAssign
    • Neg
    • BitAnd
      • BitAndAssign
    • BitOr
      • BitOrAssign
    • BitXor
      • BitXorAssign
    • Shl
      • ShlAssign
    • Shr
      • ShrAssign
    • Not
    • Hash
  • Matrix (blocked on