mapFolding 0.15.2__py3-none-any.whl → 0.15.3__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/_oeisFormulas/A000682.py +70 -2
- mapFolding/_oeisFormulas/Z0Z_aOFn.py +8 -7
- mapFolding/_oeisFormulas/Z0Z_notes.py +16 -0
- mapFolding/_oeisFormulas/Z0Z_oeisMeanders.py +24 -2
- mapFolding/_oeisFormulas/Z0Z_symmetry.py +131 -0
- mapFolding/_oeisFormulas/matrixMeanders.py +31 -23
- mapFolding/_oeisFormulas/matrixMeanders64.py +152 -0
- mapFolding/_oeisFormulas/matrixMeandersAnnex.py +1 -1
- mapFolding/_theSSOT.py +1 -1
- mapFolding/_theTypes.py +1 -1
- mapFolding/basecamp.py +50 -64
- mapFolding/reference/matrixMeandersBaselineV2.py +133 -0
- mapFolding/someAssemblyRequired/A007822rawMaterials.py +1 -1
- mapFolding/someAssemblyRequired/makeJobTheorem2codon.py +5 -4
- mapFolding/syntheticModules/algorithmA007822.py +1 -1
- mapFolding/syntheticModules/algorithmA007822Numba.py +1 -1
- mapFolding/syntheticModules/dataPacking.py +2 -4
- mapFolding/syntheticModules/dataPackingA007822.py +2 -4
- mapFolding/syntheticModules/initializeStateA007822.py +1 -1
- mapFolding/syntheticModules/theorem2A007822.py +1 -1
- mapFolding/syntheticModules/theorem2A007822Numba.py +1 -1
- mapFolding/syntheticModules/theorem2A007822Trimmed.py +1 -1
- mapFolding/tests/conftest.py +2 -1
- mapFolding/tests/test_computations.py +48 -41
- {mapfolding-0.15.2.dist-info → mapfolding-0.15.3.dist-info}/METADATA +2 -1
- {mapfolding-0.15.2.dist-info → mapfolding-0.15.3.dist-info}/RECORD +30 -26
- {mapfolding-0.15.2.dist-info → mapfolding-0.15.3.dist-info}/WHEEL +0 -0
- {mapfolding-0.15.2.dist-info → mapfolding-0.15.3.dist-info}/entry_points.txt +0 -0
- {mapfolding-0.15.2.dist-info → mapfolding-0.15.3.dist-info}/licenses/LICENSE +0 -0
- {mapfolding-0.15.2.dist-info → mapfolding-0.15.3.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,70 @@
|
|
|
1
|
-
|
|
1
|
+
"""Semi-meanders.
|
|
2
|
+
|
|
3
|
+
n = 3 `startingCurveLocations` keys = 3
|
|
4
|
+
n = 4 `startingCurveLocations` keys = 4
|
|
5
|
+
n = 5 `startingCurveLocations` keys = 4
|
|
6
|
+
n = 6 `startingCurveLocations` keys = 5
|
|
7
|
+
n = 7 `startingCurveLocations` keys = 5
|
|
8
|
+
n = 8 `startingCurveLocations` keys = 6
|
|
9
|
+
n = 9 `startingCurveLocations` keys = 6
|
|
10
|
+
n = 10 `startingCurveLocations` keys = 7
|
|
11
|
+
n = 11 `startingCurveLocations` keys = 7
|
|
12
|
+
n = 12 `startingCurveLocations` keys = 8
|
|
13
|
+
n = 13 `startingCurveLocations` keys = 8
|
|
14
|
+
n = 14 `startingCurveLocations` keys = 9
|
|
15
|
+
n = 15 `startingCurveLocations` keys = 9
|
|
16
|
+
n = 16 `startingCurveLocations` keys = 10
|
|
17
|
+
n = 17 `startingCurveLocations` keys = 10
|
|
18
|
+
n = 18 `startingCurveLocations` keys = 11
|
|
19
|
+
n = 19 `startingCurveLocations` keys = 11
|
|
20
|
+
n = 20 `startingCurveLocations` keys = 12
|
|
21
|
+
n = 21 `startingCurveLocations` keys = 12
|
|
22
|
+
n = 22 `startingCurveLocations` keys = 13
|
|
23
|
+
n = 23 `startingCurveLocations` keys = 13
|
|
24
|
+
n = 24 `startingCurveLocations` keys = 14
|
|
25
|
+
n = 25 `startingCurveLocations` keys = 14
|
|
26
|
+
n = 26 `startingCurveLocations` keys = 15
|
|
27
|
+
n = 27 `startingCurveLocations` keys = 15
|
|
28
|
+
n = 28 `startingCurveLocations` keys = 16
|
|
29
|
+
n = 29 `startingCurveLocations` keys = 16
|
|
30
|
+
n = 30 `startingCurveLocations` keys = 17
|
|
31
|
+
n = 31 `startingCurveLocations` keys = 17
|
|
32
|
+
n = 32 `startingCurveLocations` keys = 18
|
|
33
|
+
n = 33 `startingCurveLocations` keys = 18
|
|
34
|
+
n = 34 `startingCurveLocations` keys = 19
|
|
35
|
+
n = 35 `startingCurveLocations` keys = 19
|
|
36
|
+
n = 36 `startingCurveLocations` keys = 20
|
|
37
|
+
n = 37 `startingCurveLocations` keys = 20
|
|
38
|
+
n = 38 `startingCurveLocations` keys = 21
|
|
39
|
+
n = 39 `startingCurveLocations` keys = 21
|
|
40
|
+
n = 40 `startingCurveLocations` keys = 22
|
|
41
|
+
n = 41 `startingCurveLocations` keys = 22
|
|
42
|
+
n = 42 `startingCurveLocations` keys = 23
|
|
43
|
+
n = 43 `startingCurveLocations` keys = 23
|
|
44
|
+
n = 44 `startingCurveLocations` keys = 24
|
|
45
|
+
n = 45 `startingCurveLocations` keys = 24
|
|
46
|
+
n = 46 `startingCurveLocations` keys = 25
|
|
47
|
+
n = 47 `startingCurveLocations` keys = 25
|
|
48
|
+
n = 48 `startingCurveLocations` keys = 26
|
|
49
|
+
n = 49 `startingCurveLocations` keys = 26
|
|
50
|
+
n = 50 `startingCurveLocations` keys = 27
|
|
51
|
+
n = 51 `startingCurveLocations` keys = 27
|
|
52
|
+
n = 52 `startingCurveLocations` keys = 28
|
|
53
|
+
n = 53 `startingCurveLocations` keys = 28
|
|
54
|
+
n = 54 `startingCurveLocations` keys = 29
|
|
55
|
+
n = 55 `startingCurveLocations` keys = 29
|
|
56
|
+
n = 56 `startingCurveLocations` keys = 30
|
|
57
|
+
n = 57 `startingCurveLocations` keys = 30
|
|
58
|
+
n = 58 `startingCurveLocations` keys = 31
|
|
59
|
+
n = 59 `startingCurveLocations` keys = 31
|
|
60
|
+
n = 60 `startingCurveLocations` keys = 32
|
|
61
|
+
n = 61 `startingCurveLocations` keys = 32
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
# TODO figure out how to call the correct module
|
|
65
|
+
# In other situations, I use a so-called dispatcher amd that has helped make code transformation easier, too.
|
|
66
|
+
from mapFolding._oeisFormulas.matrixMeanders import count # noqa: ERA001
|
|
67
|
+
from mapFolding._oeisFormulas.matrixMeanders64 import count as count64
|
|
2
68
|
|
|
3
69
|
def initializeA000682(n: int) -> dict[int, int]:
|
|
4
70
|
curveLocationsMAXIMUM = 1 << (2 * n + 4)
|
|
@@ -13,5 +79,7 @@ def initializeA000682(n: int) -> dict[int, int]:
|
|
|
13
79
|
return dict.fromkeys(listCurveLocations, 1)
|
|
14
80
|
|
|
15
81
|
def A000682(n: int) -> int:
|
|
82
|
+
# count64(n - 1, initializeA000682(n - 1))
|
|
83
|
+
# print()
|
|
16
84
|
return count(n - 1, initializeA000682(n - 1))
|
|
17
|
-
|
|
85
|
+
# return count64(n - 1, initializeA000682(n - 1))
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# pyright: reportUnusedImport=false
|
|
1
2
|
from mapFolding._oeisFormulas.A000136 import A000136
|
|
2
3
|
from mapFolding._oeisFormulas.A000682 import A000682
|
|
3
4
|
from mapFolding._oeisFormulas.A001010 import A001010
|
|
@@ -11,23 +12,23 @@ import time
|
|
|
11
12
|
if __name__ == '__main__':
|
|
12
13
|
def _write() -> None:
|
|
13
14
|
sys.stdout.write(
|
|
14
|
-
f"{(
|
|
15
|
-
f"\033[{(not
|
|
15
|
+
f"{(booleanColor:=(foldsTotal == dictionaryOEISMeanders[oeisID]['valuesKnown'][n]))}\t" # pyright: ignore[reportIndexIssue, reportUnknownVariableType]
|
|
16
|
+
f"\033[{(not booleanColor)*91}m"
|
|
16
17
|
f"{n}\t"
|
|
17
|
-
f"{foldsTotal
|
|
18
|
-
f"{dictionaryOEISMeanders[oeisID]['valuesKnown'][n]=}\t"
|
|
18
|
+
f"{foldsTotal}\t"
|
|
19
|
+
# f"{dictionaryOEISMeanders[oeisID]['valuesKnown'][n]=}\t"
|
|
19
20
|
f"{time.perf_counter() - timeStart:.2f}\t"
|
|
20
21
|
# f"{description}\t"
|
|
21
22
|
"\033[0m\n"
|
|
22
23
|
)
|
|
24
|
+
oeisID = 'A001010'
|
|
23
25
|
oeisID = 'A000136'
|
|
24
26
|
oeisID = 'A000682'
|
|
25
|
-
|
|
26
|
-
for n in range(2, 13):
|
|
27
|
+
for n in range(3,17):
|
|
27
28
|
|
|
28
29
|
# sys.stdout.write(f"{n = }\n")
|
|
29
30
|
|
|
30
31
|
timeStart = time.perf_counter()
|
|
31
|
-
foldsTotal = eval(oeisID)(n)
|
|
32
|
+
foldsTotal = eval(oeisID)(n) # noqa: S307
|
|
32
33
|
# sys.stdout.write(f"{n} {foldsTotal} {time.perf_counter() - timeStart:.2f}\n")
|
|
33
34
|
_write()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""Half-formed thoughts.
|
|
2
|
+
|
|
3
|
+
I have unintentionally made `bridges -= 1` almost meaningless.
|
|
4
|
+
|
|
5
|
+
Unlike multidimensional map folding, the computation of curveLocations_sub_i for bridges=p does not need to happen during the
|
|
6
|
+
series of computation for bridges=p. Each curveLocations_sub_i produces between no curveLocations, curveLocations_sub_q,
|
|
7
|
+
curveLocations_sub_r, curveLocations_sub_s, and curveLocations_sub_t, which are recorded as keys in dictionaryCurveLocations.
|
|
8
|
+
|
|
9
|
+
`while bridges > 0: bridges -= 1` tacitly attaches metadata to each key in dictionaryCurveLocations: specifically the value of
|
|
10
|
+
`bridges`. The computation is not complete until the `bridges` value of each key reaches 0.
|
|
11
|
+
|
|
12
|
+
Therefore, it is hypothetically possible to use one dictionary and to explicitly track the `bridges` value for each key. In
|
|
13
|
+
that scenario, the dictionary is effectively a list of jobs. And instead of being at the mercy of the amount of resources
|
|
14
|
+
needed by each decrement, bridges -= 1, we can use well-researched techniques to manage resources and the order of
|
|
15
|
+
execution.
|
|
16
|
+
"""
|
|
@@ -8,6 +8,7 @@ from mapFolding._oeisFormulas.A223094 import A223094
|
|
|
8
8
|
from mapFolding._oeisFormulas.A259702 import A259702
|
|
9
9
|
from mapFolding._oeisFormulas.A301620 import A301620
|
|
10
10
|
from mapFolding.oeis import getOEISidInformation, getOEISidValues
|
|
11
|
+
from typing import TypedDict
|
|
11
12
|
import sys
|
|
12
13
|
|
|
13
14
|
oeisIDsMeanders: list[str] = [
|
|
@@ -22,11 +23,32 @@ oeisIDsMeanders: list[str] = [
|
|
|
22
23
|
'A301620',
|
|
23
24
|
]
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
# ruff: noqa: ERA001
|
|
27
|
+
class MetadataOEISidMeanders(TypedDict):
|
|
28
|
+
"""Settings for an implemented OEIS sequence."""
|
|
29
|
+
|
|
30
|
+
description: str
|
|
31
|
+
"""The OEIS.org description of the integer sequence."""
|
|
32
|
+
# getMapShape: Callable[[int], tuple[int, ...]]
|
|
33
|
+
"""Function to convert the OEIS sequence index, 'n', to its `mapShape` tuple."""
|
|
34
|
+
offset: int
|
|
35
|
+
"""The starting index, 'n', of the sequence, typically 0 or 1."""
|
|
36
|
+
# valuesBenchmark: list[int]
|
|
37
|
+
"""List of index values, 'n', to use when benchmarking the algorithm performance."""
|
|
38
|
+
valuesKnown: dict[int, int]
|
|
39
|
+
"""Dictionary of sequence indices, 'n', to their known values, `foldsTotal`."""
|
|
40
|
+
# valuesTestParallelization: list[int]
|
|
41
|
+
"""List of index values, 'n', to use when testing parallelization performance."""
|
|
42
|
+
# valuesTestValidation: list[int]
|
|
43
|
+
"""List of index values, 'n', to use when testing validation performance."""
|
|
44
|
+
# valueUnknown: int
|
|
45
|
+
"""The smallest value of 'n' for for which `foldsTotal` is unknown."""
|
|
46
|
+
|
|
47
|
+
dictionaryOEISMeanders: dict[str, MetadataOEISidMeanders] = {
|
|
26
48
|
oeisID: {
|
|
27
|
-
'valuesKnown': getOEISidValues(oeisID),
|
|
28
49
|
'description': getOEISidInformation(oeisID)[0],
|
|
29
50
|
'offset': getOEISidInformation(oeisID)[1],
|
|
51
|
+
'valuesKnown': getOEISidValues(oeisID),
|
|
30
52
|
}
|
|
31
53
|
for oeisID in oeisIDsMeanders
|
|
32
54
|
}
|
|
@@ -0,0 +1,131 @@
|
|
|
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
|
+
|
|
@@ -13,7 +13,7 @@ def count(bridges: int, startingCurveLocations: dict[int, int]) -> int:
|
|
|
13
13
|
(0x1555555, 0x2aaaaaa, 0x1000000),
|
|
14
14
|
(0x5555555, 0xaaaaaaa, 0x4000000),
|
|
15
15
|
(0x15555555, 0x2aaaaaaa, 0x10000000),
|
|
16
|
-
(0x55555555, 0xaaaaaaaa, 0x40000000),
|
|
16
|
+
(0x55555555, 0xaaaaaaaa, 0x40000000), # `bridges = 13`, 0xaaaaaaaa.bit_length() = 32
|
|
17
17
|
(0x155555555, 0x2aaaaaaaa, 0x100000000),
|
|
18
18
|
(0x555555555, 0xaaaaaaaaa, 0x400000000),
|
|
19
19
|
(0x1555555555, 0x2aaaaaaaaa, 0x1000000000),
|
|
@@ -29,7 +29,7 @@ def count(bridges: int, startingCurveLocations: dict[int, int]) -> int:
|
|
|
29
29
|
(0x155555555555555, 0x2aaaaaaaaaaaaaa, 0x100000000000000),
|
|
30
30
|
(0x555555555555555, 0xaaaaaaaaaaaaaaa, 0x400000000000000),
|
|
31
31
|
(0x1555555555555555, 0x2aaaaaaaaaaaaaaa, 0x1000000000000000),
|
|
32
|
-
(0x5555555555555555, 0xaaaaaaaaaaaaaaaa, 0x4000000000000000),
|
|
32
|
+
(0x5555555555555555, 0xaaaaaaaaaaaaaaaa, 0x4000000000000000), # 0x5000000000000000.bit_length() = 63; 0xaaaaaaaaaaaaaaaa.bit_length() = 64; 0x5555555555555555.bit_length() = 63
|
|
33
33
|
(0x15555555555555555, 0x2aaaaaaaaaaaaaaaa, 0x10000000000000000),
|
|
34
34
|
(0x55555555555555555, 0xaaaaaaaaaaaaaaaaa, 0x40000000000000000),
|
|
35
35
|
(0x155555555555555555, 0x2aaaaaaaaaaaaaaaaa, 0x100000000000000000),
|
|
@@ -63,6 +63,11 @@ def count(bridges: int, startingCurveLocations: dict[int, int]) -> int:
|
|
|
63
63
|
(0x15555555555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x10000000000000000000000000000000),
|
|
64
64
|
(0x55555555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x40000000000000000000000000000000),
|
|
65
65
|
]
|
|
66
|
+
"""`bridges = 29`
|
|
67
|
+
0x5000000000000000.bit_length() = 63;
|
|
68
|
+
0xaaaaaaaaaaaaaaaa.bit_length() = 64;
|
|
69
|
+
0x5555555555555555.bit_length() = 63"""
|
|
70
|
+
|
|
66
71
|
listCurveMaximums = listCurveMaximums[0:bridges]
|
|
67
72
|
|
|
68
73
|
dictionaryCurveLocations: dict[int, int] = {}
|
|
@@ -70,6 +75,7 @@ def count(bridges: int, startingCurveLocations: dict[int, int]) -> int:
|
|
|
70
75
|
bridges -= 1
|
|
71
76
|
|
|
72
77
|
bifurcationAlphaLocator, bifurcationZuluLocator, curveLocationsMAXIMUM = listCurveMaximums[bridges]
|
|
78
|
+
|
|
73
79
|
for curveLocations, distinctCrossings in startingCurveLocations.items():
|
|
74
80
|
bifurcationAlpha = (curveLocations & bifurcationAlphaLocator)
|
|
75
81
|
bifurcationZulu = (curveLocations & bifurcationZuluLocator) >> 1
|
|
@@ -77,50 +83,52 @@ def count(bridges: int, startingCurveLocations: dict[int, int]) -> int:
|
|
|
77
83
|
bifurcationAlphaHasCurves = bifurcationAlpha != 1
|
|
78
84
|
bifurcationZuluHasCurves = bifurcationZulu != 1
|
|
79
85
|
|
|
80
|
-
#
|
|
86
|
+
# Z0Z_simpleBridges
|
|
81
87
|
curveLocationAnalysis = ((bifurcationAlpha | (bifurcationZulu << 1)) << 2) | 3
|
|
82
88
|
if curveLocationAnalysis < curveLocationsMAXIMUM:
|
|
83
89
|
dictionaryCurveLocations[curveLocationAnalysis] = dictionaryCurveLocations.get(curveLocationAnalysis, 0) + distinctCrossings
|
|
84
90
|
|
|
85
|
-
#
|
|
86
|
-
if
|
|
87
|
-
curveLocationAnalysis = (
|
|
91
|
+
# bifurcationAlphaCurves
|
|
92
|
+
if bifurcationAlphaHasCurves:
|
|
93
|
+
curveLocationAnalysis = (bifurcationAlpha >> 2) | (bifurcationZulu << 3) | ((bifurcationAlphaIsEven := 1 - (bifurcationAlpha & 0b1)) << 1)
|
|
88
94
|
if curveLocationAnalysis < curveLocationsMAXIMUM:
|
|
89
95
|
dictionaryCurveLocations[curveLocationAnalysis] = dictionaryCurveLocations.get(curveLocationAnalysis, 0) + distinctCrossings
|
|
90
96
|
|
|
91
|
-
#
|
|
92
|
-
if
|
|
93
|
-
curveLocationAnalysis = (
|
|
97
|
+
# bifurcationZuluCurves
|
|
98
|
+
if bifurcationZuluHasCurves:
|
|
99
|
+
curveLocationAnalysis = (bifurcationZulu >> 1) | (bifurcationAlpha << 2) | (bifurcationZuluIsEven := 1 - (bifurcationZulu & 1))
|
|
94
100
|
if curveLocationAnalysis < curveLocationsMAXIMUM:
|
|
95
101
|
dictionaryCurveLocations[curveLocationAnalysis] = dictionaryCurveLocations.get(curveLocationAnalysis, 0) + distinctCrossings
|
|
96
102
|
|
|
97
|
-
#
|
|
103
|
+
# Z0Z_alignedBridges
|
|
98
104
|
if bifurcationZuluHasCurves and bifurcationAlphaHasCurves:
|
|
99
105
|
# One Truth-check to select a code path
|
|
100
|
-
|
|
106
|
+
bifurcationsCanBePairedTogether = (bifurcationZuluIsEven << 1) | bifurcationAlphaIsEven # pyright: ignore[reportPossiblyUnboundVariable]
|
|
101
107
|
|
|
102
|
-
if
|
|
108
|
+
if bifurcationsCanBePairedTogether != 0: # Case 0 (False, False)
|
|
103
109
|
XOrHere2makePair = 0b1
|
|
104
|
-
|
|
110
|
+
findUnpaired_0b1 = 0
|
|
105
111
|
|
|
106
|
-
if
|
|
107
|
-
while
|
|
112
|
+
if bifurcationsCanBePairedTogether == 1: # Case 1: (False, True)
|
|
113
|
+
while findUnpaired_0b1 >= 0:
|
|
108
114
|
XOrHere2makePair <<= 2
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
elif
|
|
112
|
-
while
|
|
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:
|
|
113
119
|
XOrHere2makePair <<= 2
|
|
114
|
-
|
|
120
|
+
findUnpaired_0b1 += 1 if (bifurcationZulu & XOrHere2makePair) == 0 else -1
|
|
115
121
|
bifurcationZulu ^= XOrHere2makePair
|
|
116
122
|
|
|
117
123
|
# Cases 1, 2, and 3 all compute curveLocationAnalysis
|
|
118
124
|
# TODO https://github.com/hunterhogan/mapFolding/issues/19
|
|
119
|
-
curveLocationAnalysis = ((bifurcationZulu >> 2) << 1) |
|
|
125
|
+
curveLocationAnalysis = ((bifurcationZulu >> 2) << 1) | (bifurcationAlpha >> 2)
|
|
120
126
|
if curveLocationAnalysis < curveLocationsMAXIMUM:
|
|
121
127
|
dictionaryCurveLocations[curveLocationAnalysis] = dictionaryCurveLocations.get(curveLocationAnalysis, 0) + distinctCrossings
|
|
122
128
|
|
|
123
|
-
startingCurveLocations
|
|
124
|
-
dictionaryCurveLocations =
|
|
129
|
+
startingCurveLocations.clear()
|
|
130
|
+
startingCurveLocations, dictionaryCurveLocations = dictionaryCurveLocations, startingCurveLocations
|
|
125
131
|
|
|
132
|
+
# print(sum(startingCurveLocations.values()))
|
|
126
133
|
return sum(startingCurveLocations.values())
|
|
134
|
+
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# ruff: noqa
|
|
2
|
+
import numpy
|
|
3
|
+
|
|
4
|
+
indexDistinctCrossings = int(0) # noqa: RUF046, UP018
|
|
5
|
+
indexBifurcationAlpha = int(1) # noqa: RUF046, UP018
|
|
6
|
+
indexBifurcationZulu = int(2) # noqa: RUF046, UP018
|
|
7
|
+
indexCurveLocations = int(3) # noqa: RUF046, UP018
|
|
8
|
+
|
|
9
|
+
def make1array(listArrays: list[numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.uint64]]]) -> numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.uint64]]:
|
|
10
|
+
arrayCurveLocations: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.uint64]] = numpy.fromiter({element for stupidSystem in listArrays for element in stupidSystem[:, 1]}, dtype=numpy.uint64)
|
|
11
|
+
|
|
12
|
+
arrayOut = numpy.column_stack((
|
|
13
|
+
numpy.zeros(len(arrayCurveLocations), dtype=numpy.uint64)
|
|
14
|
+
, arrayCurveLocations & numpy.uint64(0x5555555555555555)
|
|
15
|
+
, (arrayCurveLocations & numpy.uint64(0xaaaaaaaaaaaaaaaa)) >> numpy.uint64(1)
|
|
16
|
+
, arrayCurveLocations
|
|
17
|
+
))
|
|
18
|
+
|
|
19
|
+
for arrayCurveLocations in listArrays:
|
|
20
|
+
arrayOut[:, indexDistinctCrossings] += numpy.sum(arrayCurveLocations[:, 0] * (arrayCurveLocations[:, -1][:, numpy.newaxis] == arrayOut[:, indexCurveLocations]).T, axis=1)
|
|
21
|
+
|
|
22
|
+
return arrayOut # The next `arrayBifurcations`
|
|
23
|
+
|
|
24
|
+
def convertDictionaryToNumPy(dictionaryIn: dict[int, int]) -> numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.uint64]]:
|
|
25
|
+
arrayKeys: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.uint64]] = numpy.fromiter(dictionaryIn.keys(), dtype=numpy.uint64)
|
|
26
|
+
|
|
27
|
+
return numpy.column_stack((
|
|
28
|
+
numpy.fromiter(dictionaryIn.values(), dtype=numpy.uint64)
|
|
29
|
+
, arrayKeys & numpy.uint64(0x5555555555555555)
|
|
30
|
+
, (arrayKeys & numpy.uint64(0xaaaaaaaaaaaaaaaa)) >> numpy.uint64(1)
|
|
31
|
+
, arrayKeys
|
|
32
|
+
))
|
|
33
|
+
|
|
34
|
+
def count(bridges: int, startingCurveLocations: dict[int, int]) -> int:
|
|
35
|
+
arrayBifurcations: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.uint64]] = convertDictionaryToNumPy(startingCurveLocations)
|
|
36
|
+
|
|
37
|
+
while bridges > 0:
|
|
38
|
+
bridges -= 1
|
|
39
|
+
|
|
40
|
+
listArrayCurveLocationsAnalyzed: list[numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.uint64]]] = []
|
|
41
|
+
|
|
42
|
+
# Selector-adjacent
|
|
43
|
+
curveLocationsMAXIMUM: numpy.uint64 = numpy.uint64(1) << numpy.uint64(2 * bridges + 4)
|
|
44
|
+
# Selectors, general
|
|
45
|
+
selectBifurcationAlphaCurves: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = arrayBifurcations[:, indexBifurcationAlpha] > numpy.uint64(1)
|
|
46
|
+
selectBifurcationAlphaEven: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = (arrayBifurcations[:, indexBifurcationAlpha] & numpy.uint64(1)) == numpy.uint64(0)
|
|
47
|
+
selectBifurcationZuluCurves: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = arrayBifurcations[:, indexBifurcationZulu] > numpy.uint64(1)
|
|
48
|
+
selectBifurcationZuluEven: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = (arrayBifurcations[:, indexBifurcationZulu] & numpy.uint64(1)) == numpy.uint64(0)
|
|
49
|
+
|
|
50
|
+
# BridgesSimple
|
|
51
|
+
selector: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = arrayBifurcations[:, indexDistinctCrossings] >= numpy.uint64(0) # This had better always be `True`.
|
|
52
|
+
curveLocations: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.uint64]] = (((arrayBifurcations[selector, indexBifurcationAlpha] | (arrayBifurcations[selector, indexBifurcationZulu] << numpy.uint64(1))) << numpy.uint64(2)) | numpy.uint64(3))
|
|
53
|
+
listArrayCurveLocationsAnalyzed.append(numpy.column_stack((arrayBifurcations[selector, indexDistinctCrossings][curveLocations < curveLocationsMAXIMUM], curveLocations[curveLocations < curveLocationsMAXIMUM])))
|
|
54
|
+
|
|
55
|
+
# BifurcationAlphaCurves
|
|
56
|
+
selector = selectBifurcationAlphaCurves
|
|
57
|
+
curveLocations: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.uint64]] = numpy.bitwise_or.reduce((
|
|
58
|
+
arrayBifurcations[selector, indexBifurcationAlpha] >> numpy.uint64(2)
|
|
59
|
+
, arrayBifurcations[selector, indexBifurcationZulu] << numpy.uint64(3)
|
|
60
|
+
, (numpy.uint64(1) - (arrayBifurcations[selector, indexBifurcationAlpha] & numpy.uint64(1))) << numpy.uint64(1)
|
|
61
|
+
))
|
|
62
|
+
listArrayCurveLocationsAnalyzed.append(numpy.column_stack((arrayBifurcations[selector, indexDistinctCrossings][curveLocations < curveLocationsMAXIMUM], curveLocations[curveLocations < curveLocationsMAXIMUM])))
|
|
63
|
+
|
|
64
|
+
# BifurcationZuluCurves
|
|
65
|
+
selector = selectBifurcationZuluCurves
|
|
66
|
+
curveLocations: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.uint64]] = numpy.bitwise_or.reduce((
|
|
67
|
+
arrayBifurcations[selector, indexBifurcationZulu] >> numpy.uint64(1)
|
|
68
|
+
, arrayBifurcations[selector, indexBifurcationAlpha] << numpy.uint64(2)
|
|
69
|
+
, (1 - (arrayBifurcations[selector, indexBifurcationZulu] & numpy.uint64(1)))
|
|
70
|
+
))
|
|
71
|
+
listArrayCurveLocationsAnalyzed.append(numpy.column_stack((arrayBifurcations[selector, indexDistinctCrossings][curveLocations < curveLocationsMAXIMUM], curveLocations[curveLocations < curveLocationsMAXIMUM])))
|
|
72
|
+
|
|
73
|
+
# Z0Z_bridgesBifurcationAlphaToRepair
|
|
74
|
+
selector: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = numpy.logical_and.reduce((
|
|
75
|
+
selectBifurcationAlphaCurves, selectBifurcationZuluCurves, selectBifurcationAlphaEven, ~selectBifurcationZuluEven
|
|
76
|
+
))
|
|
77
|
+
|
|
78
|
+
# Initialize
|
|
79
|
+
Z0Z_selectBridgesBifurcationAlphaToModify = selector.copy()
|
|
80
|
+
XOrHere2makePair = numpy.uint64(1)
|
|
81
|
+
selectToModifyByXOR: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = numpy.array([])
|
|
82
|
+
selectorUnified: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = numpy.array([])
|
|
83
|
+
|
|
84
|
+
while Z0Z_selectBridgesBifurcationAlphaToModify.any():
|
|
85
|
+
XOrHere2makePair <<= numpy.uint64(2)
|
|
86
|
+
|
|
87
|
+
selectToModifyByXOR: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = (arrayBifurcations[:, indexBifurcationAlpha] & XOrHere2makePair) == numpy.uint64(0)
|
|
88
|
+
selectorUnified: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = numpy.logical_and.reduce((Z0Z_selectBridgesBifurcationAlphaToModify, selectToModifyByXOR))
|
|
89
|
+
|
|
90
|
+
# Modify in place
|
|
91
|
+
arrayBifurcations[selectorUnified, indexBifurcationAlpha] ^= XOrHere2makePair
|
|
92
|
+
|
|
93
|
+
# Remove the modified elements
|
|
94
|
+
Z0Z_selectBridgesBifurcationAlphaToModify: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = numpy.logical_and.reduce((Z0Z_selectBridgesBifurcationAlphaToModify, ~selectorUnified))
|
|
95
|
+
|
|
96
|
+
curveLocations: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.uint64]] = (
|
|
97
|
+
((arrayBifurcations[selector, indexBifurcationZulu] >> numpy.uint64(2)) << numpy.uint64(1))
|
|
98
|
+
| (arrayBifurcations[selector, indexBifurcationAlpha] >> numpy.uint64(2))
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
listArrayCurveLocationsAnalyzed.append(numpy.column_stack((arrayBifurcations[selector, indexDistinctCrossings][curveLocations < curveLocationsMAXIMUM], curveLocations[curveLocations < curveLocationsMAXIMUM])))
|
|
102
|
+
|
|
103
|
+
# Z0Z_bridgesBifurcationZuluToRepair
|
|
104
|
+
selector: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = numpy.logical_and.reduce((
|
|
105
|
+
selectBifurcationAlphaCurves, selectBifurcationZuluCurves, ~selectBifurcationAlphaEven, selectBifurcationZuluEven
|
|
106
|
+
))
|
|
107
|
+
|
|
108
|
+
# Initialize
|
|
109
|
+
Z0Z_selectBridgesBifurcationZuluToModify: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = selector.copy()
|
|
110
|
+
XOrHere2makePair: numpy.uint64 = numpy.uint64(1)
|
|
111
|
+
selectToModifyByXOR: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = numpy.array([])
|
|
112
|
+
selectorUnified: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = numpy.array([])
|
|
113
|
+
|
|
114
|
+
while Z0Z_selectBridgesBifurcationZuluToModify.any():
|
|
115
|
+
XOrHere2makePair <<= numpy.uint64(2)
|
|
116
|
+
|
|
117
|
+
# New condition
|
|
118
|
+
selectUnpaired_0b1: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = (arrayBifurcations[:, indexBifurcationZulu] & XOrHere2makePair) == numpy.uint64(0)
|
|
119
|
+
selectorUnified: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = numpy.logical_and.reduce((Z0Z_selectBridgesBifurcationZuluToModify, selectUnpaired_0b1))
|
|
120
|
+
|
|
121
|
+
# Modify in place
|
|
122
|
+
arrayBifurcations[selectorUnified, indexBifurcationZulu] ^= XOrHere2makePair
|
|
123
|
+
|
|
124
|
+
# Remove the modified elements from the selector
|
|
125
|
+
Z0Z_selectBridgesBifurcationZuluToModify: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = numpy.logical_and.reduce((Z0Z_selectBridgesBifurcationZuluToModify, ~selectorUnified))
|
|
126
|
+
|
|
127
|
+
curveLocations: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.uint64]] = (
|
|
128
|
+
((arrayBifurcations[selector, indexBifurcationZulu] >> numpy.uint64(2)) << numpy.uint64(1))
|
|
129
|
+
| (arrayBifurcations[selector, indexBifurcationAlpha] >> numpy.uint64(2))
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
listArrayCurveLocationsAnalyzed.append(numpy.column_stack((arrayBifurcations[selector, indexDistinctCrossings][curveLocations < curveLocationsMAXIMUM], curveLocations[curveLocations < curveLocationsMAXIMUM])))
|
|
133
|
+
|
|
134
|
+
# Z0Z_bridgesAligned
|
|
135
|
+
selector: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.bool_]] = numpy.logical_and.reduce((
|
|
136
|
+
selectBifurcationAlphaCurves, selectBifurcationZuluCurves, selectBifurcationAlphaEven, selectBifurcationZuluEven
|
|
137
|
+
))
|
|
138
|
+
|
|
139
|
+
curveLocations: numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.uint64]] = (
|
|
140
|
+
((arrayBifurcations[selector, indexBifurcationZulu] >> numpy.uint64(2)) << numpy.uint64(1))
|
|
141
|
+
| (arrayBifurcations[selector, indexBifurcationAlpha] >> numpy.uint64(2))
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
listArrayCurveLocationsAnalyzed.append(numpy.column_stack((arrayBifurcations[selector, indexDistinctCrossings][curveLocations < curveLocationsMAXIMUM], curveLocations[curveLocations < curveLocationsMAXIMUM])))
|
|
145
|
+
|
|
146
|
+
arrayBifurcations = make1array(listArrayCurveLocationsAnalyzed)
|
|
147
|
+
|
|
148
|
+
listArrayCurveLocationsAnalyzed.clear()
|
|
149
|
+
|
|
150
|
+
print(int(sum(arrayBifurcations[:, 0])))
|
|
151
|
+
return int(sum(arrayBifurcations[:, 0]))
|
|
152
|
+
|
|
@@ -35,7 +35,7 @@ curveMaximum: dict[int, limitLocators] = {
|
|
|
35
35
|
25: limitLocators(0x55555555555555, 0xaaaaaaaaaaaaaa, 0x40000000000000),
|
|
36
36
|
26: limitLocators(0x155555555555555, 0x2aaaaaaaaaaaaaa, 0x100000000000000),
|
|
37
37
|
27: limitLocators(0x555555555555555, 0xaaaaaaaaaaaaaaa, 0x400000000000000),
|
|
38
|
-
28: limitLocators(0x1555555555555555, 0x2aaaaaaaaaaaaaaa, 0x1000000000000000),
|
|
38
|
+
28: limitLocators(0x1555555555555555, 0x2aaaaaaaaaaaaaaa, 0x1000000000000000),
|
|
39
39
|
29: limitLocators(0x5555555555555555, 0xaaaaaaaaaaaaaaaa, 0x4000000000000000),
|
|
40
40
|
30: limitLocators(0x15555555555555555, 0x2aaaaaaaaaaaaaaaa, 0x10000000000000000),
|
|
41
41
|
31: limitLocators(0x55555555555555555, 0xaaaaaaaaaaaaaaaaa, 0x40000000000000000),
|
mapFolding/_theSSOT.py
CHANGED
|
@@ -115,7 +115,7 @@ settingsOEISManuallySelected: dict[str, MetadataOEISidManuallySet] = {
|
|
|
115
115
|
'getMapShape': lambda n: (1, 2 * n),
|
|
116
116
|
'valuesBenchmark': [7],
|
|
117
117
|
'valuesTestParallelization': [*range(2, 4)],
|
|
118
|
-
'valuesTestValidation': [random.randint(2,
|
|
118
|
+
'valuesTestValidation': [random.randint(2, 8)], # noqa: S311
|
|
119
119
|
},
|
|
120
120
|
}
|
|
121
121
|
|
mapFolding/_theTypes.py
CHANGED
|
@@ -36,7 +36,7 @@ NumPyFoldsTotal: TypeAlias = numpy_uint64 # noqa: UP040 The TypeAlias may be us
|
|
|
36
36
|
|
|
37
37
|
Note well
|
|
38
38
|
---------
|
|
39
|
-
If your
|
|
39
|
+
If your element values might exceed 1.8 x 10^19, then you should take extra steps to ensure the integrity of the data in NumPy or use a
|
|
40
40
|
different data structure."""
|
|
41
41
|
|
|
42
42
|
Array3DLeavesTotal: TypeAlias = ndarray[tuple[int, int, int], dtype[NumPyLeavesTotal]] # noqa: UP040 The TypeAlias may be used to construct ("cast") a value to the type. And the identifier may be changed to a different type.
|