align block matrix

This commit is contained in:
Magnus Ulimoen 2019-12-12 20:39:46 +01:00
parent 285950a5c3
commit a26befec3a
1 changed files with 12 additions and 45 deletions

View File

@ -7,53 +7,20 @@ type SimdT = packed_simd::f32x8;
pub struct Upwind4 {} pub struct Upwind4 {}
impl Upwind4 { impl Upwind4 {
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] = &[ const HBLOCK: &'static [f32] = &[
-1.0 / 24.0, 49.0 / 144.0, 61.0 / 48.0, 41.0 / 48.0, 149.0 / 144.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 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]] = &[ const BLOCK: &'static [[f32; 7]] = &[
[ [ -72.0 / 49.0, 187.0 / 98.0, -20.0 / 49.0, -3.0 / 98.0, 0.0, 0.0, 0.0],
-72.0 / 49.0_f32, [-187.0 / 366.0, 0.0, 69.0 / 122.0, -16.0 / 183.0, 2.0 / 61.0, 0.0, 0.0],
187.0 / 98.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],
-20.0 / 49.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],
-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)] #[inline(never)]