From a26befec3a26c01f43bd3630897797a0c58557b2 Mon Sep 17 00:00:00 2001 From: Magnus Ulimoen Date: Thu, 12 Dec 2019 20:39:46 +0100 Subject: [PATCH] align block matrix --- src/operators/upwind4.rs | 57 +++++++++------------------------------- 1 file changed, 12 insertions(+), 45 deletions(-) diff --git a/src/operators/upwind4.rs b/src/operators/upwind4.rs index 9bc32c7..bf286fe 100644 --- a/src/operators/upwind4.rs +++ b/src/operators/upwind4.rs @@ -7,53 +7,20 @@ type SimdT = packed_simd::f32x8; pub struct Upwind4 {} impl Upwind4 { - const HBLOCK: &'static [f32] = &[49.0 / 144.0, 61.0 / 48.0, 41.0 / 48.0, 149.0 / 144.0]; - const DIAG: &'static [f32] = &[ - -1.0 / 24.0, - 1.0 / 4.0, - -7.0 / 8.0, - 0.0, - 7.0 / 8.0, - -1.0 / 4.0, - 1.0 / 24.0, + #[rustfmt::skip] + const HBLOCK: &'static [f32] = &[ + 49.0 / 144.0, 61.0 / 48.0, 41.0 / 48.0, 149.0 / 144.0 ]; + #[rustfmt::skip] + const DIAG: &'static [f32] = &[ + -1.0 / 24.0, 1.0 / 4.0, -7.0 / 8.0, 0.0, 7.0 / 8.0, -1.0 / 4.0, 1.0 / 24.0 + ]; + #[rustfmt::skip] const BLOCK: &'static [[f32; 7]] = &[ - [ - -72.0 / 49.0_f32, - 187.0 / 98.0, - -20.0 / 49.0, - -3.0 / 98.0, - 0.0, - 0.0, - 0.0, - ], - [ - -187.0 / 366.0, - 0.0, - 69.0 / 122.0, - -16.0 / 183.0, - 2.0 / 61.0, - 0.0, - 0.0, - ], - [ - 20.0 / 123.0, - -69.0 / 82.0, - 0.0, - 227.0 / 246.0, - -12.0 / 41.0, - 2.0 / 41.0, - 0.0, - ], - [ - 3.0 / 298.0, - 16.0 / 149.0, - -227.0 / 298.0, - 0.0, - 126.0 / 149.0, - -36.0 / 149.0, - 6.0 / 149.0, - ], + [ -72.0 / 49.0, 187.0 / 98.0, -20.0 / 49.0, -3.0 / 98.0, 0.0, 0.0, 0.0], + [-187.0 / 366.0, 0.0, 69.0 / 122.0, -16.0 / 183.0, 2.0 / 61.0, 0.0, 0.0], + [ 20.0 / 123.0, -69.0 / 82.0, 0.0, 227.0 / 246.0, -12.0 / 41.0, 2.0 / 41.0, 0.0], + [ 3.0 / 298.0, 16.0 / 149.0, -227.0 / 298.0, 0.0, 126.0 / 149.0, -36.0 / 149.0, 6.0 / 149.0], ]; #[inline(never)]