ndarray_cg/d2/mat/
general.rs

1mod private
2{
3  // use crate::*;
4
5  // =
6
7  /// A trait indicate that matrix in case of referencing it can be interpreted as such having specified shape `ROWS x COLS`.
8  ///
9  /// This trait defines a constant `ROWS, COLS`, representing the length of the entity.
10  pub trait MatWithShape< const ROWS : usize, const COLS : usize >
11  {
12  }
13
14  /// Implementation of `MatWithShape` for references to entities.
15  impl< T, const ROWS : usize, const COLS : usize > MatWithShape< ROWS, COLS > for &T
16  where
17    T : MatWithShape< ROWS, COLS >,
18  {
19  }
20
21  /// Implementation of `MatWithShape` for mutable references to entities.
22  impl< T, const ROWS : usize, const COLS : usize > MatWithShape< ROWS, COLS > for &mut T
23  where
24    T : MatWithShape< ROWS, COLS >,
25  {
26  }
27
28  // =
29
30  /// A trait indicate that matrix in case of mutable referencing it can be interpreted as such having specified shape `ROWS x COLS`.
31  ///
32  /// This trait defines a constant `ROWS, COLS`, representing the length of the entity.
33  pub trait MatWithShapeMut< const ROWS : usize, const COLS : usize >
34  where
35    Self : MatWithShape< ROWS, COLS >,
36  {
37  }
38
39  /// Implementation of `MatWithShapeMut` for references to entities.
40  impl< T, const ROWS : usize, const COLS : usize > MatWithShapeMut< ROWS, COLS > for &T
41  where
42    Self : MatWithShape< ROWS, COLS > + MatWithShapeMut< ROWS, COLS > +,
43  {
44  }
45
46  /// Implementation of `MatWithShapeMut` for mutable references to entities.
47  impl< T, const ROWS : usize, const COLS : usize > MatWithShapeMut< ROWS, COLS > for &mut T
48  where
49    Self : MatWithShape< ROWS, COLS > + MatWithShapeMut< ROWS, COLS >,
50  {
51  }
52
53  // =
54
55}
56
57crate::mod_interface!
58{
59
60  exposed use
61  {
62    MatWithShape,
63    MatWithShapeMut,
64  };
65
66}