|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgenopt.algorithm.util.linesearch.IntervalDivider
public abstract class IntervalDivider
Abstract class for doing a line search using an interval division method.
This project was carried out at:
and supported byGenOpt Copyright (c) 1998-2011, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
| Field Summary | |
|---|---|
private double |
dFMin
The minimal difference between the lowest 3 function values that has to be obtained before the search stops (only used if stoCri=1 |
protected int |
dimF
The number of function values |
protected int |
dimX
The number of independent variables |
(package private) double[] |
dx
The maximal width of the interval ( dx=xEnd-x0) |
private double |
fLowBor
The lower function value of the 2 border ( x0 |
protected static java.lang.String |
LS
System dependent line separator |
protected int |
nIntRed
The counter for number of interval reductions |
protected int |
nIntRedMax
The maximum number of interval reductions |
protected static int |
NINTREDMAXDEF
The default value for number of interval reductions |
protected Optimizer |
opt
The reference to the Optimizer object |
private int |
stoCri
The stopping criteria 0: number of interval reduction 1: maximum difference of the best 3 function values |
protected Point |
x0
The lowest value on abscissa (start of interval) |
protected Point |
x1
The 2nd lowest value on abscissa |
protected Point |
x2
The 3rd lowest value on abscissa |
protected Point |
x3
The highest value on abscissa |
protected Point |
xLow
The lower border of the uncertainty interval after stop of algorithm |
protected Point |
xMin
The point with the lowest obtained function value |
protected Point |
xUpp
The upper border of the uncertainty interval after stop of algorithm |
| Constructor Summary | |
|---|---|
IntervalDivider(Optimizer o)
Constructor |
|
| Method Summary | |
|---|---|
private Point |
getF(Point x)
Evaluates the objective function and reports the results |
private Point[] |
getF(Point[] x)
Evaluates the objective function and reports the results |
protected abstract double |
getReductionFactor()
Gets the reduction factor q = I(n+1)/I(n) |
Point |
getXLower()
gets the lower bound of the uncertainty interval |
Point |
getXMin()
Gets the point with the lowest function value |
Point |
getXUpper()
gets the upper bound of the uncertainty interval |
private boolean |
isDFltdFMin()
Checks whether the difference between the lower of either f1
or f2 and the lower of either f0 or f3
is smaller than the prescribed dFMin |
protected boolean |
iterate()
Checks whether the iteration has to be continued. |
int |
run(Point xS,
Point xE)
Runs a line search in the interval from xS to
xE. |
void |
setAbsDFMin(double dFMinimal,
int nMax)
Sets the minimal absolut difference between the lowest function values as the stopping criteria |
void |
setMaxIntRed(int n)
Sets the maximum number of interval reductions |
abstract void |
setUncertaintyInterval(double dx)
Sets the fraction of the desired uncertainty interval (0..1) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String LS
protected static final int NINTREDMAXDEF
protected Optimizer opt
protected int dimX
protected int dimF
double[] dx
dx=xEnd-x0)
protected Point x0
protected Point xMin
protected Point x1
protected Point x2
protected Point x3
protected Point xLow
protected Point xUpp
private double fLowBor
x0 or x3) that limit the interval
of uncertainty
protected int nIntRed
protected int nIntRedMax
private int stoCri
0: number of interval reduction
1: maximum difference of the best 3 function values
private double dFMin
stoCri=1
| Constructor Detail |
|---|
public IntervalDivider(Optimizer o)
o - a reference to the Optimizer object| Method Detail |
|---|
public Point getXMin()
protected abstract double getReductionFactor()
public int run(Point xS,
Point xE)
throws OptimizerException,
java.lang.Exception
xS to
xE.
xS - the start point of the intervalxE - the end point of the interval
-2 if the objective function has a null space, and
the stopping criteria is not equal to 1
-1 if the maximum number of iteration
is exceeded
+1 if the required accuracy is reached
OptimizerException
OptimizerException - if an OptimizerException occurs
java.lang.Exception - if an Exception occurspublic abstract void setUncertaintyInterval(double dx)
dx - the normalized fraction of the uncertainty interval
public void setAbsDFMin(double dFMinimal,
int nMax)
throws OptimizerException
dFMinimal - the minimal difference between the lowest
function values that has to be obtained before the search stopsnMax - the maximum number of iteration before the
search stops (in case that dFMinimal
cannot be obtained within a reasonable number of trials)
OptimizerExceptionpublic void setMaxIntRed(int n)
n - the maximum number of interval reductionspublic Point getXLower()
public Point getXUpper()
protected boolean iterate()
true if iteration has to be continued,
false if tolerance has been achieved, or
the required number of interval reductions has been achieved.private boolean isDFltdFMin()
f1
or f2 and the lower of either f0 or f3
is smaller than the prescribed dFMin
true if difference is smaller, false otherwise
private Point getF(Point x)
throws OptimizerException,
java.lang.Exception
x - the point being evaluated
OptimizerException - if an OptimizerException occurs
java.lang.Exception - if an Exception occurs
private Point[] getF(Point[] x)
throws OptimizerException,
java.lang.Exception
x - the point being evaluated
OptimizerException - if an OptimizerException occurs
java.lang.Exception - if an Exception occurs
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||