pub struct Matrix<const N: usize, const M: usize, Array, T>(pub Array, pub PhantomData<T>)
where
Array: Into<[T; { _ }]> + Index<usize>;
Expand description
Matrix M[N x M]
Tuple Fields§
§0: Array
§1: PhantomData<T>
Implementations§
Source§impl<const N: usize, const M: usize, Array, T> Matrix<N, M, Array, T>
impl<const N: usize, const M: usize, Array, T> Matrix<N, M, Array, T>
Sourcepub fn new(array: Array) -> Self
pub fn new(array: Array) -> Self
generate Matrix
Examples found in repository?
examples/main.rs (lines 9-12)
7fn main() {
8 // A + B in stack
9 let left = Matrix::<2, 3, _, i32>::new([
10 1, 2, 3, //
11 4, 5, 6,
12 ]);
13 let right = Matrix::<2, 3, _, i32>::new([
14 1, 2, 3, //
15 4, 5, 6,
16 ]);
17 assert_eq!(
18 left + right,
19 Matrix::<2, 3, _, i32>::new([
20 2, 4, 6, //
21 8, 10, 12
22 ])
23 );
24
25 // A + B in heap
26 let left = Matrix::<2, 3, _, _>::new(Heaped::<2, 3, i32>::new(Box::new([
27 1, 2, 3, //
28 4, 5, 6,
29 ])));
30 let right = Matrix::<2, 3, _, _>::new(Heaped::<2, 3, i32>::new(Box::new([
31 1, 2, 3, //
32 4, 5, 6,
33 ])));
34 assert_eq!(
35 left + right,
36 Matrix::<2, 3, _, i32>::new([
37 2, 4, 6, //
38 8, 10, 12
39 ])
40 );
41
42 // A in heap + B in stack
43 let left = Matrix::<2, 3, _, _>::new(Heaped::<2, 3, i32>::new(Box::new([
44 1, 2, 3, //
45 4, 5, 6,
46 ])));
47 let right = Matrix::<2, 3, _, i32>::new([
48 1, 2, 3, //
49 4, 5, 6,
50 ]);
51 assert_eq!(
52 left + right,
53 Matrix::<2, 3, _, i32>::new([
54 2, 4, 6, //
55 8, 10, 12
56 ])
57 );
58
59 // A * B
60 let left = Matrix::<2, 3, _, u32>::new([
61 3, 7, 2, //
62 2, 4, 3,
63 ]);
64 let right = Matrix::<3, 3, _, u32>::new([
65 2, 1, 4, //
66 9, 2, 7, //
67 8, 3, 2,
68 ]);
69 assert_eq!(
70 left * right,
71 Matrix::<2, 3, _, u32>::new([
72 85, 23, 65, //
73 64, 19, 42
74 ])
75 );
76
77 // LU decomposition
78 let matrix = Matrix::<10, 10, _, f64>::new([
79 3.4, 5.3, 2.4, 4.7, 7.89, 3.2, 3.5, 2.1324, 3.0, 3.4, //
80 1.4, 5.4, 2.4, 4.7, 7.89, 3.2, 4.5, 2.1324, 3.0, 3.4, //
81 2.4, 5.5, 2.4, 4.7, 7.89, 3.2, 2.5, 2.1324, 3.0, 3.4, //
82 3.4, 5.6, 2.4, 4.7, 7.89, 3.2, 4.5, 2.1324, 3.0, 3.4, //
83 3.4, 5.9, 2.4, 4.7, 7.89, 3.2, 5.5, 2.1324, 3.0, 3.4, //
84 5.4, 4.3, 2.4, 4.7, 7.89, 3.2, 4.5, 2.1324, 3.0, 3.4, //
85 6.4, 3.3, 2.4, 4.7, 7.89, 3.2, 7.5, 2.1324, 3.0, 3.4, //
86 7.4, 1.3, 2.4, 4.7, 7.89, 3.2, 9.5, 2.1324, 3.0, 3.4, //
87 8.4, 2.3, 2.4, 4.7, 7.89, 3.2, 4.5, 2.1324, 3.0, 3.4, //
88 9.4, 3.3, 2.4, 4.7, 7.89, 3.2, 1.5, 2.1324, 3.0, 3.4, //
89 ]);
90 let (l, u) = matrix.lu_decomposition();
91 let diff = matrix - l * u;
92 diff.map::<_, _, [(); 10 * 10]>(|e| assert!(e.abs() < 1e-10));
93
94 // Solve Ax = b with Gaussian elimination
95 //
96 // 2a + 2b - 4c + 5d = 16
97 // a + b + c + d = 10
98 // -a + 2b - 3c - d = -2
99 // a + 2b + 3c - 4d = -2
100 //
101 // (a, b, c, d) = (1, 2, 3, 4)
102 let a = Matrix::<4, 4, _, f64>::new([
103 2.0, 3.0, -4.0, 5.0, //
104 1.0, 1.0, 1.0, 1.0, //
105 -1.0, 2.0, -3.0, 1.0, //
106 1.0, 2.0, 3.0, -4.0,
107 ]);
108 let b = Matrix::<4, 1, _, f64>::new([
109 16.0, //
110 10.0, //
111 -2.0, //
112 -2.0,
113 ]);
114 let x = solve_eqn(a, b);
115 assert!((1.0 - x.0[0]).abs() < 1e-10);
116 assert!((2.0 - x.0[1]).abs() < 1e-10);
117 assert!((3.0 - x.0[2]).abs() < 1e-10);
118 assert!((4.0 - x.0[3]).abs() < 1e-10);
119}
Source§impl<const N: usize, const M: usize, Slice, T> Matrix<N, M, Slice, T>
impl<const N: usize, const M: usize, Slice, T> Matrix<N, M, Slice, T>
Sourcepub fn map<U, F, Array>(self, f: F) -> Matrix<N, M, Array, U>
pub fn map<U, F, Array>(self, f: F) -> Matrix<N, M, Array, U>
Apply f to all value
§Examples
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
use dntk_matrix::matrix::Matrix;
let matrix = Matrix::<4, 3, _, u32>::new([
1, 2, 3, //
4, 5, 6, //
7, 8, 9, //
10, 11, 12,
]);
assert_eq!(
matrix.clone().map::<_, _, [u32; 4 * 3]>(|e| 2 * e),
matrix * 2
)
Examples found in repository?
examples/main.rs (line 92)
7fn main() {
8 // A + B in stack
9 let left = Matrix::<2, 3, _, i32>::new([
10 1, 2, 3, //
11 4, 5, 6,
12 ]);
13 let right = Matrix::<2, 3, _, i32>::new([
14 1, 2, 3, //
15 4, 5, 6,
16 ]);
17 assert_eq!(
18 left + right,
19 Matrix::<2, 3, _, i32>::new([
20 2, 4, 6, //
21 8, 10, 12
22 ])
23 );
24
25 // A + B in heap
26 let left = Matrix::<2, 3, _, _>::new(Heaped::<2, 3, i32>::new(Box::new([
27 1, 2, 3, //
28 4, 5, 6,
29 ])));
30 let right = Matrix::<2, 3, _, _>::new(Heaped::<2, 3, i32>::new(Box::new([
31 1, 2, 3, //
32 4, 5, 6,
33 ])));
34 assert_eq!(
35 left + right,
36 Matrix::<2, 3, _, i32>::new([
37 2, 4, 6, //
38 8, 10, 12
39 ])
40 );
41
42 // A in heap + B in stack
43 let left = Matrix::<2, 3, _, _>::new(Heaped::<2, 3, i32>::new(Box::new([
44 1, 2, 3, //
45 4, 5, 6,
46 ])));
47 let right = Matrix::<2, 3, _, i32>::new([
48 1, 2, 3, //
49 4, 5, 6,
50 ]);
51 assert_eq!(
52 left + right,
53 Matrix::<2, 3, _, i32>::new([
54 2, 4, 6, //
55 8, 10, 12
56 ])
57 );
58
59 // A * B
60 let left = Matrix::<2, 3, _, u32>::new([
61 3, 7, 2, //
62 2, 4, 3,
63 ]);
64 let right = Matrix::<3, 3, _, u32>::new([
65 2, 1, 4, //
66 9, 2, 7, //
67 8, 3, 2,
68 ]);
69 assert_eq!(
70 left * right,
71 Matrix::<2, 3, _, u32>::new([
72 85, 23, 65, //
73 64, 19, 42
74 ])
75 );
76
77 // LU decomposition
78 let matrix = Matrix::<10, 10, _, f64>::new([
79 3.4, 5.3, 2.4, 4.7, 7.89, 3.2, 3.5, 2.1324, 3.0, 3.4, //
80 1.4, 5.4, 2.4, 4.7, 7.89, 3.2, 4.5, 2.1324, 3.0, 3.4, //
81 2.4, 5.5, 2.4, 4.7, 7.89, 3.2, 2.5, 2.1324, 3.0, 3.4, //
82 3.4, 5.6, 2.4, 4.7, 7.89, 3.2, 4.5, 2.1324, 3.0, 3.4, //
83 3.4, 5.9, 2.4, 4.7, 7.89, 3.2, 5.5, 2.1324, 3.0, 3.4, //
84 5.4, 4.3, 2.4, 4.7, 7.89, 3.2, 4.5, 2.1324, 3.0, 3.4, //
85 6.4, 3.3, 2.4, 4.7, 7.89, 3.2, 7.5, 2.1324, 3.0, 3.4, //
86 7.4, 1.3, 2.4, 4.7, 7.89, 3.2, 9.5, 2.1324, 3.0, 3.4, //
87 8.4, 2.3, 2.4, 4.7, 7.89, 3.2, 4.5, 2.1324, 3.0, 3.4, //
88 9.4, 3.3, 2.4, 4.7, 7.89, 3.2, 1.5, 2.1324, 3.0, 3.4, //
89 ]);
90 let (l, u) = matrix.lu_decomposition();
91 let diff = matrix - l * u;
92 diff.map::<_, _, [(); 10 * 10]>(|e| assert!(e.abs() < 1e-10));
93
94 // Solve Ax = b with Gaussian elimination
95 //
96 // 2a + 2b - 4c + 5d = 16
97 // a + b + c + d = 10
98 // -a + 2b - 3c - d = -2
99 // a + 2b + 3c - 4d = -2
100 //
101 // (a, b, c, d) = (1, 2, 3, 4)
102 let a = Matrix::<4, 4, _, f64>::new([
103 2.0, 3.0, -4.0, 5.0, //
104 1.0, 1.0, 1.0, 1.0, //
105 -1.0, 2.0, -3.0, 1.0, //
106 1.0, 2.0, 3.0, -4.0,
107 ]);
108 let b = Matrix::<4, 1, _, f64>::new([
109 16.0, //
110 10.0, //
111 -2.0, //
112 -2.0,
113 ]);
114 let x = solve_eqn(a, b);
115 assert!((1.0 - x.0[0]).abs() < 1e-10);
116 assert!((2.0 - x.0[1]).abs() < 1e-10);
117 assert!((3.0 - x.0[2]).abs() < 1e-10);
118 assert!((4.0 - x.0[3]).abs() < 1e-10);
119}
Source§impl<const N: usize, const M: usize, T: Copy> Matrix<N, M, [T; { _ }], T>
impl<const N: usize, const M: usize, T: Copy> Matrix<N, M, [T; { _ }], T>
Sourcepub fn transpose(self) -> Matrix<M, N, [T; { _ }], T>
pub fn transpose(self) -> Matrix<M, N, [T; { _ }], T>
A^t
§Examples
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
use dntk_matrix::matrix::Matrix;
let matrix = Matrix::<4, 3, _, u32>::new([
1, 2, 3, //
4, 5, 6, //
7, 8, 9, //
10, 11, 12
]);
assert_eq!(
matrix.transpose(),
Matrix::<3, 4, _, u32>::new([
1, 4, 7, 10, //
2, 5, 8, 11, //
3, 6, 9, 12
])
);
Source§impl<const N: usize, Slice, F: Float> Matrix<N, N, Slice, F>where
Slice: Into<[F; { _ }]> + From<[F; { _ }]> + Index<usize, Output = F> + IndexMut<usize, Output = F> + Clone,
impl<const N: usize, Slice, F: Float> Matrix<N, N, Slice, F>where
Slice: Into<[F; { _ }]> + From<[F; { _ }]> + Index<usize, Output = F> + IndexMut<usize, Output = F> + Clone,
Sourcepub fn lu_decomposition(&self) -> (Self, Self)
pub fn lu_decomposition(&self) -> (Self, Self)
LU decomposition
§Examples
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
use dntk_matrix::matrix::Matrix;
let matrix = Matrix::<4, 4, _, f64>::new([
2.0, 3.0, -4.0, 5.0, //
1.0, 1.0, 1.0, 1.0, //
-1.0, 2.0, -3.0, 1.0, //
1.0, 2.0, 3.0, -4.0,
]);
let (l, u) = matrix.lu_decomposition();
assert_eq!(l * u, matrix);
Examples found in repository?
examples/main.rs (line 90)
7fn main() {
8 // A + B in stack
9 let left = Matrix::<2, 3, _, i32>::new([
10 1, 2, 3, //
11 4, 5, 6,
12 ]);
13 let right = Matrix::<2, 3, _, i32>::new([
14 1, 2, 3, //
15 4, 5, 6,
16 ]);
17 assert_eq!(
18 left + right,
19 Matrix::<2, 3, _, i32>::new([
20 2, 4, 6, //
21 8, 10, 12
22 ])
23 );
24
25 // A + B in heap
26 let left = Matrix::<2, 3, _, _>::new(Heaped::<2, 3, i32>::new(Box::new([
27 1, 2, 3, //
28 4, 5, 6,
29 ])));
30 let right = Matrix::<2, 3, _, _>::new(Heaped::<2, 3, i32>::new(Box::new([
31 1, 2, 3, //
32 4, 5, 6,
33 ])));
34 assert_eq!(
35 left + right,
36 Matrix::<2, 3, _, i32>::new([
37 2, 4, 6, //
38 8, 10, 12
39 ])
40 );
41
42 // A in heap + B in stack
43 let left = Matrix::<2, 3, _, _>::new(Heaped::<2, 3, i32>::new(Box::new([
44 1, 2, 3, //
45 4, 5, 6,
46 ])));
47 let right = Matrix::<2, 3, _, i32>::new([
48 1, 2, 3, //
49 4, 5, 6,
50 ]);
51 assert_eq!(
52 left + right,
53 Matrix::<2, 3, _, i32>::new([
54 2, 4, 6, //
55 8, 10, 12
56 ])
57 );
58
59 // A * B
60 let left = Matrix::<2, 3, _, u32>::new([
61 3, 7, 2, //
62 2, 4, 3,
63 ]);
64 let right = Matrix::<3, 3, _, u32>::new([
65 2, 1, 4, //
66 9, 2, 7, //
67 8, 3, 2,
68 ]);
69 assert_eq!(
70 left * right,
71 Matrix::<2, 3, _, u32>::new([
72 85, 23, 65, //
73 64, 19, 42
74 ])
75 );
76
77 // LU decomposition
78 let matrix = Matrix::<10, 10, _, f64>::new([
79 3.4, 5.3, 2.4, 4.7, 7.89, 3.2, 3.5, 2.1324, 3.0, 3.4, //
80 1.4, 5.4, 2.4, 4.7, 7.89, 3.2, 4.5, 2.1324, 3.0, 3.4, //
81 2.4, 5.5, 2.4, 4.7, 7.89, 3.2, 2.5, 2.1324, 3.0, 3.4, //
82 3.4, 5.6, 2.4, 4.7, 7.89, 3.2, 4.5, 2.1324, 3.0, 3.4, //
83 3.4, 5.9, 2.4, 4.7, 7.89, 3.2, 5.5, 2.1324, 3.0, 3.4, //
84 5.4, 4.3, 2.4, 4.7, 7.89, 3.2, 4.5, 2.1324, 3.0, 3.4, //
85 6.4, 3.3, 2.4, 4.7, 7.89, 3.2, 7.5, 2.1324, 3.0, 3.4, //
86 7.4, 1.3, 2.4, 4.7, 7.89, 3.2, 9.5, 2.1324, 3.0, 3.4, //
87 8.4, 2.3, 2.4, 4.7, 7.89, 3.2, 4.5, 2.1324, 3.0, 3.4, //
88 9.4, 3.3, 2.4, 4.7, 7.89, 3.2, 1.5, 2.1324, 3.0, 3.4, //
89 ]);
90 let (l, u) = matrix.lu_decomposition();
91 let diff = matrix - l * u;
92 diff.map::<_, _, [(); 10 * 10]>(|e| assert!(e.abs() < 1e-10));
93
94 // Solve Ax = b with Gaussian elimination
95 //
96 // 2a + 2b - 4c + 5d = 16
97 // a + b + c + d = 10
98 // -a + 2b - 3c - d = -2
99 // a + 2b + 3c - 4d = -2
100 //
101 // (a, b, c, d) = (1, 2, 3, 4)
102 let a = Matrix::<4, 4, _, f64>::new([
103 2.0, 3.0, -4.0, 5.0, //
104 1.0, 1.0, 1.0, 1.0, //
105 -1.0, 2.0, -3.0, 1.0, //
106 1.0, 2.0, 3.0, -4.0,
107 ]);
108 let b = Matrix::<4, 1, _, f64>::new([
109 16.0, //
110 10.0, //
111 -2.0, //
112 -2.0,
113 ]);
114 let x = solve_eqn(a, b);
115 assert!((1.0 - x.0[0]).abs() < 1e-10);
116 assert!((2.0 - x.0[1]).abs() < 1e-10);
117 assert!((3.0 - x.0[2]).abs() < 1e-10);
118 assert!((4.0 - x.0[3]).abs() < 1e-10);
119}
Trait Implementations§
Source§impl<const N: usize, const M: usize, Lhs, Rhs, T> Add<Matrix<N, M, Rhs, T>> for Matrix<N, M, Lhs, T>where
Lhs: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize>,
Rhs: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize>,
T: AddAssign,
impl<const N: usize, const M: usize, Lhs, Rhs, T> Add<Matrix<N, M, Rhs, T>> for Matrix<N, M, Lhs, T>where
Lhs: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize>,
Rhs: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize>,
T: AddAssign,
Source§fn add(self, other: Matrix<N, M, Rhs, T>) -> Self::Output
fn add(self, other: Matrix<N, M, Rhs, T>) -> Self::Output
A + B
§Examples
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
use dntk_matrix::matrix::Matrix;
use dntk_matrix::heap::Heaped;
let left = Matrix::<2, 3, _, i32>::new([
1, 2, 3, //
4, 5, 6,
]);
let right = Matrix::<2, 3, _, i32>::new([
1, 2, 3, //
4, 5, 6,
]);
assert_eq!(
left + right,
Matrix::<2, 3, _, i32>::new([
2, 4, 6, //
8, 10, 12
])
);
let left = Matrix::<2, 3, _, _>::new(Heaped::<2, 3, i32>::new(Box::new([
1, 2, 3, //
4, 5, 6,
])));
let right = Matrix::<2, 3, _, _>::new(Heaped::<2, 3, i32>::new(Box::new([
1, 2, 3, //
4, 5, 6,
])));
assert_eq!(
left + right,
Matrix::<2, 3, _, i32>::new([
2, 4, 6, //
8, 10, 12
])
);
let left = Matrix::<2, 3, _, _>::new(Heaped::<2, 3, i32>::new(Box::new([
1, 2, 3, //
4, 5, 6,
])));
let right = Matrix::<2, 3, _, i32>::new([
1, 2, 3, //
4, 5, 6,
]);
assert_eq!(
left + right,
Matrix::<2, 3, _, i32>::new([
2, 4, 6, //
8, 10, 12
])
);
Source§impl<const N: usize, const M: usize, const L: usize, Rhs, T> Mul<Matrix<M, L, Rhs, T>> for Matrix<N, M, [T; { _ }], T>where
[T; { _ }]: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize, Output = T>,
Rhs: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize, Output = T>,
T: AddAssign + Mul<Output = T> + Copy + Zero,
impl<const N: usize, const M: usize, const L: usize, Rhs, T> Mul<Matrix<M, L, Rhs, T>> for Matrix<N, M, [T; { _ }], T>where
[T; { _ }]: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize, Output = T>,
Rhs: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize, Output = T>,
T: AddAssign + Mul<Output = T> + Copy + Zero,
Source§fn mul(self, other: Matrix<M, L, Rhs, T>) -> Self::Output
fn mul(self, other: Matrix<M, L, Rhs, T>) -> Self::Output
A * B
§Examples
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
use dntk_matrix::matrix::Matrix;
use dntk_matrix::heap::Heaped;
let left = Matrix::<2, 3, _, i32>::new([
3, 7, 2, //
2, 4, 3,
]);
let right = Matrix::<3, 3, _, i32>::new([
2, 1, 4, //
9, 2, 7, //
8, 3, 2
]);
assert_eq!(
left * right,
Matrix::<2, 3, _, i32>::new([
85, 23, 65, //
64, 19, 42
])
);
Source§type Output = Matrix<N, L, [T; { _ }], T>
type Output = Matrix<N, L, [T; { _ }], T>
The resulting type after applying the
*
operator.Source§impl<const N: usize, const M: usize, const L: usize, Rhs, T> Mul<Matrix<M, L, Rhs, T>> for Matrix<N, M, Heaped<N, M, T>, T>where
[T; { _ }]:,
Heaped<N, M, T>: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize, Output = T>,
Rhs: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize, Output = T>,
T: AddAssign + Mul<Output = T> + Copy + Zero,
impl<const N: usize, const M: usize, const L: usize, Rhs, T> Mul<Matrix<M, L, Rhs, T>> for Matrix<N, M, Heaped<N, M, T>, T>where
[T; { _ }]:,
Heaped<N, M, T>: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize, Output = T>,
Rhs: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize, Output = T>,
T: AddAssign + Mul<Output = T> + Copy + Zero,
Source§impl<const N: usize, const M: usize, Slice, T> Neg for Matrix<N, M, Slice, T>where
Slice: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize, Output = T> + IndexMut<usize, Output = T>,
T: Neg<Output = T> + Copy,
impl<const N: usize, const M: usize, Slice, T> Neg for Matrix<N, M, Slice, T>where
Slice: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize, Output = T> + IndexMut<usize, Output = T>,
T: Neg<Output = T> + Copy,
Source§impl<const N: usize, const M: usize, Lhs, Rhs, T> PartialEq<Matrix<N, M, Rhs, T>> for Matrix<N, M, Lhs, T>where
Lhs: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize, Output = T>,
Rhs: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize, Output = T>,
T: PartialEq,
impl<const N: usize, const M: usize, Lhs, Rhs, T> PartialEq<Matrix<N, M, Rhs, T>> for Matrix<N, M, Lhs, T>where
Lhs: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize, Output = T>,
Rhs: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize, Output = T>,
T: PartialEq,
Source§impl<const N: usize, const M: usize, Lhs, Rhs, T> Sub<Matrix<N, M, Rhs, T>> for Matrix<N, M, Lhs, T>where
Lhs: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize>,
Rhs: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize>,
T: SubAssign,
impl<const N: usize, const M: usize, Lhs, Rhs, T> Sub<Matrix<N, M, Rhs, T>> for Matrix<N, M, Lhs, T>where
Lhs: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize>,
Rhs: Into<[T; { _ }]> + From<[T; { _ }]> + Index<usize>,
T: SubAssign,
Auto Trait Implementations§
impl<const N: usize, const M: usize, Array, T> Freeze for Matrix<N, M, Array, T>where
Array: Freeze,
impl<const N: usize, const M: usize, Array, T> RefUnwindSafe for Matrix<N, M, Array, T>where
Array: RefUnwindSafe,
T: RefUnwindSafe,
impl<const N: usize, const M: usize, Array, T> Send for Matrix<N, M, Array, T>
impl<const N: usize, const M: usize, Array, T> Sync for Matrix<N, M, Array, T>
impl<const N: usize, const M: usize, Array, T> Unpin for Matrix<N, M, Array, T>
impl<const N: usize, const M: usize, Array, T> UnwindSafe for Matrix<N, M, Array, T>where
Array: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more