1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*!
# **rustool**

Personal toolbox for my Rust projects

## Using **rustool**

Simply add the following to your `Cargo.toml` file:

```.ignore
[dependencies]
rustool = "0.3.0"
```
*/

/// Main functionalities.
pub mod core;

pub use crate::core::*;

extern crate itertools;
extern crate log;
extern crate nalgebra as na;
extern crate num_traits;
extern crate simplelog;

use na::base::storage::Storage;
use na::{DVector, Dynamic, Matrix, MatrixXx3, RowVector3, SliceStorage};

/// Type alias for [`DVector`]. The matrix has X rows and 1 column.
pub type List<T> = DVector<T>;

/// Type alias for [`Vector3`]. The matrix has 1 row and 3 columns.
pub type Vector<T> = RowVector3<T>;

/// Type alias for [`MatrixXx3`]. The matrix has X row and 3 columns.
pub type Vectors<T> = MatrixXx3<T>;

/// Type alias to define a slice of the size of its matrix.
pub type Slice<'a, N, R, C, S1> = Matrix<
    N,
    Dynamic,
    Dynamic,
    SliceStorage<
        'a,
        N,
        Dynamic,
        Dynamic,
        <S1 as Storage<N, R, C>>::RStride,
        <S1 as Storage<N, R, C>>::CStride,
    >,
>;