linalg-traits
Traits for generic linear algebra.
Documentation
Please see https://docs.rs/linalg-traits.
Examples
Let's define a function that takes in a vector and returns a new vector with all the elements repeated twice. Using the [Vector] trait, we can write it in a way that makes it independent of what type we use to represent a vector.
use Vector;
use ;
use *;
// Define the function for repeating the elements.
// Define the vector to be repeated.
let v: = array!;
// Repeat the elements.
let v_repeated: = repeat_elements;
// Check that the elements were properly repeated.
assert_arrays_equal!;