public static class SwitchStrategy.BinaryStrategy extends SwitchStrategy
SwitchStrategy.BaseSwitchClosure, SwitchStrategy.BinaryStrategy, SwitchStrategy.RangesStrategy, SwitchStrategy.SequentialStrategy| Modifier and Type | Field and Description |
|---|---|
private static double |
MIN_PROBABILITY |
private double[] |
probabilitySums |
keyConstants, keyProbabilities| Constructor and Description |
|---|
BinaryStrategy(double[] keyProbabilities,
JavaConstant[] keyConstants) |
| Modifier and Type | Method and Description |
|---|---|
private void |
recurseBinarySwitch(SwitchStrategy.SwitchClosure closure,
int left,
int right,
int startDepth)
Recursively generate a list of comparisons that always subdivides the keys in the given
(inclusive) range in the middle (in terms of probability, not index).
|
void |
run(SwitchStrategy.SwitchClosure closure) |
getAverageEffort, getBestStrategy, getSliceEnd, registerDefaultEffort, registerEffort, toStringprivate static final double MIN_PROBABILITY
private final double[] probabilitySums
public BinaryStrategy(double[] keyProbabilities, JavaConstant[] keyConstants)
public void run(SwitchStrategy.SwitchClosure closure)
run in class SwitchStrategyprivate void recurseBinarySwitch(SwitchStrategy.SwitchClosure closure, int left, int right, int startDepth)