Crates.io | vectrs |
lib.rs | vectrs |
version | 0.0.7 |
source | src |
created_at | 2020-12-17 17:24:35.266832 |
updated_at | 2021-02-10 14:10:26.349217 |
description | A stack-allocated, constant-size, n-dimensional vector type (NOTE: this crate was renamed to `vectrix`) |
homepage | |
repository | https://github.com/rossmacarthur/vectrs |
max_upload_size | |
id | 323969 |
size | 42,784 |
vectrix
, please use it under the new name.A stack-allocated, constant-size, n-dimensional vector type implemented with const generics.
This crate will work on stable Rust from Rust v1.51 onwards.
use vectrs::Vector;
// construct from arrays, tuples, iterators, etc
let v1 = Vector::new([-1, 0]);
let v2 = Vector::from((3, 2));
let v3: Vector<_, 2> = std::iter::repeat(2).collect();
// numeric operations are implemented
assert_eq!(v1 + v2, v3);
// access/mutate components using slice indexing or dedicated methods
assert_eq!(v2.x(), 3);
assert_eq!(v2[1], 2);
See the full documentation for more.
Licensed under either of
at your option.