Family operators
discrete_modulus.families.family_operators
Operator functors on families.
SumShortest
SumShortest(F: Sequence[ShortestObjectFinder])
Shortest object operator for a summation of families.
Given a collection of families, finds the "sum" object obtained by
combining the shortest object from each family -- i.e. implements
ShortestObjectFinder for Gamma_1 + Gamma_2 + ... + Gamma_k.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
F
|
sequence of ShortestObjectFinder
|
The finders for the families being summed. |
required |
Source code in discrete_modulus/families/family_operators.py
68 69 70 71 72 73 74 75 | |
__call__
__call__(
rho: FloatArray | ExactArray, tol: float
) -> ShortestResult
Combines the shortest object from each family in the sum.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rho
|
numpy array
|
The current density. |
required |
tol
|
float
|
Passed through to each finder in |
required |
Returns:
| Type | Description |
|---|---|
ShortestResult
|
|
Source code in discrete_modulus/families/family_operators.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
UnionShortest
UnionShortest(F: Sequence[ShortestObjectFinder])
Shortest object operator for a union of families.
Given a collection of families (each represented by a
ShortestObjectFinder), finds the single shortest object across all
of them -- i.e. implements ShortestObjectFinder for
Gamma_1 U Gamma_2 U ... U Gamma_k.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
F
|
sequence of ShortestObjectFinder
|
The finders for the families being unioned. |
required |
Source code in discrete_modulus/families/family_operators.py
22 23 24 25 26 27 28 29 | |
__call__
__call__(
rho: FloatArray | ExactArray, tol: float
) -> ShortestResult
Finds the shortest object across all families in the union.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rho
|
numpy array
|
The current density. |
required |
tol
|
float
|
Passed through to each finder in |
required |
Returns:
| Type | Description |
|---|---|
ShortestResult
|
The result from whichever finder in |
Source code in discrete_modulus/families/family_operators.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |