mapFolding 0.15.3__py3-none-any.whl → 0.15.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mapFolding/__init__.py +15 -11
- mapFolding/_theSSOT.py +55 -62
- mapFolding/_theTypes.py +66 -4
- mapFolding/algorithms/__init__.py +1 -0
- mapFolding/algorithms/matrixMeanders.py +348 -0
- mapFolding/algorithms/oeisIDbyFormula.py +113 -0
- mapFolding/basecamp.py +55 -3
- mapFolding/oeis.py +40 -54
- mapFolding/{_oeisFormulas/matrixMeanders64.py → reference/meandersDumpingGround/matrixMeanders64retired.py} +37 -29
- mapFolding/someAssemblyRequired/makeAllModules.py +5 -5
- mapFolding/syntheticModules/algorithmA007822Numba.py +4 -2
- mapFolding/tests/conftest.py +28 -9
- mapFolding/tests/test_computations.py +31 -9
- mapFolding/tests/test_oeis.py +2 -20
- {mapfolding-0.15.3.dist-info → mapfolding-0.15.4.dist-info}/METADATA +1 -1
- {mapfolding-0.15.3.dist-info → mapfolding-0.15.4.dist-info}/RECORD +33 -47
- {mapfolding-0.15.3.dist-info → mapfolding-0.15.4.dist-info}/entry_points.txt +0 -1
- mapFolding/_oeisFormulas/A000136.py +0 -4
- mapFolding/_oeisFormulas/A000560.py +0 -4
- mapFolding/_oeisFormulas/A000682.py +0 -85
- mapFolding/_oeisFormulas/A001010.py +0 -19
- mapFolding/_oeisFormulas/A001011.py +0 -5
- mapFolding/_oeisFormulas/A005315.py +0 -4
- mapFolding/_oeisFormulas/A005316.py +0 -10
- mapFolding/_oeisFormulas/A223094.py +0 -7
- mapFolding/_oeisFormulas/A259702.py +0 -4
- mapFolding/_oeisFormulas/A301620.py +0 -6
- mapFolding/_oeisFormulas/Z0Z_aOFn.py +0 -34
- mapFolding/_oeisFormulas/Z0Z_notes.py +0 -16
- mapFolding/_oeisFormulas/Z0Z_oeisMeanders.py +0 -74
- mapFolding/_oeisFormulas/Z0Z_symmetry.py +0 -131
- mapFolding/_oeisFormulas/__init__.py +0 -1
- mapFolding/_oeisFormulas/matrixMeanders.py +0 -134
- mapFolding/_oeisFormulas/matrixMeandersAnnex.py +0 -84
- /mapFolding/{daoOfMapFolding.py → algorithms/daoOfMapFolding.py} +0 -0
- /mapFolding/reference/{A005316JavaPort.py → meandersDumpingGround/A005316JavaPort.py} +0 -0
- /mapFolding/reference/{A005316imperative.py → meandersDumpingGround/A005316imperative.py} +0 -0
- /mapFolding/reference/{A005316intOptimized.py → meandersDumpingGround/A005316intOptimized.py} +0 -0
- /mapFolding/reference/{A005316optimized128bit.py → meandersDumpingGround/A005316optimized128bit.py} +0 -0
- /mapFolding/reference/{A005316primitiveOptimized.py → meandersDumpingGround/A005316primitiveOptimized.py} +0 -0
- /mapFolding/reference/{A005316redis.py → meandersDumpingGround/A005316redis.py} +0 -0
- /mapFolding/reference/{A005316write2disk.py → meandersDumpingGround/A005316write2disk.py} +0 -0
- /mapFolding/reference/{matrixMeandersBaseline.py → meandersDumpingGround/matrixMeandersBaseline.py} +0 -0
- /mapFolding/reference/{matrixMeandersBaselineAnnex.py → meandersDumpingGround/matrixMeandersBaselineAnnex.py} +0 -0
- /mapFolding/reference/{matrixMeandersBaselineV2.py → meandersDumpingGround/matrixMeandersBaselineV2.py} +0 -0
- /mapFolding/reference/{matrixMeandersSimpleQueue.py → meandersDumpingGround/matrixMeandersSimpleQueue.py} +0 -0
- /mapFolding/reference/{matrixMeandersSlicePop.py → meandersDumpingGround/matrixMeandersSlicePop.py} +0 -0
- {mapfolding-0.15.3.dist-info → mapfolding-0.15.4.dist-info}/WHEEL +0 -0
- {mapfolding-0.15.3.dist-info → mapfolding-0.15.4.dist-info}/licenses/LICENSE +0 -0
- {mapfolding-0.15.3.dist-info → mapfolding-0.15.4.dist-info}/top_level.txt +0 -0
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
from mapFolding._oeisFormulas.A000682 import A000682
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
How to A000682:
|
|
6
|
-
- Start A000682 for n.
|
|
7
|
-
- Find A000560(n-1) in dictionaryCurveLocationsKnown or dictionaryCurveLocationsDiscovered.
|
|
8
|
-
- STOP computing.
|
|
9
|
-
- Double the total.
|
|
10
|
-
That is A000682.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
How to A259703:
|
|
14
|
-
- Start A000682 for n.
|
|
15
|
-
- Find n-1 keys in dictionaryCurveLocationsKnown or dictionaryCurveLocationsDiscovered.
|
|
16
|
-
- Descending sort.
|
|
17
|
-
That is a A259703 row.
|
|
18
|
-
|
|
19
|
-
https://oeis.org/A259703
|
|
20
|
-
|
|
21
|
-
SYMMETRY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
22
|
-
|
|
23
|
-
1;
|
|
24
|
-
1, 1;
|
|
25
|
-
2, 1, 1;
|
|
26
|
-
5, 2, 2, 1;
|
|
27
|
-
12, 5, 4, 2, 1;
|
|
28
|
-
33, 13, 12, 4, 3, 1;
|
|
29
|
-
87, 35, 30, 12, 6, 3, 1;
|
|
30
|
-
252, 98, 90, 32, 21, 6, 4, 1;
|
|
31
|
-
703, 278, 243, 94, 54, 21, 8, 4, 1;
|
|
32
|
-
2105, 812, 745, 270, 175, 57, 32, 8, 5, 1;
|
|
33
|
-
6099, 2385, 2108, 808, 485, 181, 84, 32, 10, 5, 1;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
n+1
|
|
37
|
-
Row sums are A000682. First column is A000560.
|
|
38
|
-
Row sums are A000682. First column is A000560.
|
|
39
|
-
Row sums are A000682. First column is A000560.
|
|
40
|
-
Row sums are A000682. First column is A000560.
|
|
41
|
-
Row sums are A000682. First column is A000560.
|
|
42
|
-
Row sums are A000682. First column is A000560.
|
|
43
|
-
Row sums are A000682. First column is A000560.
|
|
44
|
-
Row sums are A000682. First column is A000560.
|
|
45
|
-
|
|
46
|
-
n/a;
|
|
47
|
-
1= 1;
|
|
48
|
-
2= 1+ 1;
|
|
49
|
-
5= 2+ 2+ 1;
|
|
50
|
-
12= 5+ 4+ 2+ 1;
|
|
51
|
-
33= 13+ 12+ 4+ 3+ 1;
|
|
52
|
-
87= 35+ 30+ 12+ 6+ 3+ 1;
|
|
53
|
-
252= 98+ 90+ 32+ 21+ 6+ 4+ 1;
|
|
54
|
-
703= 278+ 243+ 94+ 54+ 21+ 8+ 4+ 1;
|
|
55
|
-
2105= 812+ 745+ 270+ 175+ 57+ 32+ 8+ 5+ 1;
|
|
56
|
-
6099= 2385+ 2108+ 808+ 485+ 181+ 84+ 32+ 10+ 5+ 1;
|
|
57
|
-
|
|
58
|
-
print(1== 1)
|
|
59
|
-
print(2== 1+ 1)
|
|
60
|
-
print(5== 2+ 2+ 1)
|
|
61
|
-
print(12== 5+ 4+ 2+ 1)
|
|
62
|
-
print(33== 13+ 12+ 4+ 3+ 1)
|
|
63
|
-
print(87== 35+ 30+ 12+ 6+ 3+ 1)
|
|
64
|
-
print(252== 98+ 90+ 32+ 21+ 6+ 4+ 1)
|
|
65
|
-
print(703== 278+ 243+ 94+ 54+ 21+ 8+ 4+ 1)
|
|
66
|
-
print(2105== 812+ 745+ 270+ 175+ 57+ 32+ 8+ 5+ 1)
|
|
67
|
-
print(6099== 2385+ 2108+ 808+ 485+ 181+ 84+ 32+ 10+ 5+ 1)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"""
|
|
71
|
-
|
|
72
|
-
listA259703rowTerms = [1, 1]
|
|
73
|
-
n = len(listA259703rowTerms) + 1
|
|
74
|
-
rowSum = sum(listA259703rowTerms)
|
|
75
|
-
A000682for_n = A000682(n)
|
|
76
|
-
print(rowSum == A000682for_n, f"{n = }, {A000682for_n = }, {rowSum = }")
|
|
77
|
-
|
|
78
|
-
listA259703rowTerms = [2, 1, 1]
|
|
79
|
-
n = len(listA259703rowTerms) + 1
|
|
80
|
-
rowSum = sum(listA259703rowTerms)
|
|
81
|
-
A000682for_n = A000682(n)
|
|
82
|
-
print(rowSum == A000682for_n, f"{n = }, {A000682for_n = }, {rowSum = }")
|
|
83
|
-
|
|
84
|
-
listA259703rowTerms = [5, 2, 2, 1]
|
|
85
|
-
n = len(listA259703rowTerms) + 1
|
|
86
|
-
rowSum = sum(listA259703rowTerms)
|
|
87
|
-
A000682for_n = A000682(n)
|
|
88
|
-
print(rowSum == A000682for_n, f"{n = }, {A000682for_n = }, {rowSum = }")
|
|
89
|
-
|
|
90
|
-
listA259703rowTerms = [12, 5, 4, 2, 1]
|
|
91
|
-
n = len(listA259703rowTerms) + 1
|
|
92
|
-
rowSum = sum(listA259703rowTerms)
|
|
93
|
-
A000682for_n = A000682(n)
|
|
94
|
-
print(rowSum == A000682for_n, f"{n = }, {A000682for_n = }, {rowSum = }")
|
|
95
|
-
|
|
96
|
-
listA259703rowTerms = [33, 13, 12, 4, 3, 1]
|
|
97
|
-
n = len(listA259703rowTerms) + 1
|
|
98
|
-
rowSum = sum(listA259703rowTerms)
|
|
99
|
-
A000682for_n = A000682(n)
|
|
100
|
-
print(rowSum == A000682for_n, f"{n = }, {A000682for_n = }, {rowSum = }")
|
|
101
|
-
|
|
102
|
-
listA259703rowTerms = [87, 35, 30, 12, 6, 3, 1]
|
|
103
|
-
n = len(listA259703rowTerms) + 1
|
|
104
|
-
rowSum = sum(listA259703rowTerms)
|
|
105
|
-
A000682for_n = A000682(n)
|
|
106
|
-
print(rowSum == A000682for_n, f"{n = }, {A000682for_n = }, {rowSum = }")
|
|
107
|
-
|
|
108
|
-
listA259703rowTerms = [252, 98, 90, 32, 21, 6, 4, 1]
|
|
109
|
-
n = len(listA259703rowTerms) + 1
|
|
110
|
-
rowSum = sum(listA259703rowTerms)
|
|
111
|
-
A000682for_n = A000682(n)
|
|
112
|
-
print(rowSum == A000682for_n, f"{n = }, {A000682for_n = }, {rowSum = }")
|
|
113
|
-
|
|
114
|
-
listA259703rowTerms = [703, 278, 243, 94, 54, 21, 8, 4, 1]
|
|
115
|
-
n = len(listA259703rowTerms) + 1
|
|
116
|
-
rowSum = sum(listA259703rowTerms)
|
|
117
|
-
A000682for_n = A000682(n)
|
|
118
|
-
print(rowSum == A000682for_n, f"{n = }, {A000682for_n = }, {rowSum = }")
|
|
119
|
-
|
|
120
|
-
listA259703rowTerms = [2105, 812, 745, 270, 175, 57, 32, 8, 5, 1]
|
|
121
|
-
n = len(listA259703rowTerms) + 1
|
|
122
|
-
rowSum = sum(listA259703rowTerms)
|
|
123
|
-
A000682for_n = A000682(n)
|
|
124
|
-
print(rowSum == A000682for_n, f"{n = }, {A000682for_n = }, {rowSum = }")
|
|
125
|
-
|
|
126
|
-
listA259703rowTerms = [6099, 2385, 2108, 808, 485, 181, 84, 32, 10, 5, 1]
|
|
127
|
-
n = len(listA259703rowTerms) + 1
|
|
128
|
-
rowSum = sum(listA259703rowTerms)
|
|
129
|
-
A000682for_n = A000682(n)
|
|
130
|
-
print(rowSum == A000682for_n, f"{n = }, {A000682for_n = }, {rowSum = }")
|
|
131
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"""OEIS formula collection and analysis."""
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
def count(bridges: int, startingCurveLocations: dict[int, int]) -> int:
|
|
2
|
-
listCurveMaximums: list[tuple[int, int, int]] = [
|
|
3
|
-
(0x15, 0x2a, 0x10),
|
|
4
|
-
(0x55, 0xaa, 0x40),
|
|
5
|
-
(0x155, 0x2aa, 0x100),
|
|
6
|
-
(0x555, 0xaaa, 0x400),
|
|
7
|
-
(0x1555, 0x2aaa, 0x1000),
|
|
8
|
-
(0x5555, 0xaaaa, 0x4000),
|
|
9
|
-
(0x15555, 0x2aaaa, 0x10000),
|
|
10
|
-
(0x55555, 0xaaaaa, 0x40000),
|
|
11
|
-
(0x155555, 0x2aaaaa, 0x100000),
|
|
12
|
-
(0x555555, 0xaaaaaa, 0x400000),
|
|
13
|
-
(0x1555555, 0x2aaaaaa, 0x1000000),
|
|
14
|
-
(0x5555555, 0xaaaaaaa, 0x4000000),
|
|
15
|
-
(0x15555555, 0x2aaaaaaa, 0x10000000),
|
|
16
|
-
(0x55555555, 0xaaaaaaaa, 0x40000000), # `bridges = 13`, 0xaaaaaaaa.bit_length() = 32
|
|
17
|
-
(0x155555555, 0x2aaaaaaaa, 0x100000000),
|
|
18
|
-
(0x555555555, 0xaaaaaaaaa, 0x400000000),
|
|
19
|
-
(0x1555555555, 0x2aaaaaaaaa, 0x1000000000),
|
|
20
|
-
(0x5555555555, 0xaaaaaaaaaa, 0x4000000000),
|
|
21
|
-
(0x15555555555, 0x2aaaaaaaaaa, 0x10000000000),
|
|
22
|
-
(0x55555555555, 0xaaaaaaaaaaa, 0x40000000000),
|
|
23
|
-
(0x155555555555, 0x2aaaaaaaaaaa, 0x100000000000),
|
|
24
|
-
(0x555555555555, 0xaaaaaaaaaaaa, 0x400000000000),
|
|
25
|
-
(0x1555555555555, 0x2aaaaaaaaaaaa, 0x1000000000000),
|
|
26
|
-
(0x5555555555555, 0xaaaaaaaaaaaaa, 0x4000000000000),
|
|
27
|
-
(0x15555555555555, 0x2aaaaaaaaaaaaa, 0x10000000000000),
|
|
28
|
-
(0x55555555555555, 0xaaaaaaaaaaaaaa, 0x40000000000000),
|
|
29
|
-
(0x155555555555555, 0x2aaaaaaaaaaaaaa, 0x100000000000000),
|
|
30
|
-
(0x555555555555555, 0xaaaaaaaaaaaaaaa, 0x400000000000000),
|
|
31
|
-
(0x1555555555555555, 0x2aaaaaaaaaaaaaaa, 0x1000000000000000),
|
|
32
|
-
(0x5555555555555555, 0xaaaaaaaaaaaaaaaa, 0x4000000000000000), # 0x5000000000000000.bit_length() = 63; 0xaaaaaaaaaaaaaaaa.bit_length() = 64; 0x5555555555555555.bit_length() = 63
|
|
33
|
-
(0x15555555555555555, 0x2aaaaaaaaaaaaaaaa, 0x10000000000000000),
|
|
34
|
-
(0x55555555555555555, 0xaaaaaaaaaaaaaaaaa, 0x40000000000000000),
|
|
35
|
-
(0x155555555555555555, 0x2aaaaaaaaaaaaaaaaa, 0x100000000000000000),
|
|
36
|
-
(0x555555555555555555, 0xaaaaaaaaaaaaaaaaaa, 0x400000000000000000),
|
|
37
|
-
(0x1555555555555555555, 0x2aaaaaaaaaaaaaaaaaa, 0x1000000000000000000),
|
|
38
|
-
(0x5555555555555555555, 0xaaaaaaaaaaaaaaaaaaa, 0x4000000000000000000),
|
|
39
|
-
(0x15555555555555555555, 0x2aaaaaaaaaaaaaaaaaaa, 0x10000000000000000000),
|
|
40
|
-
(0x55555555555555555555, 0xaaaaaaaaaaaaaaaaaaaa, 0x40000000000000000000),
|
|
41
|
-
(0x155555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaa, 0x100000000000000000000),
|
|
42
|
-
(0x555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaa, 0x400000000000000000000),
|
|
43
|
-
(0x1555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaa, 0x1000000000000000000000),
|
|
44
|
-
(0x5555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaa, 0x4000000000000000000000),
|
|
45
|
-
(0x15555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaa, 0x10000000000000000000000),
|
|
46
|
-
(0x55555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaa, 0x40000000000000000000000),
|
|
47
|
-
(0x155555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaa, 0x100000000000000000000000),
|
|
48
|
-
(0x555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaa, 0x400000000000000000000000),
|
|
49
|
-
(0x1555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaa, 0x1000000000000000000000000),
|
|
50
|
-
(0x5555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaa, 0x4000000000000000000000000),
|
|
51
|
-
(0x15555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaa, 0x10000000000000000000000000),
|
|
52
|
-
(0x55555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x40000000000000000000000000),
|
|
53
|
-
(0x155555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaa, 0x100000000000000000000000000),
|
|
54
|
-
(0x555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x400000000000000000000000000),
|
|
55
|
-
(0x1555555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x1000000000000000000000000000),
|
|
56
|
-
(0x5555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x4000000000000000000000000000),
|
|
57
|
-
(0x15555555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x10000000000000000000000000000),
|
|
58
|
-
(0x55555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x40000000000000000000000000000),
|
|
59
|
-
(0x155555555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x100000000000000000000000000000),
|
|
60
|
-
(0x555555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x400000000000000000000000000000),
|
|
61
|
-
(0x1555555555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x1000000000000000000000000000000),
|
|
62
|
-
(0x5555555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x4000000000000000000000000000000),
|
|
63
|
-
(0x15555555555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x10000000000000000000000000000000),
|
|
64
|
-
(0x55555555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x40000000000000000000000000000000),
|
|
65
|
-
]
|
|
66
|
-
"""`bridges = 29`
|
|
67
|
-
0x5000000000000000.bit_length() = 63;
|
|
68
|
-
0xaaaaaaaaaaaaaaaa.bit_length() = 64;
|
|
69
|
-
0x5555555555555555.bit_length() = 63"""
|
|
70
|
-
|
|
71
|
-
listCurveMaximums = listCurveMaximums[0:bridges]
|
|
72
|
-
|
|
73
|
-
dictionaryCurveLocations: dict[int, int] = {}
|
|
74
|
-
while bridges > 0:
|
|
75
|
-
bridges -= 1
|
|
76
|
-
|
|
77
|
-
bifurcationAlphaLocator, bifurcationZuluLocator, curveLocationsMAXIMUM = listCurveMaximums[bridges]
|
|
78
|
-
|
|
79
|
-
for curveLocations, distinctCrossings in startingCurveLocations.items():
|
|
80
|
-
bifurcationAlpha = (curveLocations & bifurcationAlphaLocator)
|
|
81
|
-
bifurcationZulu = (curveLocations & bifurcationZuluLocator) >> 1
|
|
82
|
-
|
|
83
|
-
bifurcationAlphaHasCurves = bifurcationAlpha != 1
|
|
84
|
-
bifurcationZuluHasCurves = bifurcationZulu != 1
|
|
85
|
-
|
|
86
|
-
# Z0Z_simpleBridges
|
|
87
|
-
curveLocationAnalysis = ((bifurcationAlpha | (bifurcationZulu << 1)) << 2) | 3
|
|
88
|
-
if curveLocationAnalysis < curveLocationsMAXIMUM:
|
|
89
|
-
dictionaryCurveLocations[curveLocationAnalysis] = dictionaryCurveLocations.get(curveLocationAnalysis, 0) + distinctCrossings
|
|
90
|
-
|
|
91
|
-
# bifurcationAlphaCurves
|
|
92
|
-
if bifurcationAlphaHasCurves:
|
|
93
|
-
curveLocationAnalysis = (bifurcationAlpha >> 2) | (bifurcationZulu << 3) | ((bifurcationAlphaIsEven := 1 - (bifurcationAlpha & 0b1)) << 1)
|
|
94
|
-
if curveLocationAnalysis < curveLocationsMAXIMUM:
|
|
95
|
-
dictionaryCurveLocations[curveLocationAnalysis] = dictionaryCurveLocations.get(curveLocationAnalysis, 0) + distinctCrossings
|
|
96
|
-
|
|
97
|
-
# bifurcationZuluCurves
|
|
98
|
-
if bifurcationZuluHasCurves:
|
|
99
|
-
curveLocationAnalysis = (bifurcationZulu >> 1) | (bifurcationAlpha << 2) | (bifurcationZuluIsEven := 1 - (bifurcationZulu & 1))
|
|
100
|
-
if curveLocationAnalysis < curveLocationsMAXIMUM:
|
|
101
|
-
dictionaryCurveLocations[curveLocationAnalysis] = dictionaryCurveLocations.get(curveLocationAnalysis, 0) + distinctCrossings
|
|
102
|
-
|
|
103
|
-
# Z0Z_alignedBridges
|
|
104
|
-
if bifurcationZuluHasCurves and bifurcationAlphaHasCurves:
|
|
105
|
-
# One Truth-check to select a code path
|
|
106
|
-
bifurcationsCanBePairedTogether = (bifurcationZuluIsEven << 1) | bifurcationAlphaIsEven # pyright: ignore[reportPossiblyUnboundVariable]
|
|
107
|
-
|
|
108
|
-
if bifurcationsCanBePairedTogether != 0: # Case 0 (False, False)
|
|
109
|
-
XOrHere2makePair = 0b1
|
|
110
|
-
findUnpaired_0b1 = 0
|
|
111
|
-
|
|
112
|
-
if bifurcationsCanBePairedTogether == 1: # Case 1: (False, True)
|
|
113
|
-
while findUnpaired_0b1 >= 0:
|
|
114
|
-
XOrHere2makePair <<= 2
|
|
115
|
-
findUnpaired_0b1 += 1 if (bifurcationAlpha & XOrHere2makePair) == 0 else -1
|
|
116
|
-
bifurcationAlpha ^= XOrHere2makePair
|
|
117
|
-
elif bifurcationsCanBePairedTogether == 2: # Case 2: (True, False)
|
|
118
|
-
while findUnpaired_0b1 >= 0:
|
|
119
|
-
XOrHere2makePair <<= 2
|
|
120
|
-
findUnpaired_0b1 += 1 if (bifurcationZulu & XOrHere2makePair) == 0 else -1
|
|
121
|
-
bifurcationZulu ^= XOrHere2makePair
|
|
122
|
-
|
|
123
|
-
# Cases 1, 2, and 3 all compute curveLocationAnalysis
|
|
124
|
-
# TODO https://github.com/hunterhogan/mapFolding/issues/19
|
|
125
|
-
curveLocationAnalysis = ((bifurcationZulu >> 2) << 1) | (bifurcationAlpha >> 2)
|
|
126
|
-
if curveLocationAnalysis < curveLocationsMAXIMUM:
|
|
127
|
-
dictionaryCurveLocations[curveLocationAnalysis] = dictionaryCurveLocations.get(curveLocationAnalysis, 0) + distinctCrossings
|
|
128
|
-
|
|
129
|
-
startingCurveLocations.clear()
|
|
130
|
-
startingCurveLocations, dictionaryCurveLocations = dictionaryCurveLocations, startingCurveLocations
|
|
131
|
-
|
|
132
|
-
# print(sum(startingCurveLocations.values()))
|
|
133
|
-
return sum(startingCurveLocations.values())
|
|
134
|
-
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
from typing import NamedTuple
|
|
2
|
-
import sys
|
|
3
|
-
|
|
4
|
-
class limitLocators(NamedTuple):
|
|
5
|
-
bifurcationAlphaLocator: int
|
|
6
|
-
bifurcationZuluLocator: int
|
|
7
|
-
curveLocationsMAXIMUM: int
|
|
8
|
-
|
|
9
|
-
curveMaximum: dict[int, limitLocators] = {
|
|
10
|
-
0: limitLocators(0x15, 0x2a, 0x10),
|
|
11
|
-
1: limitLocators(0x55, 0xaa, 0x40),
|
|
12
|
-
2: limitLocators(0x155, 0x2aa, 0x100),
|
|
13
|
-
3: limitLocators(0x555, 0xaaa, 0x400),
|
|
14
|
-
4: limitLocators(0x1555, 0x2aaa, 0x1000),
|
|
15
|
-
5: limitLocators(0x5555, 0xaaaa, 0x4000),
|
|
16
|
-
6: limitLocators(0x15555, 0x2aaaa, 0x10000),
|
|
17
|
-
7: limitLocators(0x55555, 0xaaaaa, 0x40000),
|
|
18
|
-
8: limitLocators(0x155555, 0x2aaaaa, 0x100000),
|
|
19
|
-
9: limitLocators(0x555555, 0xaaaaaa, 0x400000),
|
|
20
|
-
10: limitLocators(0x1555555, 0x2aaaaaa, 0x1000000),
|
|
21
|
-
11: limitLocators(0x5555555, 0xaaaaaaa, 0x4000000),
|
|
22
|
-
12: limitLocators(0x15555555, 0x2aaaaaaa, 0x10000000),
|
|
23
|
-
13: limitLocators(0x55555555, 0xaaaaaaaa, 0x40000000),
|
|
24
|
-
14: limitLocators(0x155555555, 0x2aaaaaaaa, 0x100000000),
|
|
25
|
-
15: limitLocators(0x555555555, 0xaaaaaaaaa, 0x400000000),
|
|
26
|
-
16: limitLocators(0x1555555555, 0x2aaaaaaaaa, 0x1000000000),
|
|
27
|
-
17: limitLocators(0x5555555555, 0xaaaaaaaaaa, 0x4000000000),
|
|
28
|
-
18: limitLocators(0x15555555555, 0x2aaaaaaaaaa, 0x10000000000),
|
|
29
|
-
19: limitLocators(0x55555555555, 0xaaaaaaaaaaa, 0x40000000000),
|
|
30
|
-
20: limitLocators(0x155555555555, 0x2aaaaaaaaaaa, 0x100000000000),
|
|
31
|
-
21: limitLocators(0x555555555555, 0xaaaaaaaaaaaa, 0x400000000000),
|
|
32
|
-
22: limitLocators(0x1555555555555, 0x2aaaaaaaaaaaa, 0x1000000000000),
|
|
33
|
-
23: limitLocators(0x5555555555555, 0xaaaaaaaaaaaaa, 0x4000000000000),
|
|
34
|
-
24: limitLocators(0x15555555555555, 0x2aaaaaaaaaaaaa, 0x10000000000000),
|
|
35
|
-
25: limitLocators(0x55555555555555, 0xaaaaaaaaaaaaaa, 0x40000000000000),
|
|
36
|
-
26: limitLocators(0x155555555555555, 0x2aaaaaaaaaaaaaa, 0x100000000000000),
|
|
37
|
-
27: limitLocators(0x555555555555555, 0xaaaaaaaaaaaaaaa, 0x400000000000000),
|
|
38
|
-
28: limitLocators(0x1555555555555555, 0x2aaaaaaaaaaaaaaa, 0x1000000000000000),
|
|
39
|
-
29: limitLocators(0x5555555555555555, 0xaaaaaaaaaaaaaaaa, 0x4000000000000000),
|
|
40
|
-
30: limitLocators(0x15555555555555555, 0x2aaaaaaaaaaaaaaaa, 0x10000000000000000),
|
|
41
|
-
31: limitLocators(0x55555555555555555, 0xaaaaaaaaaaaaaaaaa, 0x40000000000000000),
|
|
42
|
-
32: limitLocators(0x155555555555555555, 0x2aaaaaaaaaaaaaaaaa, 0x100000000000000000),
|
|
43
|
-
33: limitLocators(0x555555555555555555, 0xaaaaaaaaaaaaaaaaaa, 0x400000000000000000),
|
|
44
|
-
34: limitLocators(0x1555555555555555555, 0x2aaaaaaaaaaaaaaaaaa, 0x1000000000000000000),
|
|
45
|
-
35: limitLocators(0x5555555555555555555, 0xaaaaaaaaaaaaaaaaaaa, 0x4000000000000000000),
|
|
46
|
-
36: limitLocators(0x15555555555555555555, 0x2aaaaaaaaaaaaaaaaaaa, 0x10000000000000000000),
|
|
47
|
-
37: limitLocators(0x55555555555555555555, 0xaaaaaaaaaaaaaaaaaaaa, 0x40000000000000000000),
|
|
48
|
-
38: limitLocators(0x155555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaa, 0x100000000000000000000),
|
|
49
|
-
39: limitLocators(0x555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaa, 0x400000000000000000000),
|
|
50
|
-
40: limitLocators(0x1555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaa, 0x1000000000000000000000),
|
|
51
|
-
41: limitLocators(0x5555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaa, 0x4000000000000000000000),
|
|
52
|
-
42: limitLocators(0x15555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaa, 0x10000000000000000000000),
|
|
53
|
-
43: limitLocators(0x55555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaa, 0x40000000000000000000000),
|
|
54
|
-
44: limitLocators(0x155555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaa, 0x100000000000000000000000),
|
|
55
|
-
45: limitLocators(0x555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaa, 0x400000000000000000000000),
|
|
56
|
-
46: limitLocators(0x1555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaa, 0x1000000000000000000000000),
|
|
57
|
-
47: limitLocators(0x5555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaa, 0x4000000000000000000000000),
|
|
58
|
-
48: limitLocators(0x15555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaa, 0x10000000000000000000000000),
|
|
59
|
-
49: limitLocators(0x55555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x40000000000000000000000000),
|
|
60
|
-
50: limitLocators(0x155555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaa, 0x100000000000000000000000000),
|
|
61
|
-
51: limitLocators(0x555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x400000000000000000000000000),
|
|
62
|
-
52: limitLocators(0x1555555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x1000000000000000000000000000),
|
|
63
|
-
53: limitLocators(0x5555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x4000000000000000000000000000),
|
|
64
|
-
54: limitLocators(0x15555555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x10000000000000000000000000000),
|
|
65
|
-
55: limitLocators(0x55555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x40000000000000000000000000000),
|
|
66
|
-
56: limitLocators(0x155555555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x100000000000000000000000000000),
|
|
67
|
-
57: limitLocators(0x555555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x400000000000000000000000000000),
|
|
68
|
-
58: limitLocators(0x1555555555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x1000000000000000000000000000000),
|
|
69
|
-
59: limitLocators(0x5555555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x4000000000000000000000000000000),
|
|
70
|
-
60: limitLocators(0x15555555555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x10000000000000000000000000000000),
|
|
71
|
-
61: limitLocators(0x55555555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x40000000000000000000000000000000),
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
def makeCurveMaximum() -> None:
|
|
75
|
-
sys.stdout.write("curveMaximum: dict[int, limitLocators] = {\n")
|
|
76
|
-
for n in range(62):
|
|
77
|
-
curveLocationsMAXIMUM = 1 << (2 * n + 4)
|
|
78
|
-
bifurcationAlphaLocator = int('01' * ((curveLocationsMAXIMUM.bit_length() + 1) // 2), 2)
|
|
79
|
-
sys.stdout.write(f"{n}: limitLocators({hex(bifurcationAlphaLocator)}, {hex(bifurcationAlphaLocator << 1)}, {hex(curveLocationsMAXIMUM)}),\n")
|
|
80
|
-
sys.stdout.write("}\n")
|
|
81
|
-
|
|
82
|
-
if __name__ == '__main__':
|
|
83
|
-
makeCurveMaximum()
|
|
84
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/mapFolding/reference/{A005316intOptimized.py → meandersDumpingGround/A005316intOptimized.py}
RENAMED
|
File without changes
|
/mapFolding/reference/{A005316optimized128bit.py → meandersDumpingGround/A005316optimized128bit.py}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/mapFolding/reference/{matrixMeandersBaseline.py → meandersDumpingGround/matrixMeandersBaseline.py}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/mapFolding/reference/{matrixMeandersSlicePop.py → meandersDumpingGround/matrixMeandersSlicePop.py}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|