tool/
lib.rs

1/*!
2# **rustool**
3
4Personal toolbox for my Rust projects
5
6## Using **rustool**
7
8Simply add the following to your `Cargo.toml` file:
9
10```.ignore
11[dependencies]
12rustool = "*" // replace * by the latest version of the crate
13```
14*/
15
16/// Main functionalities.
17pub mod core;
18
19pub use crate::core::*;
20
21extern crate alga;
22extern crate itertools;
23extern crate log;
24extern crate nalgebra as na;
25extern crate num_traits;
26extern crate simplelog;
27#[macro_use]
28extern crate approx;
29
30use na::{
31    Dynamic, Matrix, Matrix3xX, MatrixSlice3xX, RowDVector, SliceStorage, UnitVector3, Vector3,
32    VectorSlice3, U1, U3,
33};
34
35/// Type alias for [`RowDVector`]. The matrix has 1 row and X columns.
36pub type List<T> = RowDVector<T>;
37
38/// The matrix does not own the data and has 1 row and X columns. See [`List`] for list of owned
39/// data.
40pub type ListSlice<'a, T> = Matrix<T, U1, Dynamic, SliceStorage<'a, T, U1, Dynamic, U1, Dynamic>>;
41
42/// Type alias for [`Vector3`]. The matrix has 3 rows and 1 column.
43pub type Vector<T> = Vector3<T>;
44
45/// Type alias for [`VectorSlice3`]. The matrix does not own the data and has 3 rows and 1 column.
46/// See [`Vector`] for owned vector data.
47pub type VectorSlice<'a, T> = VectorSlice3<'a, T>;
48
49/// Type alias for [`UnitVector3`]. The matrix has 3 rows and 1 column.
50pub type Unit<T> = UnitVector3<T>;
51
52/// Type alias for [`Matrix3xX`]. The matrix has 3 rows and X columns.
53pub type Vectors<T> = Matrix3xX<T>;
54
55/// Type alias for [`MatrixSlice3xX`]. The matrix does not own the data and has 3 rows and X column.
56/// See [`Vectors`] for list of owned vector data.
57pub type VectorsSlice<'a, T> = MatrixSlice3xX<'a, T>;
58
59/// Type alias for [`Matrix3xX`]. The matrix has 3 rows and X columns.
60pub type VectorsGeneric<T, S> = Matrix<T, U3, Dynamic, S>;