| 93 M: Dim, |
93 M: Dim, |
| 94 E: Scalar + Zero + One, |
94 E: Scalar + Zero + One, |
| 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 OwnedSpace = OMatrix<E, N, M>; |
98 type Principal = OMatrix<E, N, M>; |
| 99 type Decomp = MatrixDecomposition; |
99 type Decomp = MatrixDecomposition; |
| 100 } |
100 } |
| 101 |
101 |
| 102 #[derive(Copy, Clone, Debug)] |
102 #[derive(Copy, Clone, Debug)] |
| 103 pub struct MatrixDecomposition; |
103 pub struct MatrixDecomposition; |
| 268 E: Scalar + Zero + One + Float, |
268 E: Scalar + Zero + One + Float, |
| 269 DefaultAllocator: Allocator<M, N>, |
269 DefaultAllocator: Allocator<M, N>, |
| 270 ShapeConstraint: StridesOk<E, M, N, S>, |
270 ShapeConstraint: StridesOk<E, M, N, S>, |
| 271 { |
271 { |
| 272 type Field = E; |
272 type Field = E; |
| 273 type Owned = OMatrix<E, M, N>; |
273 type PrincipalV = OMatrix<E, M, N>; |
| 274 |
274 |
| 275 #[inline] |
275 #[inline] |
| 276 fn similar_origin(&self) -> Self::Owned { |
276 fn similar_origin(&self) -> Self::PrincipalV { |
| 277 let (n, m) = self.shape_generic(); |
277 let (n, m) = self.shape_generic(); |
| 278 OMatrix::zeros_generic(n, m) |
278 OMatrix::zeros_generic(n, m) |
| 279 } |
279 } |
| 280 } |
280 } |
| 281 |
281 |
| 333 E: Scalar + Zero + One + Float + RealField, |
333 E: Scalar + Zero + One + Float + RealField, |
| 334 DefaultAllocator: Allocator<M>, |
334 DefaultAllocator: Allocator<M>, |
| 335 ShapeConstraint: StridesOk<E, M, U1, SM>, |
335 ShapeConstraint: StridesOk<E, M, U1, SM>, |
| 336 { |
336 { |
| 337 #[inline] |
337 #[inline] |
| 338 fn proj_ball(self, ρ: E, exp: Linfinity) -> <Self as Space>::OwnedSpace { |
338 fn proj_ball(self, ρ: E, exp: Linfinity) -> <Self as Space>::Principal { |
| 339 let mut owned = self.into_owned(); |
339 let mut owned = self.into_owned(); |
| 340 owned.proj_ball_mut(ρ, exp); |
340 owned.proj_ball_mut(ρ, exp); |
| 341 owned |
341 owned |
| 342 } |
342 } |
| 343 } |
343 } |
| 416 S: Storage<E, M>, |
416 S: Storage<E, M>, |
| 417 E: Float + Scalar + Zero + One + RealField, |
417 E: Float + Scalar + Zero + One + RealField, |
| 418 DefaultAllocator: Allocator<M>, |
418 DefaultAllocator: Allocator<M>, |
| 419 ShapeConstraint: StridesOk<E, M, U1, S>, |
419 ShapeConstraint: StridesOk<E, M, U1, S>, |
| 420 { |
420 { |
| 421 type OwnedEuclidean = OVector<E, M>; |
421 type PrincipalE = OVector<E, M>; |
| 422 |
422 |
| 423 #[inline] |
423 #[inline] |
| 424 fn dot<I: Instance<Self>>(&self, other: I) -> E { |
424 fn dot<I: Instance<Self>>(&self, other: I) -> E { |
| 425 other.eval_ref_decompose(|ref r| Vector::<E, M, S>::dot(self, r)) |
425 other.eval_ref_decompose(|ref r| Vector::<E, M, S>::dot(self, r)) |
| 426 } |
426 } |