summaryrefslogtreecommitdiff
path: root/src/LLBM/initialize.h
blob: b361217c2b05124f639713247d51e1fa8122d672 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once

#include "concepts.h"

struct InitializeO {

template <concepts::Arithmetic V, concepts::Arithmetic T = V>
static void apply(V f_curr[19], V f_next[19]) {
	f_next[0] = T{0.0277777777777778};
	f_next[1] = T{0.0277777777777778};
	f_next[2] = T{0.0555555555555556};
	f_next[3] = T{0.0277777777777778};
	f_next[4] = T{0.0277777777777778};
	f_next[5] = T{0.0277777777777778};
	f_next[6] = T{0.0555555555555556};
	f_next[7] = T{0.0277777777777778};
	f_next[8] = T{0.0555555555555556};
	f_next[9] = T{0.333333333333333};
	f_next[10] = T{0.0555555555555556};
	f_next[11] = T{0.0277777777777778};
	f_next[12] = T{0.0555555555555556};
	f_next[13] = T{0.0277777777777778};
	f_next[14] = T{0.0277777777777778};
	f_next[15] = T{0.0277777777777778};
	f_next[16] = T{0.0555555555555556};
	f_next[17] = T{0.0277777777777778};
	f_next[18] = T{0.0277777777777778};
}

template <concepts::Arithmetic V, concepts::Arithmetic T = V>
static void apply(V f_curr[19], V f_next[19], T scale) {
	f_next[0]  = T{scale * 0.0277777777777778};
	f_next[1]  = T{scale * 0.0277777777777778};
	f_next[2]  = T{scale * 0.0555555555555556};
	f_next[3]  = T{scale * 0.0277777777777778};
	f_next[4]  = T{scale * 0.0277777777777778};
	f_next[5]  = T{scale * 0.0277777777777778};
	f_next[6]  = T{scale * 0.0555555555555556};
	f_next[7]  = T{scale * 0.0277777777777778};
	f_next[8]  = T{scale * 0.0555555555555556};
	f_next[9]  = T{scale * 0.333333333333333};
	f_next[10] = T{scale * 0.0555555555555556};
	f_next[11] = T{scale * 0.0277777777777778};
	f_next[12] = T{scale * 0.0555555555555556};
	f_next[13] = T{scale * 0.0277777777777778};
	f_next[14] = T{scale * 0.0277777777777778};
	f_next[15] = T{scale * 0.0277777777777778};
	f_next[16] = T{scale * 0.0555555555555556};
	f_next[17] = T{scale * 0.0277777777777778};
	f_next[18] = T{scale * 0.0277777777777778};
}

};