src/discrete_gradient.rs

branch
dev
changeset 124
6aa955ad8122
parent 110
a1278320be26
child 133
2b13f8a0c8ba
equal deleted inserted replaced
122:495448cca603 124:6aa955ad8122
390 390
391 impl<F, B, const N: usize> BoundedLinear<DVector<F>, L2, L2, F> for Grad<F, B, N> 391 impl<F, B, const N: usize> BoundedLinear<DVector<F>, L2, L2, F> for Grad<F, B, N>
392 where 392 where
393 B: Discretisation<F>, 393 B: Discretisation<F>,
394 F: Float + nalgebra::RealField, 394 F: Float + nalgebra::RealField,
395 DVector<F>: Norm<F, L2>, 395 DVector<F>: Norm<L2, F>,
396 { 396 {
397 fn opnorm_bound(&self, _: L2, _: L2) -> DynResult<F> { 397 fn opnorm_bound(&self, _: L2, _: L2) -> DynResult<F> {
398 // Fuck nalgebra. 398 // Fuck nalgebra.
399 self.discretisation 399 self.discretisation
400 .opnorm_bound(num_traits::Float::abs(self.h)) 400 .opnorm_bound(num_traits::Float::abs(self.h))
403 403
404 impl<F, B, const N: usize> BoundedLinear<DVector<F>, L2, L2, F> for Div<F, B, N> 404 impl<F, B, const N: usize> BoundedLinear<DVector<F>, L2, L2, F> for Div<F, B, N>
405 where 405 where
406 B: Discretisation<F>, 406 B: Discretisation<F>,
407 F: Float + nalgebra::RealField, 407 F: Float + nalgebra::RealField,
408 DVector<F>: Norm<F, L2>, 408 DVector<F>: Norm<L2, F>,
409 { 409 {
410 fn opnorm_bound(&self, _: L2, _: L2) -> DynResult<F> { 410 fn opnorm_bound(&self, _: L2, _: L2) -> DynResult<F> {
411 // Fuck nalgebra. 411 // Fuck nalgebra.
412 self.discretisation 412 self.discretisation
413 .opnorm_bound(num_traits::Float::abs(self.h)) 413 .opnorm_bound(num_traits::Float::abs(self.h))

mercurial