4 : sp_mat(m+2, m+1)
5{
6 assert(!(k%2));
7 assert(k > 1 && k < 7);
8 assert(m > 2*k);
9
10 switch (k) {
11 case 2:
12 for (u32 i = 1; i < m+1; i++) {
13 at(i, i-1) = -1.0;
14 at(i, i) = 1.0;
15 }
16
17 Q << 1.0 << 1.0 << 1.0 << 1.0 << 1.0;
18 break;
19 case 4:
20
21 at(1, 0) = -11.0/12.0;
22 at(1, 1) = 17.0/24.0;
23 at(1, 2) = 3.0/8.0;
24 at(1, 3) = -5.0/24.0;
25 at(1, 4) = 1.0/24.0;
26
27 at(m, m) = 11.0/12.0;
28 at(m, m-1) = -17.0/24.0;
29 at(m, m-2) = -3.0/8.0;
30 at(m, m-3) = 5.0/24.0;
31 at(m, m-4) = -1.0/24.0;
32
33 for (u32 i = 2; i < m; i++) {
34 at(i, i-2) = 1.0/24.0;
35 at(i, i-1) = -9.0/8.0;
36 at(i, i) = 9.0/8.0;
37 at(i, i+1) = -1.0/24.0;
38 }
39
40
41 Q << 2186.0/1943.0 << 2125.0/2828.0 << 1441.0/1240.0 << 648.0/673.0
42 << 349.0/350.0 << 648.0/673.0 << 1441.0/1240.0 << 2125.0/2828.0
43 << 2186.0/1943.0;
44 break;
45 case 6:
46
47 at(1, 0) = -1627.0/1920.0;
48 at(1, 1) = 211.0/640.0;
49 at(1, 2) = 59.0/48.0;
50 at(1, 3) = -235.0/192.0;
51 at(1, 4) = 91.0/128.0;
52 at(1, 5) = -443.0/1920.0;
53 at(1, 6) = 31.0/960.0;
54 at(2, 0) = 31.0/960.0;
55 at(2, 1) = -687.0/640.0;
56 at(2, 2) = 129.0/128.0;
57 at(2, 3) = 19.0/192.0;
58 at(2, 4) = -3.0/32.0;
59 at(2, 5) = 21.0/640.0;
60 at(2, 6) = -3.0/640.0;
61
62 at(m, m) = 1627.0/1920.0;
63 at(m, m-1) = -211.0/640.0;
64 at(m, m-2) = -59.0/48.0;
65 at(m, m-3) = 235.0/192.0;
66 at(m, m-4) = -91.0/128.0;
67 at(m, m-5) = 443.0/1920.0;
68 at(m, m-6) = -31.0/960.0;
69 at(m-1, m) = -31.0/960.0;
70 at(m-1, m-1) = 687.0/640.0;
71 at(m-1, m-2) = -129.0/128.0;
72 at(m-1, m-3) = -19.0/192.0;
73 at(m-1, m-4) = 3.0/32.0;
74 at(m-1, m-5) = -21.0/640.0;
75 at(m-1, m-6) = 3.0/640.0;
76
77 for (u32 i = 3; i < m-1; i++) {
78 at(i, i-3) = -3.0/640.0;
79 at(i, i-2) = 25.0/384.0;
80 at(i, i-1) = -75.0/64.0;
81 at(i, i) = 75.0/64.0;
82 at(i, i+1) = -25.0/384.0;
83 at(i, i+2) = 3.0/640.0;
84 }
85
86 Q << 2383.0/2005.0 << 929.0/2002.0 << 887.0/531.0 << 3124.0/5901.0
87 << 1706.0/1457.0 << 457.0/467.0 << 1057.0/1061.0 << 457.0/467.0
88 << 1706.0/1457.0 << 3124.0/5901.0 << 887.0/531.0 << 929.0/2002.0
89 << 2383.0/2005.0;
90 break;
91 }
92
93
94 *this /= dx;
95}