|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.omegahat.Numerics.Optimizers.LineStepBasic
the basic representation of a step in a line search.
Included is a field for the step size.
Also included are some methods to deal with gradients, but gradient-free search algorithms can just ignore these.
| Field Summary | |
protected NumericArray |
direction
|
protected NumericArray |
origin
|
protected ModelPointNumericInt |
point
|
protected double |
slope
the slope (component of the gradient along this direction). |
protected double |
step
the step along the search direction. |
| Constructor Summary | |
LineStepBasic(ModelPointNumericInt point)
|
|
| Method Summary | |
void |
copyData(LineStep source)
Copy data from an arbitrary line step object. |
void |
copyData(LineStepBasic source)
Copy in the information from another LineStepBasic object. |
void |
evaluate()
|
NumericArray |
getDirection()
Accessor for direction field |
NumericArray |
getOrigin()
Accessor for origin field |
ModelPointNumericInt |
getPoint()
Accessor for point field |
double |
getSlope()
Accessor for slope field |
double |
getStep()
Accessor for step field |
double |
getValue()
Get the value of the underlying model at this step point. |
void |
getValues(boolean doValue,
boolean doGradient)
Compute the value and/or the gradient of the underlying model. |
NumericArray |
setDirection(NumericArray value)
Accessor for setting direction field. |
NumericArray |
setOrigin(NumericArray value)
Accessor for setting origin field |
ModelPointNumericInt |
setPoint(ModelPointNumericInt value)
Accessor for setting point field |
double |
setSlope()
compute the slope field from the gradient at the point. |
double |
setSlope(double value)
Accessor for setting slope field |
double |
setStep(double value)
Accessor for setting step field. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected ModelPointNumericInt point
protected double step
It may or may not be normalized, depending on the algorithm.
protected double slope
protected NumericArray direction
protected NumericArray origin
| Constructor Detail |
public LineStepBasic(ModelPointNumericInt point)
| Method Detail |
public ModelPointNumericInt getPoint()
point fieldgetPoint in interface LineSteppublic ModelPointNumericInt setPoint(ModelPointNumericInt value)
point fieldsetPoint in interface LineSteppublic double getStep()
step fieldgetStep in interface LineSteppublic double setStep(double value)
step field.The parameters property is set correspondingly, using the origin and direction properties and the given step.
setStep in interface LineSteppublic double getSlope()
slope fieldgetSlope in interface LineSteppublic double setSlope(double value)
slope fieldsetSlope in interface LineSteppublic NumericArray getDirection()
direction fieldgetDirection in interface LineSteppublic NumericArray setDirection(NumericArray value)
direction field.
Also computes and sets the slope property, if the gradient has been evaluated
at the point. To start a line search computation, you should arrange for the model
point to be evaluated, or else make sure that the slope is set explicitly. Also, if
the slope is to be set to something other than the inner product of the gradient and
the direction (a slightly perverse idea), you will need to set the slope explicitly
after setting the direction.
setDirection in interface LineSteppublic NumericArray getOrigin()
origin fieldgetOrigin in interface LineSteppublic NumericArray setOrigin(NumericArray value)
origin fieldsetOrigin in interface LineSteppublic double setSlope()
slope field from the gradient at the point.
If the gradient is null, the slope is NaN.
setSlope in interface LineSteppublic double getValue()
If necessary, evaluate the model.
getValue in interface LineStep
public void getValues(boolean doValue,
boolean doGradient)
public void copyData(LineStepBasic source)
LineStepBasic object.If suitable fields (parameters, gradient, hessian) exist in the current object, they are overwritten from the source; if they do not exist or are the wrong size, new fields are allocated.
public void copyData(LineStep source)
copyData in interface LineStep
public void evaluate()
throws ModelEvaluationException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||