mapFolding 0.3.11__py3-none-any.whl → 0.4.0__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 +44 -32
- 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 +2 -1
- mapFolding/someAssemblyRequired/getLLVMforNoReason.py +12 -12
- mapFolding/someAssemblyRequired/makeJob.py +48 -48
- mapFolding/someAssemblyRequired/synthesizeModuleJAX.py +17 -17
- mapFolding/someAssemblyRequired/synthesizeNumba.py +345 -803
- mapFolding/someAssemblyRequired/synthesizeNumbaGeneralized.py +371 -0
- mapFolding/someAssemblyRequired/synthesizeNumbaJob.py +150 -0
- mapFolding/someAssemblyRequired/synthesizeNumbaModules.py +75 -0
- mapFolding/syntheticModules/__init__.py +0 -0
- mapFolding/syntheticModules/numba_countInitialize.py +2 -2
- mapFolding/syntheticModules/numba_countParallel.py +3 -3
- mapFolding/syntheticModules/numba_countSequential.py +28 -28
- mapFolding/syntheticModules/numba_doTheNeedful.py +6 -6
- mapFolding/theDao.py +168 -169
- mapFolding/theSSOT.py +190 -162
- mapFolding/theSSOTnumba.py +91 -75
- mapFolding-0.4.0.dist-info/METADATA +122 -0
- mapFolding-0.4.0.dist-info/RECORD +41 -0
- tests/conftest.py +238 -128
- tests/test_oeis.py +80 -80
- tests/test_other.py +137 -224
- tests/test_tasks.py +21 -21
- tests/test_types.py +2 -2
- mapFolding-0.3.11.dist-info/METADATA +0 -155
- mapFolding-0.3.11.dist-info/RECORD +0 -39
- tests/conftest_tmpRegistry.py +0 -62
- tests/conftest_uniformTests.py +0 -53
- {mapFolding-0.3.11.dist-info → mapFolding-0.4.0.dist-info}/LICENSE +0 -0
- {mapFolding-0.3.11.dist-info → mapFolding-0.4.0.dist-info}/WHEEL +0 -0
- {mapFolding-0.3.11.dist-info → mapFolding-0.4.0.dist-info}/entry_points.txt +0 -0
- {mapFolding-0.3.11.dist-info → mapFolding-0.4.0.dist-info}/top_level.txt +0 -0
|
@@ -3,9 +3,9 @@ from mapFolding import indexTrack
|
|
|
3
3
|
from numba import uint8
|
|
4
4
|
from numba import jit
|
|
5
5
|
from numba import int64
|
|
6
|
-
from numpy import ndarray
|
|
7
|
-
from numpy import dtype
|
|
8
6
|
from numpy import integer
|
|
7
|
+
from numpy import dtype
|
|
8
|
+
from numpy import ndarray
|
|
9
9
|
from typing import Any
|
|
10
10
|
from typing import Tuple
|
|
11
11
|
|
|
@@ -25,33 +25,33 @@ def countSequential(connectionGraph: ndarray[Tuple[int, int, int], dtype[integer
|
|
|
25
25
|
gap1ndex = my[indexMy.gap1ndex.value]
|
|
26
26
|
taskIndex = my[indexMy.taskIndex.value]
|
|
27
27
|
groupsOfFolds: int = 0
|
|
28
|
-
doFindGaps = True
|
|
29
28
|
while leaf1ndex:
|
|
30
|
-
if
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
29
|
+
if leaf1ndex <= 1 or leafBelow[0] == 1:
|
|
30
|
+
if leaf1ndex > foldGroups[-1]:
|
|
31
|
+
groupsOfFolds += 1
|
|
32
|
+
else:
|
|
33
|
+
dimensionsUnconstrained = dimensionsTotal
|
|
34
|
+
gap1ndexCeiling = gapRangeStart[leaf1ndex - 1]
|
|
35
|
+
indexDimension = 0
|
|
36
|
+
while indexDimension < dimensionsTotal:
|
|
37
|
+
if connectionGraph[indexDimension, leaf1ndex, leaf1ndex] == leaf1ndex:
|
|
38
|
+
dimensionsUnconstrained -= 1
|
|
39
|
+
else:
|
|
40
|
+
leafConnectee = connectionGraph[indexDimension, leaf1ndex, leaf1ndex]
|
|
41
|
+
while leafConnectee != leaf1ndex:
|
|
42
|
+
gapsWhere[gap1ndexCeiling] = leafConnectee
|
|
43
|
+
if countDimensionsGapped[leafConnectee] == 0:
|
|
44
|
+
gap1ndexCeiling += 1
|
|
45
|
+
countDimensionsGapped[leafConnectee] += 1
|
|
46
|
+
leafConnectee = connectionGraph[indexDimension, leaf1ndex, leafBelow[leafConnectee]]
|
|
47
|
+
indexDimension += 1
|
|
48
|
+
indexMiniGap = gap1ndex
|
|
49
|
+
while indexMiniGap < gap1ndexCeiling:
|
|
50
|
+
gapsWhere[gap1ndex] = gapsWhere[indexMiniGap]
|
|
51
|
+
if countDimensionsGapped[gapsWhere[indexMiniGap]] == dimensionsUnconstrained:
|
|
52
|
+
gap1ndex += 1
|
|
53
|
+
countDimensionsGapped[gapsWhere[indexMiniGap]] = 0
|
|
54
|
+
indexMiniGap += 1
|
|
55
55
|
while leaf1ndex and gap1ndex == gapRangeStart[leaf1ndex - 1]:
|
|
56
56
|
leaf1ndex -= 1
|
|
57
57
|
leafBelow[leafAbove[leaf1ndex]] = leafBelow[leaf1ndex]
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
from mapFolding.syntheticModules.numba_countInitialize import countInitialize
|
|
2
|
+
from mapFolding.syntheticModules.numba_countParallel import countParallel
|
|
3
|
+
from mapFolding.syntheticModules.numba_countSequential import countSequential
|
|
1
4
|
from mapFolding import indexMy
|
|
2
5
|
from numba import uint8
|
|
3
6
|
from numba import jit
|
|
4
7
|
from numba import int64
|
|
5
|
-
from numpy import ndarray
|
|
6
|
-
from numpy import dtype
|
|
7
8
|
from numpy import integer
|
|
9
|
+
from numpy import dtype
|
|
10
|
+
from numpy import ndarray
|
|
8
11
|
from typing import Any
|
|
9
12
|
from typing import Tuple
|
|
10
|
-
from mapFolding.syntheticModules.numba_countInitialize import countInitialize
|
|
11
|
-
from mapFolding.syntheticModules.numba_countParallel import countParallel
|
|
12
|
-
from mapFolding.syntheticModules.numba_countSequential import countSequential
|
|
13
13
|
|
|
14
|
-
@jit((uint8[:, :, ::1], int64[::1], uint8[::1], uint8[::1], uint8[::1], uint8[:, ::1]), _nrt=True, boundscheck=
|
|
14
|
+
@jit((uint8[:, :, ::1], int64[::1], uint8[::1], uint8[::1], uint8[::1], uint8[:, ::1]), _nrt=True, boundscheck=False, cache=True, error_model='numpy', fastmath=True, forceinline=True, inline='always', looplift=False, no_cfunc_wrapper=False, no_cpython_wrapper=False, nopython=True, parallel=False)
|
|
15
15
|
def doTheNeedful(connectionGraph: ndarray[Tuple[int, int, int], dtype[integer[Any]]], foldGroups: ndarray[Tuple[int], dtype[integer[Any]]], gapsWhere: ndarray[Tuple[int], dtype[integer[Any]]], mapShape: ndarray[Tuple[int], dtype[integer[Any]]], my: ndarray[Tuple[int], dtype[integer[Any]]], track: ndarray[Tuple[int, int], dtype[integer[Any]]]) -> None:
|
|
16
16
|
countInitialize(connectionGraph, gapsWhere, my, track)
|
|
17
17
|
if my[indexMy.taskDivisions.value] > 0:
|
mapFolding/theDao.py
CHANGED
|
@@ -4,227 +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
|
-
|
|
38
|
-
|
|
39
|
-
def dimension1ndexIncrement(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> None:
|
|
40
|
-
my[indexMy.indexDimension.value] += 1
|
|
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
|
|
41
38
|
|
|
42
39
|
def dimensionsUnconstrainedCondition(connectionGraph: ndarray[Tuple[int, int, int], dtype[integer[Any]]], my: ndarray[Tuple[int], dtype[integer[Any]]]) -> Any:
|
|
43
|
-
|
|
40
|
+
return connectionGraph[my[indexMy.indexDimension.value], my[indexMy.leaf1ndex.value], my[indexMy.leaf1ndex.value]] == my[indexMy.leaf1ndex.value]
|
|
44
41
|
|
|
45
42
|
def dimensionsUnconstrainedDecrement(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> None:
|
|
46
|
-
|
|
43
|
+
my[indexMy.dimensionsUnconstrained.value] -= 1
|
|
47
44
|
|
|
48
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:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
|
53
50
|
|
|
54
51
|
def findGapsInitializeVariables(my: ndarray[Tuple[int], dtype[integer[Any]]], track: ndarray[Tuple[int, int], dtype[integer[Any]]]) -> None:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
+
|
|
56
|
+
def indexDimensionIncrement(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> None:
|
|
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
|
-
def
|
|
85
|
-
|
|
84
|
+
def loopUpToDimensionsTotal(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> Any:
|
|
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
|
-
|
|
215
|
-
foldGroups[my[indexMy.taskIndex.value]] = groupsOfFolds
|
|
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
|
|
216
215
|
|
|
217
216
|
def doTheNeedful(connectionGraph: ndarray[Tuple[int, int, int], dtype[integer[Any]]]
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
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)
|