| Modifier and Type | Field and Description |
|---|---|
| private AbstractConverter[] | |
| private final BiPredicate | |
| private final BinaryOperator | |
| private final BiPredicate | |
| private final BiPredicate |
| Access | Constructor and Description |
|---|---|
| pack-priv | CompositionTask(BiPredicate<AbstractConverter, AbstractConverter> isNormalFormOrderWhenIdentity, BiPredicate<AbstractConverter, AbstractConverter> isNormalFormOrderWhenCommutative, BiPredicate<AbstractConverter, AbstractConverter> canReduce, BinaryOperator<AbstractConverter> doReduce)
|
| Modifier and Type | Method and Description |
|---|---|
| public AbstractConverter | reduceToNormalForm(List<? extends UnitConverter> conversionSteps)
Description of a brute-force approach: Given 'conversionSteps' a list of converters, where order matters, we form a permutation group of all allowed permutations 'reachable' through 'allowed' swapping. |
| private static AbstractConverter | sequenceToConverter(AbstractConverter[] sequence)
converts an array of converters to a single converter object |
| private void | sortToNormalFormOrder(AbstractConverter[] arrayOfConverters)
sorts an array of converters to normal-form order |
| private int |
| arrayOfConverters | back to summary |
|---|---|
| private AbstractConverter[] arrayOfConverters | |
| canReduce | back to summary |
|---|---|
| private final BiPredicate<AbstractConverter, AbstractConverter> canReduce | |
| doReduce | back to summary |
|---|---|
| private final BinaryOperator<AbstractConverter> doReduce | |
| isNormalFormOrderWhenCommutative | back to summary |
|---|---|
| private final BiPredicate<AbstractConverter, AbstractConverter> isNormalFormOrderWhenCommutative | |
| isNormalFormOrderWhenIdentity | back to summary |
|---|---|
| private final BiPredicate<AbstractConverter, AbstractConverter> isNormalFormOrderWhenIdentity | |
| CompositionTask | back to summary |
|---|---|
| pack-priv CompositionTask(BiPredicate<AbstractConverter, AbstractConverter> isNormalFormOrderWhenIdentity, BiPredicate<AbstractConverter, AbstractConverter> isNormalFormOrderWhenCommutative, BiPredicate<AbstractConverter, AbstractConverter> canReduce, BinaryOperator<AbstractConverter> doReduce) | |
| reduceToNormalForm | back to summary |
|---|---|
| public AbstractConverter reduceToNormalForm(List<? extends UnitConverter> conversionSteps) Description of a brute-force approach:
Given 'conversionSteps' a list of converters, where order matters,
we form a permutation group of all allowed permutations
'reachable' through 'allowed' swapping.
Swapping is allowed for 2 consecutive converters that are both
multiply transformations (x.isLinear()==true).
We search this permutation group for any sequence of converters, that allows simplification:
| |
| sequenceToConverter | back to summary |
|---|---|
| private static AbstractConverter sequenceToConverter(AbstractConverter[] sequence) converts an array of converters to a single converter object | |
| sortToNormalFormOrder | back to summary |
|---|---|
| private void sortToNormalFormOrder(AbstractConverter[] arrayOfConverters) sorts an array of converters to normal-form order | |
| trySimplify | back to summary |
|---|---|
private int trySimplify()
| |