Skip to main content

lll_rs/vector/
mod.rs

1//! Basic vector structures for LLL
2
3mod bigvector;
4mod rationalvector;
5mod vectorf;
6
7pub use bigvector::BigVector;
8pub use rationalvector::RationalVector;
9pub use vectorf::VectorF;
10
11/// The `Vector` trait describes the general properties of an element in a vector space.
12pub trait Vector {
13    /// Returns the vector's dimension
14    fn dimension(&self) -> usize;
15
16    /// Add two vectors together
17    fn add(&self, other: &Self) -> Self;
18
19    /// Substract two vectors
20    fn sub(&self, other: &Self) -> Self;
21
22    /// Initialise vector type
23    fn init(dimension: usize) -> Self;
24
25    /// Basis vector
26    fn basis_vector(&self, position: usize) -> Self;
27}
28
29/// The `Dot` trait allows the computation of dot products with values in `T`
30pub trait Dot<T> {
31    fn dot(&self, other: &Self) -> T;
32}