123 fn proj_ball_mut(&mut self, ρ : E, _ : Linfinity) { |
123 fn proj_ball_mut(&mut self, ρ : E, _ : Linfinity) { |
124 self.iter_mut().for_each(|v| *v = num_traits::clamp(*v, -ρ, ρ)) |
124 self.iter_mut().for_each(|v| *v = num_traits::clamp(*v, -ρ, ρ)) |
125 } |
125 } |
126 } |
126 } |
127 |
127 |
128 impl<'own,SV1,SV2,SM,N,M,K,E> Adjointable<Matrix<E,M,K,SV1>, Matrix<E,N,K,SV2>> |
128 impl<'own,SV,SM,N,M,E> Adjointable<Vector<E,M,SV>, E> |
129 for Matrix<E,N,M,SM> |
129 for Matrix<E,N,M,SM> |
130 where SM: Storage<E,N,M>, SV1: Storage<E,M,K> + Clone, SV2: Storage<E,N,K> + Clone, |
130 where |
131 N : Dim, M : Dim, K : Dim, E : Scalar + Zero + One + SimdComplexField, |
131 SM: Storage<E,N,M>, SV: Storage<E,M> + Clone, |
132 DefaultAllocator : Allocator<N,K>, |
132 N : Dim, M : Dim, E : Scalar + Zero + One + RealField + Float, |
133 DefaultAllocator : Allocator<M,K>, |
133 DefaultAllocator : Allocator<M>, |
134 DefaultAllocator : Allocator<N,M>, |
134 DefaultAllocator : Allocator<N>, |
135 DefaultAllocator : Allocator<M,N> { |
135 DefaultAllocator : Allocator<N,M>, |
136 type AdjointCodomain = OMatrix<E,M,K>; |
136 DefaultAllocator : Allocator<M,N>, |
|
137 OMatrix<E,M,N> : Linear<OVector<E, N>, Codomain = OVector<E, M>>, |
|
138 { |
|
139 type AdjointCodomain = OVector<E, M>; |
137 type Adjoint<'a> = OMatrix<E,M,N> where SM : 'a; |
140 type Adjoint<'a> = OMatrix<E,M,N> where SM : 'a; |
138 |
141 |
139 #[inline] |
142 #[inline] |
140 fn adjoint(&self) -> Self::Adjoint<'_> { |
143 fn adjoint(&self) -> Self::Adjoint<'_> { |
141 Matrix::adjoint(self) |
144 Matrix::adjoint(self) |
240 } |
243 } |
241 } |
244 } |
242 |
245 |
243 impl<E,M,S> HasDual<E> |
246 impl<E,M,S> HasDual<E> |
244 for Vector<E,M,S> |
247 for Vector<E,M,S> |
245 where M : Dim, |
248 where |
246 S : Storage<E,M> + Clone, |
249 M : Dim, |
247 E : Float + Scalar + Zero + One + RealField, |
250 S : Storage<E,M> + Clone, |
248 DefaultAllocator : Allocator<M> { |
251 E : Float + Scalar + Zero + One + RealField, |
|
252 DefaultAllocator : Allocator<M> |
|
253 { |
249 // TODO: Doesn't work with different storage formats. |
254 // TODO: Doesn't work with different storage formats. |
250 type DualSpace = Self; |
255 type DualSpace = Self; |
251 } |
256 } |
252 |
257 |
253 impl<E,M,S> Norm<E, L1> |
258 impl<E,M,S> Norm<E, L1> |