src/nalgebra_support.rs

branch
dev
changeset 170
221728aeeb7e
parent 169
114ecdf63ce5
child 171
fa8df5a14486
equal deleted inserted replaced
169:114ecdf63ce5 170:221728aeeb7e
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 #[inline]
149 fn either<'b, R>(
150 self,
151 f: impl FnOnce(OMatrix<E, M, K>) -> R,
152 _g: impl FnOnce(MatrixView<'b, E, M, K, Dyn, Dyn>) -> R,
153 ) -> R
154 where
155 Self: 'b,
156 {
157 // TODO: should not turn non-owned matrices into owned
158 f(self.into_owned())
159 }
160
161 #[inline]
149 fn eval_decompose<'b, R>(self, f: impl FnOnce(OMatrix<E, M, K>) -> R) -> R 162 fn eval_decompose<'b, R>(self, f: impl FnOnce(OMatrix<E, M, K>) -> R) -> R
150 where 163 where
151 Self: 'b, 164 Self: 'b,
152 { 165 {
153 f(self.into_owned()) 166 f(self.into_owned())
188 K: Dim, 201 K: Dim,
189 E: Scalar + Zero + One + Copy, 202 E: Scalar + Zero + One + Copy,
190 DefaultAllocator: Allocator<M, K>, 203 DefaultAllocator: Allocator<M, K>,
191 ShapeConstraint: StridesOk<E, M, K, S1> + StridesOk<E, M, K, S2>, 204 ShapeConstraint: StridesOk<E, M, K, S1> + StridesOk<E, M, K, S2>,
192 { 205 {
206 #[inline]
207 fn either<'b, R>(
208 self,
209 _f: impl FnOnce(OMatrix<E, M, K>) -> R,
210 g: impl FnOnce(MatrixView<'b, E, M, K, Dyn, Dyn>) -> R,
211 ) -> R
212 where
213 Self: 'b,
214 {
215 g(self.as_view())
216 }
217
193 fn eval_decompose<'b, R>(self, f: impl FnOnce(OMatrix<E, M, K>) -> R) -> R 218 fn eval_decompose<'b, R>(self, f: impl FnOnce(OMatrix<E, M, K>) -> R) -> R
194 where 219 where
195 Self: 'b, 220 Self: 'b,
196 { 221 {
197 f(self.into_owned()) 222 f(self.into_owned())

mercurial