src/nalgebra_support.rs

branch
dev
changeset 168
93daa824c04a
parent 167
effb80efba09
child 169
114ecdf63ce5
equal deleted inserted replaced
167:effb80efba09 168:93daa824c04a
143 K: Dim, 143 K: Dim,
144 E: Scalar + Zero + One + Copy, 144 E: Scalar + Zero + One + Copy,
145 DefaultAllocator: Allocator<M, K>, 145 DefaultAllocator: Allocator<M, K>,
146 ShapeConstraint: StridesOk<E, M, K, S1> + StridesOk<E, M, K, S2>, 146 ShapeConstraint: StridesOk<E, M, K, S1> + StridesOk<E, M, K, S2>,
147 { 147 {
148 #[inline]
148 fn eval_decompose<'b, R>(self, f: impl FnOnce(OMatrix<E, M, K>) -> R) -> R 149 fn eval_decompose<'b, R>(self, f: impl FnOnce(OMatrix<E, M, K>) -> R) -> R
149 where 150 where
150 Self: 'b, 151 Self: 'b,
151 { 152 {
152 f(self.into_owned()) 153 f(self.into_owned())
153 } 154 }
154 155
156 #[inline]
155 fn eval_ref_decompose<'b, R>( 157 fn eval_ref_decompose<'b, R>(
156 &'b self, 158 &'b self,
157 f: impl FnOnce(<MatrixDecomposition as Decomposition<Matrix<E, M, K, S1>>>::Reference<'b>) -> R, 159 f: impl FnOnce(<MatrixDecomposition as Decomposition<Matrix<E, M, K, S1>>>::Reference<'b>) -> R,
158 ) -> R 160 ) -> R
159 where 161 where
165 167
166 #[inline] 168 #[inline]
167 fn own(self) -> OMatrix<E, M, K> { 169 fn own(self) -> OMatrix<E, M, K> {
168 self.into_owned() 170 self.into_owned()
169 } 171 }
172
173 #[inline]
174 fn cow<'b>(self) -> MyCow<'b, OMatrix<E, M, K>>
175 where
176 Self: 'b,
177 {
178 self.cow_owned()
179 }
170 } 180 }
171 181
172 impl<'a, S1, S2, M, K, E> Instance<Matrix<E, M, K, S1>, MatrixDecomposition> 182 impl<'a, S1, S2, M, K, E> Instance<Matrix<E, M, K, S1>, MatrixDecomposition>
173 for &'a Matrix<E, M, K, S2> 183 for &'a Matrix<E, M, K, S2>
174 where 184 where
199 } 209 }
200 210
201 #[inline] 211 #[inline]
202 fn own(self) -> OMatrix<E, M, K> { 212 fn own(self) -> OMatrix<E, M, K> {
203 self.into_owned() 213 self.into_owned()
214 }
215
216 #[inline]
217 fn cow<'b>(self) -> MyCow<'b, OMatrix<E, M, K>>
218 where
219 Self: 'b,
220 {
221 self.cow_owned()
204 } 222 }
205 } 223 }
206 224
207 impl<SM, SV, N, M, K, E> Mapping<Matrix<E, M, K, SV>> for Matrix<E, N, M, SM> 225 impl<SM, SV, N, M, K, E> Mapping<Matrix<E, M, K, SV>> for Matrix<E, N, M, SM>
208 where 226 where

mercurial