|
WebCab Optimization v2.6 (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.webcab.ejb.math.optimization.unidimensional.BracketingAlgorithm
|
+--com.webcab.ejb.math.optimization.unidimensional.AccelBracketing
A simple acceleration bracketing algorithm which can be applied to any general unidimensional function
which is implemented via the interface UniDimensionalFunction.
This is a general bracketing algorithm and can be it can be applied to any continuous function. The voldg, oldg, and g fields of the result are guaranteed to respect the following condition: voldg < oldg && oldg > or voldg < oldg && oldg < g. This means that, if the function is continuous then certainly a local maximum (in the first case) or minimum (in the second case) is between a and c.
The second point is taken as x + mindist, or the closest point x1 that makes the condition f(x) != f(x1) valid. The third point is found by taking accelerated steps until there is a sense change.
The base class of the bracketing algorithms.,
A bracketing algorithm for differentiable functions.,
An alternative bracketing algorithm for generic unidimensional functions which
are implemented by the use of the interface {@link UniDimensionalFunction}.,
Serialized Form| Constructor Summary | |
AccelBracketing()
|
|
| Method Summary | |
protected Bracket |
extend(Bracket br,
UniDimensionalFunction f,
double bparam,
int extreme_type)
Expands the bracketing interval until it surely contains at least one extremum of the given type. |
protected Bracket |
find_initial(double x,
UniDimensionalFunction f,
double mindist)
Finds an initial, reasonable large interval, which can be subsequently enlarged by extend.
|
| Methods inherited from class com.webcab.ejb.math.optimization.unidimensional.BracketingAlgorithm |
bracketBidir, bracketUnidir |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AccelBracketing()
| Method Detail |
protected Bracket find_initial(double x,
UniDimensionalFunction f,
double mindist)
throws InvalidUniDimensionalFunctionException
extend.
The algorithm initially sets the b point of the bracket to x + mindist. If f(x + mindist) == f(x)
the interval is increased until f(x + interval_width) != f(x).
find_initial in class BracketingAlgorithmx - the starting pointf - the function. May implement UniDimensionalFunction or Derivative.mindist - The first try for the b parameter in the bracket is x + mindist. The value for this
should be of the same order with the tolerance or less. If this is too large, it is possible to skip
over one or more extrema. If it is very small, it is probable that the algorithm will make many
iterations until different function values are found.
InvalidUniDimensionalFunctionException - thrown if the users function returns invalid
values like infinity or NaN.
protected Bracket extend(Bracket br,
UniDimensionalFunction f,
double bparam,
int extreme_type)
throws InvalidUniDimensionalFunctionException,
UniDimensionalException
find_initial method.
extend in class BracketingAlgorithmbr - the bracket with points a and b set; a < b; oldg = f(b); voldg = f(a)f - the function. If the function does not implement Derivative an UniDimensionalException will be thrown.bparam - the acceleration factor for interval expansion. See Mathematical Documentation for a
discussion on recommended acceleration factors. Good values are 1.5 for increased safety or 2 for fast results.extreme_type - Specifies the type of extremum: 1 for minimum or -1 for maximum.
InvalidUniDimensionalFunctionException - thrown if the user function returns invalid
values like infinity or NaN.
UniDimensionalException
|
WebCab Optimization v2.6 (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||