src/nalgebra_support.rs

branch
dev
changeset 165
478c23ce7cef
parent 164
fd9dba51afd3
child 166
20fa28637737
equal deleted inserted replaced
164:fd9dba51afd3 165:478c23ce7cef
89 impl<SM, N, M, E> Space for Matrix<E, N, M, SM> 89 impl<SM, N, M, E> Space for Matrix<E, N, M, SM>
90 where 90 where
91 SM: Storage<E, N, M>, 91 SM: Storage<E, N, M>,
92 N: Dim, 92 N: Dim,
93 M: Dim, 93 M: Dim,
94 E: Scalar + Zero + One, 94 E: Scalar + Zero + One + Copy,
95 DefaultAllocator: Allocator<N, M>, 95 DefaultAllocator: Allocator<N, M>,
96 ShapeConstraint: StridesOk<E, N, M, SM> + StridesOk<E, N, M>, 96 ShapeConstraint: StridesOk<E, N, M, SM> + StridesOk<E, N, M>,
97 { 97 {
98 type Principal = OMatrix<E, N, M>; 98 type Principal = OMatrix<E, N, M>;
99 type Decomp = MatrixDecomposition; 99 type Decomp = MatrixDecomposition;
105 impl<E, M, K, S> Decomposition<Matrix<E, M, K, S>> for MatrixDecomposition 105 impl<E, M, K, S> Decomposition<Matrix<E, M, K, S>> for MatrixDecomposition
106 where 106 where
107 S: Storage<E, M, K>, 107 S: Storage<E, M, K>,
108 M: Dim, 108 M: Dim,
109 K: Dim, 109 K: Dim,
110 E: Scalar + Zero + One, 110 E: Scalar + Zero + One + Copy,
111 DefaultAllocator: Allocator<M, K>, 111 DefaultAllocator: Allocator<M, K>,
112 ShapeConstraint: StridesOk<E, M, K, S> + StridesOk<E, M, K>, 112 ShapeConstraint: StridesOk<E, M, K, S> + StridesOk<E, M, K>,
113 { 113 {
114 type Decomposition<'b> 114 type Decomposition<'b>
115 = OMatrix<E, M, K> 115 = OMatrix<E, M, K>
133 where 133 where
134 S1: Storage<E, M, K>, 134 S1: Storage<E, M, K>,
135 S2: Storage<E, M, K>, 135 S2: Storage<E, M, K>,
136 M: Dim, 136 M: Dim,
137 K: Dim, 137 K: Dim,
138 E: Scalar + Zero + One, 138 E: Scalar + Zero + One + Copy,
139 DefaultAllocator: Allocator<M, K>, 139 DefaultAllocator: Allocator<M, K>,
140 ShapeConstraint: StridesOk<E, M, K, S1> + StridesOk<E, M, K, S2>, 140 ShapeConstraint: StridesOk<E, M, K, S1> + StridesOk<E, M, K, S2>,
141 { 141 {
142 fn eval_decompose<'b, R>(self, f: impl FnOnce(OMatrix<E, M, K>) -> R) -> R 142 fn eval_decompose<'b, R>(self, f: impl FnOnce(OMatrix<E, M, K>) -> R) -> R
143 where 143 where
168 where 168 where
169 S1: Storage<E, M, K>, 169 S1: Storage<E, M, K>,
170 S2: Storage<E, M, K>, 170 S2: Storage<E, M, K>,
171 M: Dim, 171 M: Dim,
172 K: Dim, 172 K: Dim,
173 E: Scalar + Zero + One, 173 E: Scalar + Zero + One + Copy,
174 DefaultAllocator: Allocator<M, K>, 174 DefaultAllocator: Allocator<M, K>,
175 ShapeConstraint: StridesOk<E, M, K, S1> + StridesOk<E, M, K, S2>, 175 ShapeConstraint: StridesOk<E, M, K, S1> + StridesOk<E, M, K, S2>,
176 { 176 {
177 fn eval_decompose<'b, R>(self, f: impl FnOnce(OMatrix<E, M, K>) -> R) -> R 177 fn eval_decompose<'b, R>(self, f: impl FnOnce(OMatrix<E, M, K>) -> R) -> R
178 where 178 where
203 SM: Storage<E, N, M>, 203 SM: Storage<E, N, M>,
204 SV: Storage<E, M, K> + Clone, 204 SV: Storage<E, M, K> + Clone,
205 N: Dim, 205 N: Dim,
206 M: Dim, 206 M: Dim,
207 K: Dim, 207 K: Dim,
208 E: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, 208 E: Scalar + Zero + One + Copy + ClosedMulAssign + ClosedAddAssign,
209 DefaultAllocator: Allocator<N, K> + Allocator<M, K> + Allocator<N, M> + Allocator<M, N>, 209 DefaultAllocator: Allocator<N, K> + Allocator<M, K> + Allocator<N, M> + Allocator<M, N>,
210 ShapeConstraint: StridesOk<E, N, M, SM> + StridesOk<E, M, K, SV> + StridesOk<E, N, K>, 210 ShapeConstraint: StridesOk<E, N, M, SM> + StridesOk<E, M, K, SV> + StridesOk<E, N, K>,
211 { 211 {
212 type Codomain = OMatrix<E, N, K>; 212 type Codomain = OMatrix<E, N, K>;
213 213
222 SM: Storage<E, N, M>, 222 SM: Storage<E, N, M>,
223 SV: Storage<E, M, K> + Clone, 223 SV: Storage<E, M, K> + Clone,
224 N: Dim, 224 N: Dim,
225 M: Dim, 225 M: Dim,
226 K: Dim, 226 K: Dim,
227 E: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, 227 E: Scalar + Zero + One + Copy + ClosedMulAssign + ClosedAddAssign,
228 DefaultAllocator: Allocator<N, K> + Allocator<M, K> + Allocator<N, M> + Allocator<M, N>, 228 DefaultAllocator: Allocator<N, K> + Allocator<M, K> + Allocator<N, M> + Allocator<M, N>,
229 ShapeConstraint: StridesOk<E, N, M, SM> + StridesOk<E, M, K, SV> + StridesOk<E, N, K>, 229 ShapeConstraint: StridesOk<E, N, M, SM> + StridesOk<E, M, K, SV> + StridesOk<E, N, K>,
230 { 230 {
231 } 231 }
232 232
344 344
345 impl<SM, M, E> ProjectionMut<E, Linfinity> for Vector<E, M, SM> 345 impl<SM, M, E> ProjectionMut<E, Linfinity> for Vector<E, M, SM>
346 where 346 where
347 SM: StorageMut<E, M> + Clone, 347 SM: StorageMut<E, M> + Clone,
348 M: Dim, 348 M: Dim,
349 E: Scalar + Zero + One + Float + RealField, 349 E: Scalar + Zero + One + Copy + Float + RealField,
350 DefaultAllocator: Allocator<M>, 350 DefaultAllocator: Allocator<M>,
351 ShapeConstraint: StridesOk<E, M, U1, SM>, 351 ShapeConstraint: StridesOk<E, M, U1, SM>,
352 { 352 {
353 #[inline] 353 #[inline]
354 fn proj_ball_mut(&mut self, ρ: E, _: Linfinity) { 354 fn proj_ball_mut(&mut self, ρ: E, _: Linfinity) {
364 SV1: Storage<E, M, K> + Clone, 364 SV1: Storage<E, M, K> + Clone,
365 SV2: Storage<E, N, K> + Clone, 365 SV2: Storage<E, N, K> + Clone,
366 N: Dim, 366 N: Dim,
367 M: Dim, 367 M: Dim,
368 K: Dim, 368 K: Dim,
369 E: Scalar + Zero + One + SimdComplexField, 369 E: Scalar + Zero + One + Copy + SimdComplexField,
370 DefaultAllocator: Allocator<N, K> + Allocator<M, K> + Allocator<N, M> + Allocator<M, N>, 370 DefaultAllocator: Allocator<N, K> + Allocator<M, K> + Allocator<N, M> + Allocator<M, N>,
371 ShapeConstraint: StridesOk<E, N, M, SM> 371 ShapeConstraint: StridesOk<E, N, M, SM>
372 + StridesOk<E, M, K, SV1> 372 + StridesOk<E, M, K, SV1>
373 + StridesOk<E, N, K, SV2> 373 + StridesOk<E, N, K, SV2>
374 + StridesOk<E, M, N>, 374 + StridesOk<E, M, N>,

mercurial