Compilation errors fixed

This commit is contained in:
Marek Lemańczyk committed 2025-10-05 13:13:47 +02:00
1 parent 4f80baf0bc
commit ce1355c749
1 file changed
+528 -261
+528 -261
View File
@@ -142,277 +142,544 @@ public static class ULongExtensions
public ulong Element126; public ulong Element126;
public ulong Element127; public ulong Element127;
public ref ulong this[int index] public ulong this[int index]
{ {
get get
{ {
return ref GetElementRef(index); return GetElement(index);
}
set
{
SetElement(index, value);
} }
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
private ref ulong GetElementRef(int index) private ulong GetElement(int index) => index switch
{
0 => Element0,
1 => Element1,
2 => Element2,
3 => Element3,
4 => Element4,
5 => Element5,
6 => Element6,
7 => Element7,
8 => Element8,
9 => Element9,
10 => Element10,
11 => Element11,
12 => Element12,
13 => Element13,
14 => Element14,
15 => Element15,
16 => Element16,
17 => Element17,
18 => Element18,
19 => Element19,
20 => Element20,
21 => Element21,
22 => Element22,
23 => Element23,
24 => Element24,
25 => Element25,
26 => Element26,
27 => Element27,
28 => Element28,
29 => Element29,
30 => Element30,
31 => Element31,
32 => Element32,
33 => Element33,
34 => Element34,
35 => Element35,
36 => Element36,
37 => Element37,
38 => Element38,
39 => Element39,
40 => Element40,
41 => Element41,
42 => Element42,
43 => Element43,
44 => Element44,
45 => Element45,
46 => Element46,
47 => Element47,
48 => Element48,
49 => Element49,
50 => Element50,
51 => Element51,
52 => Element52,
53 => Element53,
54 => Element54,
55 => Element55,
56 => Element56,
57 => Element57,
58 => Element58,
59 => Element59,
60 => Element60,
61 => Element61,
62 => Element62,
63 => Element63,
64 => Element64,
65 => Element65,
66 => Element66,
67 => Element67,
68 => Element68,
69 => Element69,
70 => Element70,
71 => Element71,
72 => Element72,
73 => Element73,
74 => Element74,
75 => Element75,
76 => Element76,
77 => Element77,
78 => Element78,
79 => Element79,
80 => Element80,
81 => Element81,
82 => Element82,
83 => Element83,
84 => Element84,
85 => Element85,
86 => Element86,
87 => Element87,
88 => Element88,
89 => Element89,
90 => Element90,
91 => Element91,
92 => Element92,
93 => Element93,
94 => Element94,
95 => Element95,
96 => Element96,
97 => Element97,
98 => Element98,
99 => Element99,
100 => Element100,
101 => Element101,
102 => Element102,
103 => Element103,
104 => Element104,
105 => Element105,
106 => Element106,
107 => Element107,
108 => Element108,
109 => Element109,
110 => Element110,
111 => Element111,
112 => Element112,
113 => Element113,
114 => Element114,
115 => Element115,
116 => Element116,
117 => Element117,
118 => Element118,
119 => Element119,
120 => Element120,
121 => Element121,
122 => Element122,
123 => Element123,
124 => Element124,
125 => Element125,
126 => Element126,
127 => Element127,
_ => Element0,
};
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void SetElement(int index, ulong value)
{ {
switch (index) switch (index)
{ {
case 0: case 0:
return ref Element0; Element0 = value;
case 1: return;
return ref Element1; case 1:
case 2: Element1 = value;
return ref Element2; return;
case 3: case 2:
return ref Element3; Element2 = value;
case 4: return;
return ref Element4; case 3:
case 5: Element3 = value;
return ref Element5; return;
case 6: case 4:
return ref Element6; Element4 = value;
case 7: return;
return ref Element7; case 5:
case 8: Element5 = value;
return ref Element8; return;
case 9: case 6:
return ref Element9; Element6 = value;
case 10: return;
return ref Element10; case 7:
case 11: Element7 = value;
return ref Element11; return;
case 12: case 8:
return ref Element12; Element8 = value;
case 13: return;
return ref Element13; case 9:
case 14: Element9 = value;
return ref Element14; return;
case 15: case 10:
return ref Element15; Element10 = value;
case 16: return;
return ref Element16; case 11:
case 17: Element11 = value;
return ref Element17; return;
case 18: case 12:
return ref Element18; Element12 = value;
case 19: return;
return ref Element19; case 13:
case 20: Element13 = value;
return ref Element20; return;
case 21: case 14:
return ref Element21; Element14 = value;
case 22: return;
return ref Element22; case 15:
case 23: Element15 = value;
return ref Element23; return;
case 24: case 16:
return ref Element24; Element16 = value;
case 25: return;
return ref Element25; case 17:
case 26: Element17 = value;
return ref Element26; return;
case 27: case 18:
return ref Element27; Element18 = value;
case 28: return;
return ref Element28; case 19:
case 29: Element19 = value;
return ref Element29; return;
case 30: case 20:
return ref Element30; Element20 = value;
case 31: return;
return ref Element31; case 21:
case 32: Element21 = value;
return ref Element32; return;
case 33: case 22:
return ref Element33; Element22 = value;
case 34: return;
return ref Element34; case 23:
case 35: Element23 = value;
return ref Element35; return;
case 36: case 24:
return ref Element36; Element24 = value;
case 37: return;
return ref Element37; case 25:
case 38: Element25 = value;
return ref Element38; return;
case 39: case 26:
return ref Element39; Element26 = value;
case 40: return;
return ref Element40; case 27:
case 41: Element27 = value;
return ref Element41; return;
case 42: case 28:
return ref Element42; Element28 = value;
case 43: return;
return ref Element43; case 29:
case 44: Element29 = value;
return ref Element44; return;
case 45: case 30:
return ref Element45; Element30 = value;
case 46: return;
return ref Element46; case 31:
case 47: Element31 = value;
return ref Element47; return;
case 48: case 32:
return ref Element48; Element32 = value;
case 49: return;
return ref Element49; case 33:
case 50: Element33 = value;
return ref Element50; return;
case 51: case 34:
return ref Element51; Element34 = value;
case 52: return;
return ref Element52; case 35:
case 53: Element35 = value;
return ref Element53; return;
case 54: case 36:
return ref Element54; Element36 = value;
case 55: return;
return ref Element55; case 37:
case 56: Element37 = value;
return ref Element56; return;
case 57: case 38:
return ref Element57; Element38 = value;
case 58: return;
return ref Element58; case 39:
case 59: Element39 = value;
return ref Element59; return;
case 60: case 40:
return ref Element60; Element40 = value;
case 61: return;
return ref Element61; case 41:
case 62: Element41 = value;
return ref Element62; return;
case 63: case 42:
return ref Element63; Element42 = value;
case 64: return;
return ref Element64; case 43:
case 65: Element43 = value;
return ref Element65; return;
case 66: case 44:
return ref Element66; Element44 = value;
case 67: return;
return ref Element67; case 45:
case 68: Element45 = value;
return ref Element68; return;
case 69: case 46:
return ref Element69; Element46 = value;
case 70: return;
return ref Element70; case 47:
case 71: Element47 = value;
return ref Element71; return;
case 72: case 48:
return ref Element72; Element48 = value;
case 73: return;
return ref Element73; case 49:
case 74: Element49 = value;
return ref Element74; return;
case 75: case 50:
return ref Element75; Element50 = value;
case 76: return;
return ref Element76; case 51:
case 77: Element51 = value;
return ref Element77; return;
case 78: case 52:
return ref Element78; Element52 = value;
case 79: return;
return ref Element79; case 53:
case 80: Element53 = value;
return ref Element80; return;
case 81: case 54:
return ref Element81; Element54 = value;
case 82: return;
return ref Element82; case 55:
case 83: Element55 = value;
return ref Element83; return;
case 84: case 56:
return ref Element84; Element56 = value;
case 85: return;
return ref Element85; case 57:
case 86: Element57 = value;
return ref Element86; return;
case 87: case 58:
return ref Element87; Element58 = value;
case 88: return;
return ref Element88; case 59:
case 89: Element59 = value;
return ref Element89; return;
case 90: case 60:
return ref Element90; Element60 = value;
case 91: return;
return ref Element91; case 61:
case 92: Element61 = value;
return ref Element92; return;
case 93: case 62:
return ref Element93; Element62 = value;
case 94: return;
return ref Element94; case 63:
case 95: Element63 = value;
return ref Element95; return;
case 96: case 64:
return ref Element96; Element64 = value;
case 97: return;
return ref Element97; case 65:
case 98: Element65 = value;
return ref Element98; return;
case 99: case 66:
return ref Element99; Element66 = value;
case 100: return;
return ref Element100; case 67:
case 101: Element67 = value;
return ref Element101; return;
case 102: case 68:
return ref Element102; Element68 = value;
case 103: return;
return ref Element103; case 69:
case 104: Element69 = value;
return ref Element104; return;
case 105: case 70:
return ref Element105; Element70 = value;
case 106: return;
return ref Element106; case 71:
case 107: Element71 = value;
return ref Element107; return;
case 108: case 72:
return ref Element108; Element72 = value;
case 109: return;
return ref Element109; case 73:
case 110: Element73 = value;
return ref Element110; return;
case 111: case 74:
return ref Element111; Element74 = value;
case 112: return;
return ref Element112; case 75:
case 113: Element75 = value;
return ref Element113; return;
case 114: case 76:
return ref Element114; Element76 = value;
case 115: return;
return ref Element115; case 77:
case 116: Element77 = value;
return ref Element116; return;
case 117: case 78:
return ref Element117; Element78 = value;
case 118: return;
return ref Element118; case 79:
case 119: Element79 = value;
return ref Element119; return;
case 120: case 80:
return ref Element120; Element80 = value;
case 121: return;
return ref Element121; case 81:
case 122: Element81 = value;
return ref Element122; return;
case 123: case 82:
return ref Element123; Element82 = value;
case 124: return;
return ref Element124; case 83:
case 125: Element83 = value;
return ref Element125; return;
case 126: case 84:
return ref Element126; Element84 = value;
case 127: return;
return ref Element127; case 85:
default: Element85 = value;
return ref Element0; return;
case 86:
Element86 = value;
return;
case 87:
Element87 = value;
return;
case 88:
Element88 = value;
return;
case 89:
Element89 = value;
return;
case 90:
Element90 = value;
return;
case 91:
Element91 = value;
return;
case 92:
Element92 = value;
return;
case 93:
Element93 = value;
return;
case 94:
Element94 = value;
return;
case 95:
Element95 = value;
return;
case 96:
Element96 = value;
return;
case 97:
Element97 = value;
return;
case 98:
Element98 = value;
return;
case 99:
Element99 = value;
return;
case 100:
Element100 = value;
return;
case 101:
Element101 = value;
return;
case 102:
Element102 = value;
return;
case 103:
Element103 = value;
return;
case 104:
Element104 = value;
return;
case 105:
Element105 = value;
return;
case 106:
Element106 = value;
return;
case 107:
Element107 = value;
return;
case 108:
Element108 = value;
return;
case 109:
Element109 = value;
return;
case 110:
Element110 = value;
return;
case 111:
Element111 = value;
return;
case 112:
Element112 = value;
return;
case 113:
Element113 = value;
return;
case 114:
Element114 = value;
return;
case 115:
Element115 = value;
return;
case 116:
Element116 = value;
return;
case 117:
Element117 = value;
return;
case 118:
Element118 = value;
return;
case 119:
Element119 = value;
return;
case 120:
Element120 = value;
return;
case 121:
Element121 = value;
return;
case 122:
Element122 = value;
return;
case 123:
Element123 = value;
return;
case 124:
Element124 = value;
return;
case 125:
Element125 = value;
return;
case 126:
Element126 = value;
return;
case 127:
Element127 = value;
return;
default:
throw new ArgumentOutOfRangeException(nameof(index), index, "Pow2OddPowerTable index must be between 0 and 127.");
} }
} }
} }