mapFolding 0.3.12__py3-none-any.whl → 0.4.1__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 +40 -38
- mapFolding/basecamp.py +50 -50
- mapFolding/beDRY.py +336 -336
- mapFolding/oeis.py +262 -262
- mapFolding/reference/flattened.py +294 -293
- mapFolding/reference/hunterNumba.py +126 -126
- mapFolding/reference/irvineJavaPort.py +99 -99
- mapFolding/reference/jax.py +153 -153
- mapFolding/reference/lunnan.py +148 -148
- mapFolding/reference/lunnanNumpy.py +115 -115
- mapFolding/reference/lunnanWhile.py +114 -114
- mapFolding/reference/rotatedEntryPoint.py +183 -183
- mapFolding/reference/total_countPlus1vsPlusN.py +203 -203
- mapFolding/someAssemblyRequired/__init__.py +5 -1
- mapFolding/someAssemblyRequired/getLLVMforNoReason.py +12 -12
- mapFolding/someAssemblyRequired/makeJob.py +46 -52
- mapFolding/someAssemblyRequired/synthesizeModuleJAX.py +17 -17
- mapFolding/someAssemblyRequired/synthesizeNumba.py +343 -633
- mapFolding/someAssemblyRequired/synthesizeNumbaGeneralized.py +325 -0
- mapFolding/someAssemblyRequired/synthesizeNumbaJob.py +173 -0
- mapFolding/someAssemblyRequired/synthesizeNumbaModules.py +77 -0
- mapFolding/syntheticModules/__init__.py +0 -0
- mapFolding/syntheticModules/numba_countInitialize.py +4 -4
- mapFolding/syntheticModules/numba_countParallel.py +4 -4
- mapFolding/syntheticModules/numba_countSequential.py +4 -4
- mapFolding/syntheticModules/numba_doTheNeedful.py +7 -7
- mapFolding/theDao.py +165 -165
- mapFolding/theSSOT.py +177 -173
- mapFolding/theSSOTnumba.py +90 -74
- mapFolding-0.4.1.dist-info/METADATA +154 -0
- mapFolding-0.4.1.dist-info/RECORD +42 -0
- tests/conftest.py +253 -129
- tests/test_computations.py +79 -0
- tests/test_oeis.py +76 -85
- tests/test_other.py +136 -224
- tests/test_tasks.py +19 -23
- tests/test_types.py +2 -2
- mapFolding/someAssemblyRequired/synthesizeNumbaHardcoding.py +0 -188
- mapFolding-0.3.12.dist-info/METADATA +0 -155
- mapFolding-0.3.12.dist-info/RECORD +0 -40
- tests/conftest_tmpRegistry.py +0 -62
- tests/conftest_uniformTests.py +0 -53
- {mapFolding-0.3.12.dist-info → mapFolding-0.4.1.dist-info}/LICENSE +0 -0
- {mapFolding-0.3.12.dist-info → mapFolding-0.4.1.dist-info}/WHEEL +0 -0
- {mapFolding-0.3.12.dist-info → mapFolding-0.4.1.dist-info}/entry_points.txt +0 -0
- {mapFolding-0.3.12.dist-info → mapFolding-0.4.1.dist-info}/top_level.txt +0 -0
mapFolding/theDao.py
CHANGED
|
@@ -4,226 +4,226 @@ from numpy import dtype, integer, ndarray
|
|
|
4
4
|
from typing import Any, Tuple
|
|
5
5
|
|
|
6
6
|
def activeGapIncrement(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> None:
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
# `.value` is not necessary for this module or most modules. But, this module is transformed into Numba "jitted" functions, and Numba won't use `Enum` for an ndarray index without `.value`.
|
|
8
|
+
my[indexMy.gap1ndex.value] += 1
|
|
9
9
|
|
|
10
10
|
def activeLeafGreaterThan0Condition(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> Any:
|
|
11
|
-
|
|
11
|
+
return my[indexMy.leaf1ndex.value]
|
|
12
12
|
|
|
13
13
|
def activeLeafGreaterThanLeavesTotalCondition(foldGroups: ndarray[Tuple[int], dtype[integer[Any]]], my: ndarray[Tuple[int], dtype[integer[Any]]]) -> Any:
|
|
14
|
-
|
|
14
|
+
return my[indexMy.leaf1ndex.value] > foldGroups[-1]
|
|
15
15
|
|
|
16
16
|
def activeLeafIsTheFirstLeafCondition(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> Any:
|
|
17
|
-
|
|
17
|
+
return my[indexMy.leaf1ndex.value] <= 1
|
|
18
18
|
|
|
19
19
|
def allDimensionsAreUnconstrained(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> Any:
|
|
20
|
-
|
|
20
|
+
return not my[indexMy.dimensionsUnconstrained.value]
|
|
21
21
|
|
|
22
22
|
def backtrack(my: ndarray[Tuple[int], dtype[integer[Any]]], track: ndarray[Tuple[int, int], dtype[integer[Any]]]) -> None:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
my[indexMy.leaf1ndex.value] -= 1
|
|
24
|
+
track[indexTrack.leafBelow.value, track[indexTrack.leafAbove.value, my[indexMy.leaf1ndex.value]]] = track[indexTrack.leafBelow.value, my[indexMy.leaf1ndex.value]]
|
|
25
|
+
track[indexTrack.leafAbove.value, track[indexTrack.leafBelow.value, my[indexMy.leaf1ndex.value]]] = track[indexTrack.leafAbove.value, my[indexMy.leaf1ndex.value]]
|
|
26
26
|
|
|
27
27
|
def backtrackCondition(my: ndarray[Tuple[int], dtype[integer[Any]]], track: ndarray[Tuple[int, int], dtype[integer[Any]]]) -> Any:
|
|
28
|
-
|
|
28
|
+
return my[indexMy.leaf1ndex.value] and my[indexMy.gap1ndex.value] == track[indexTrack.gapRangeStart.value, my[indexMy.leaf1ndex.value] - 1]
|
|
29
29
|
|
|
30
30
|
def gap1ndexCeilingIncrement(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> None:
|
|
31
|
-
|
|
31
|
+
my[indexMy.gap1ndexCeiling.value] += 1
|
|
32
32
|
|
|
33
33
|
def countGaps(gapsWhere: ndarray[Tuple[int], dtype[integer[Any]]], my: ndarray[Tuple[int], dtype[integer[Any]]], track: ndarray[Tuple[int, int], dtype[integer[Any]]]) -> None:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
gapsWhere[my[indexMy.gap1ndexCeiling.value]] = my[indexMy.leafConnectee.value]
|
|
35
|
+
if track[indexTrack.countDimensionsGapped.value, my[indexMy.leafConnectee.value]] == 0:
|
|
36
|
+
gap1ndexCeilingIncrement(my=my)
|
|
37
|
+
track[indexTrack.countDimensionsGapped.value, my[indexMy.leafConnectee.value]] += 1
|
|
38
38
|
|
|
39
39
|
def dimensionsUnconstrainedCondition(connectionGraph: ndarray[Tuple[int, int, int], dtype[integer[Any]]], my: ndarray[Tuple[int], dtype[integer[Any]]]) -> Any:
|
|
40
|
-
|
|
40
|
+
return connectionGraph[my[indexMy.indexDimension.value], my[indexMy.leaf1ndex.value], my[indexMy.leaf1ndex.value]] == my[indexMy.leaf1ndex.value]
|
|
41
41
|
|
|
42
42
|
def dimensionsUnconstrainedDecrement(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> None:
|
|
43
|
-
|
|
43
|
+
my[indexMy.dimensionsUnconstrained.value] -= 1
|
|
44
44
|
|
|
45
45
|
def filterCommonGaps(gapsWhere: ndarray[Tuple[int], dtype[integer[Any]]], my: ndarray[Tuple[int], dtype[integer[Any]]], track: ndarray[Tuple[int, int], dtype[integer[Any]]]) -> None:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
gapsWhere[my[indexMy.gap1ndex.value]] = gapsWhere[my[indexMy.indexMiniGap.value]]
|
|
47
|
+
if track[indexTrack.countDimensionsGapped.value, gapsWhere[my[indexMy.indexMiniGap.value]]] == my[indexMy.dimensionsUnconstrained.value]:
|
|
48
|
+
activeGapIncrement(my=my)
|
|
49
|
+
track[indexTrack.countDimensionsGapped.value, gapsWhere[my[indexMy.indexMiniGap.value]]] = 0
|
|
50
50
|
|
|
51
51
|
def findGapsInitializeVariables(my: ndarray[Tuple[int], dtype[integer[Any]]], track: ndarray[Tuple[int, int], dtype[integer[Any]]]) -> None:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
my[indexMy.dimensionsUnconstrained.value] = my[indexMy.dimensionsTotal.value]
|
|
53
|
+
my[indexMy.gap1ndexCeiling.value] = track[indexTrack.gapRangeStart.value, my[indexMy.leaf1ndex.value] - 1]
|
|
54
|
+
my[indexMy.indexDimension.value] = 0
|
|
55
55
|
|
|
56
56
|
def indexDimensionIncrement(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> None:
|
|
57
|
-
|
|
57
|
+
my[indexMy.indexDimension.value] += 1
|
|
58
58
|
|
|
59
59
|
def indexMiniGapIncrement(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> None:
|
|
60
|
-
|
|
60
|
+
my[indexMy.indexMiniGap.value] += 1
|
|
61
61
|
|
|
62
62
|
def indexMiniGapInitialization(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> None:
|
|
63
|
-
|
|
63
|
+
my[indexMy.indexMiniGap.value] = my[indexMy.gap1ndex.value]
|
|
64
64
|
|
|
65
65
|
def insertUnconstrainedLeaf(gapsWhere: ndarray[Tuple[int], dtype[integer[Any]]], my: ndarray[Tuple[int], dtype[integer[Any]]]) -> None:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
my[indexMy.indexLeaf.value] = 0
|
|
67
|
+
while my[indexMy.indexLeaf.value] < my[indexMy.leaf1ndex.value]:
|
|
68
|
+
gapsWhere[my[indexMy.gap1ndexCeiling.value]] = my[indexMy.indexLeaf.value]
|
|
69
|
+
my[indexMy.gap1ndexCeiling.value] += 1
|
|
70
|
+
my[indexMy.indexLeaf.value] += 1
|
|
71
71
|
|
|
72
72
|
def leafBelowSentinelIs1Condition(track: ndarray[Tuple[int, int], dtype[integer[Any]]]) -> Any:
|
|
73
|
-
|
|
73
|
+
return track[indexTrack.leafBelow.value, 0] == 1
|
|
74
74
|
|
|
75
75
|
def leafConnecteeInitialization(connectionGraph: ndarray[Tuple[int, int, int], dtype[integer[Any]]], my: ndarray[Tuple[int], dtype[integer[Any]]]) -> None:
|
|
76
|
-
|
|
76
|
+
my[indexMy.leafConnectee.value] = connectionGraph[my[indexMy.indexDimension.value], my[indexMy.leaf1ndex.value], my[indexMy.leaf1ndex.value]]
|
|
77
77
|
|
|
78
78
|
def leafConnecteeUpdate(connectionGraph: ndarray[Tuple[int, int, int], dtype[integer[Any]]], my: ndarray[Tuple[int], dtype[integer[Any]]], track: ndarray[Tuple[int, int], dtype[integer[Any]]]) -> None:
|
|
79
|
-
|
|
79
|
+
my[indexMy.leafConnectee.value] = connectionGraph[my[indexMy.indexDimension.value], my[indexMy.leaf1ndex.value], track[indexTrack.leafBelow.value, my[indexMy.leafConnectee.value]]]
|
|
80
80
|
|
|
81
81
|
def loopingLeavesConnectedToActiveLeaf(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> Any:
|
|
82
|
-
|
|
82
|
+
return my[indexMy.leafConnectee.value] != my[indexMy.leaf1ndex.value]
|
|
83
83
|
|
|
84
84
|
def loopUpToDimensionsTotal(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> Any:
|
|
85
|
-
|
|
85
|
+
return my[indexMy.indexDimension.value] < my[indexMy.dimensionsTotal.value]
|
|
86
86
|
|
|
87
87
|
def loopingToActiveGapCeiling(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> Any:
|
|
88
|
-
|
|
88
|
+
return my[indexMy.indexMiniGap.value] < my[indexMy.gap1ndexCeiling.value]
|
|
89
89
|
|
|
90
90
|
def placeLeaf(gapsWhere: ndarray[Tuple[int], dtype[integer[Any]]], my: ndarray[Tuple[int], dtype[integer[Any]]], track: ndarray[Tuple[int, int], dtype[integer[Any]]]) -> None:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
my[indexMy.gap1ndex.value] -= 1
|
|
92
|
+
track[indexTrack.leafAbove.value, my[indexMy.leaf1ndex.value]] = gapsWhere[my[indexMy.gap1ndex.value]]
|
|
93
|
+
track[indexTrack.leafBelow.value, my[indexMy.leaf1ndex.value]] = track[indexTrack.leafBelow.value, track[indexTrack.leafAbove.value, my[indexMy.leaf1ndex.value]]]
|
|
94
|
+
track[indexTrack.leafBelow.value, track[indexTrack.leafAbove.value, my[indexMy.leaf1ndex.value]]] = my[indexMy.leaf1ndex.value]
|
|
95
|
+
track[indexTrack.leafAbove.value, track[indexTrack.leafBelow.value, my[indexMy.leaf1ndex.value]]] = my[indexMy.leaf1ndex.value]
|
|
96
|
+
track[indexTrack.gapRangeStart.value, my[indexMy.leaf1ndex.value]] = my[indexMy.gap1ndex.value]
|
|
97
|
+
my[indexMy.leaf1ndex.value] += 1
|
|
98
98
|
|
|
99
99
|
def placeLeafCondition(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> Any:
|
|
100
|
-
|
|
100
|
+
return my[indexMy.leaf1ndex.value]
|
|
101
101
|
|
|
102
102
|
def thereAreComputationDivisionsYouMightSkip(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> Any:
|
|
103
|
-
|
|
103
|
+
return my[indexMy.leaf1ndex.value] != my[indexMy.taskDivisions.value] or my[indexMy.leafConnectee.value] % my[indexMy.taskDivisions.value] == my[indexMy.taskIndex.value]
|
|
104
104
|
|
|
105
105
|
def countInitialize(connectionGraph: ndarray[Tuple[int, int, int], dtype[integer[Any]]]
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
106
|
+
, gapsWhere: ndarray[Tuple[int] , dtype[integer[Any]]]
|
|
107
|
+
, my: ndarray[Tuple[int] , dtype[integer[Any]]]
|
|
108
|
+
, track: ndarray[Tuple[int, int] , dtype[integer[Any]]]
|
|
109
|
+
) -> None:
|
|
110
|
+
|
|
111
|
+
while activeLeafGreaterThan0Condition(my=my):
|
|
112
|
+
if activeLeafIsTheFirstLeafCondition(my=my) or leafBelowSentinelIs1Condition(track=track):
|
|
113
|
+
findGapsInitializeVariables(my=my, track=track)
|
|
114
|
+
while loopUpToDimensionsTotal(my=my):
|
|
115
|
+
if dimensionsUnconstrainedCondition(connectionGraph=connectionGraph, my=my):
|
|
116
|
+
dimensionsUnconstrainedDecrement(my=my)
|
|
117
|
+
else:
|
|
118
|
+
leafConnecteeInitialization(connectionGraph=connectionGraph, my=my)
|
|
119
|
+
while loopingLeavesConnectedToActiveLeaf(my=my):
|
|
120
|
+
countGaps(gapsWhere=gapsWhere, my=my, track=track)
|
|
121
|
+
leafConnecteeUpdate(connectionGraph=connectionGraph, my=my, track=track)
|
|
122
|
+
indexDimensionIncrement(my=my)
|
|
123
|
+
if allDimensionsAreUnconstrained(my=my):
|
|
124
|
+
insertUnconstrainedLeaf(gapsWhere=gapsWhere, my=my)
|
|
125
|
+
indexMiniGapInitialization(my=my)
|
|
126
|
+
while loopingToActiveGapCeiling(my=my):
|
|
127
|
+
filterCommonGaps(gapsWhere=gapsWhere, my=my, track=track)
|
|
128
|
+
indexMiniGapIncrement(my=my)
|
|
129
|
+
if placeLeafCondition(my=my):
|
|
130
|
+
placeLeaf(gapsWhere=gapsWhere, my=my, track=track)
|
|
131
|
+
if my[indexMy.gap1ndex.value] > 0:
|
|
132
|
+
return
|
|
133
133
|
|
|
134
134
|
def countParallel(connectionGraph: ndarray[Tuple[int, int, int], dtype[integer[Any]]]
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
135
|
+
, foldGroups: ndarray[Tuple[int] , dtype[integer[Any]]]
|
|
136
|
+
, gapsWhere: ndarray[Tuple[int] , dtype[integer[Any]]]
|
|
137
|
+
, my: ndarray[Tuple[int] , dtype[integer[Any]]]
|
|
138
|
+
, track: ndarray[Tuple[int, int] , dtype[integer[Any]]]
|
|
139
|
+
) -> None:
|
|
140
|
+
|
|
141
|
+
gapsWherePARALLEL = gapsWhere.copy()
|
|
142
|
+
myPARALLEL = my.copy()
|
|
143
|
+
trackPARALLEL = track.copy()
|
|
144
|
+
|
|
145
|
+
taskDivisionsPrange = myPARALLEL[indexMy.taskDivisions.value]
|
|
146
|
+
|
|
147
|
+
for indexSherpa in prange(taskDivisionsPrange):
|
|
148
|
+
groupsOfFolds: int = 0
|
|
149
|
+
|
|
150
|
+
gapsWhere = gapsWherePARALLEL.copy()
|
|
151
|
+
my = myPARALLEL.copy()
|
|
152
|
+
track = trackPARALLEL.copy()
|
|
153
|
+
|
|
154
|
+
my[indexMy.taskIndex.value] = indexSherpa
|
|
155
|
+
|
|
156
|
+
while activeLeafGreaterThan0Condition(my=my):
|
|
157
|
+
if activeLeafIsTheFirstLeafCondition(my=my) or leafBelowSentinelIs1Condition(track=track):
|
|
158
|
+
if activeLeafGreaterThanLeavesTotalCondition(foldGroups=foldGroups, my=my):
|
|
159
|
+
groupsOfFolds += 1
|
|
160
|
+
else:
|
|
161
|
+
findGapsInitializeVariables(my=my, track=track)
|
|
162
|
+
while loopUpToDimensionsTotal(my=my):
|
|
163
|
+
if dimensionsUnconstrainedCondition(connectionGraph=connectionGraph, my=my):
|
|
164
|
+
dimensionsUnconstrainedDecrement(my=my)
|
|
165
|
+
else:
|
|
166
|
+
leafConnecteeInitialization(connectionGraph=connectionGraph, my=my)
|
|
167
|
+
while loopingLeavesConnectedToActiveLeaf(my=my):
|
|
168
|
+
if thereAreComputationDivisionsYouMightSkip(my=my):
|
|
169
|
+
countGaps(gapsWhere=gapsWhere, my=my, track=track)
|
|
170
|
+
leafConnecteeUpdate(connectionGraph=connectionGraph, my=my, track=track)
|
|
171
|
+
indexDimensionIncrement(my=my)
|
|
172
|
+
indexMiniGapInitialization(my=my)
|
|
173
|
+
while loopingToActiveGapCeiling(my=my):
|
|
174
|
+
filterCommonGaps(gapsWhere=gapsWhere, my=my, track=track)
|
|
175
|
+
indexMiniGapIncrement(my=my)
|
|
176
|
+
while backtrackCondition(my=my, track=track):
|
|
177
|
+
backtrack(my=my, track=track)
|
|
178
|
+
if placeLeafCondition(my=my):
|
|
179
|
+
placeLeaf(gapsWhere=gapsWhere, my=my, track=track)
|
|
180
|
+
foldGroups[my[indexMy.taskIndex.value]] = groupsOfFolds
|
|
181
181
|
|
|
182
182
|
def countSequential( connectionGraph: ndarray[Tuple[int, int, int], dtype[integer[Any]]]
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
183
|
+
, foldGroups: ndarray[Tuple[int] , dtype[integer[Any]]]
|
|
184
|
+
, gapsWhere: ndarray[Tuple[int] , dtype[integer[Any]]]
|
|
185
|
+
, my: ndarray[Tuple[int] , dtype[integer[Any]]]
|
|
186
|
+
, track: ndarray[Tuple[int, int] , dtype[integer[Any]]]
|
|
187
|
+
) -> None:
|
|
188
|
+
|
|
189
|
+
groupsOfFolds: int = 0
|
|
190
|
+
|
|
191
|
+
while activeLeafGreaterThan0Condition(my=my):
|
|
192
|
+
if activeLeafIsTheFirstLeafCondition(my=my) or leafBelowSentinelIs1Condition(track=track):
|
|
193
|
+
if activeLeafGreaterThanLeavesTotalCondition(foldGroups=foldGroups, my=my):
|
|
194
|
+
groupsOfFolds += 1
|
|
195
|
+
else:
|
|
196
|
+
findGapsInitializeVariables(my=my, track=track)
|
|
197
|
+
while loopUpToDimensionsTotal(my=my):
|
|
198
|
+
if dimensionsUnconstrainedCondition(connectionGraph=connectionGraph, my=my):
|
|
199
|
+
dimensionsUnconstrainedDecrement(my=my)
|
|
200
|
+
else:
|
|
201
|
+
leafConnecteeInitialization(connectionGraph=connectionGraph, my=my)
|
|
202
|
+
while loopingLeavesConnectedToActiveLeaf(my=my):
|
|
203
|
+
countGaps(gapsWhere=gapsWhere, my=my, track=track)
|
|
204
|
+
leafConnecteeUpdate(connectionGraph=connectionGraph, my=my, track=track)
|
|
205
|
+
indexDimensionIncrement(my=my)
|
|
206
|
+
indexMiniGapInitialization(my=my)
|
|
207
|
+
while loopingToActiveGapCeiling(my=my):
|
|
208
|
+
filterCommonGaps(gapsWhere=gapsWhere, my=my, track=track)
|
|
209
|
+
indexMiniGapIncrement(my=my)
|
|
210
|
+
while backtrackCondition(my=my, track=track):
|
|
211
|
+
backtrack(my=my, track=track)
|
|
212
|
+
if placeLeafCondition(my=my):
|
|
213
|
+
placeLeaf(gapsWhere=gapsWhere, my=my, track=track)
|
|
214
|
+
foldGroups[my[indexMy.taskIndex.value]] = groupsOfFolds
|
|
215
215
|
|
|
216
216
|
def doTheNeedful(connectionGraph: ndarray[Tuple[int, int, int], dtype[integer[Any]]]
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
217
|
+
, foldGroups: ndarray[Tuple[int] , dtype[integer[Any]]]
|
|
218
|
+
, gapsWhere: ndarray[Tuple[int] , dtype[integer[Any]]]
|
|
219
|
+
, mapShape: ndarray[Tuple[int] , dtype[integer[Any]]]
|
|
220
|
+
, my: ndarray[Tuple[int] , dtype[integer[Any]]]
|
|
221
|
+
, track: ndarray[Tuple[int, int] , dtype[integer[Any]]]
|
|
222
|
+
) -> None:
|
|
223
|
+
|
|
224
|
+
countInitialize(connectionGraph, gapsWhere, my, track)
|
|
225
|
+
|
|
226
|
+
if my[indexMy.taskDivisions.value] > 0:
|
|
227
|
+
countParallel(connectionGraph, foldGroups, gapsWhere, my, track)
|
|
228
|
+
else:
|
|
229
|
+
countSequential(connectionGraph, foldGroups, gapsWhere, my, track)
|