meshi.optimizers
Class SimpleStepLength
java.lang.Object
meshi.optimizers.LineSearch
meshi.optimizers.SimpleStepLength
public class SimpleStepLength
- extends LineSearch
This class provide a simple way to find the step length. It start with a certain length and check if
it brings to energy reduction. If it does not it is shortened by a reduction factor. This repeats until a
step size is found that produce energy reduction, or the step size is so small that an exception is thrown.
After the step size is returned, it is multiplied by an expansion factor, so that the next call to this
class evaluation is started with a longer guess. If the expension factor is set to 0, the step size initial
guess is always 1 (as should be tried for all quasi-newton techniques).
How to use this class:
----------------------
a) Instantiate this class with the desired parameters.
b) In a position Xk: evaluate the energy gradients and coordinates to position Xk.
c) Run 'findStepLength(Vec[n][2])' where the first column in Vec is the position Xk, and the second
column is the direction Pk. This method returns the found step length. This method also changes the coordinates
in class 'energy' to the coordinates in the new (minimized) position: Xk+1 = Xk + (step_length)*Pk. Also the
gradients in the energy class are updated.
d) Check for thrown exceptions to make sure that the step length is correct.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
stepSize
private double stepSize
stepSizeReduction
private double stepSizeReduction
stepSizeExpansion
private double stepSizeExpansion
old_e
private double old_e
new_e
private double new_e
coordinates
private double[][] coordinates
verySmall
private final double verySmall
INFINITY
private final double INFINITY
- See Also:
- Constant Field Values
i
int i
SimpleStepLength
public SimpleStepLength(TotalEnergy energy,
double stepSize1,
double stepSizeReduction,
double stepSizeExpansion)
findStepLength
public double findStepLength(double[][] inputCoordinates)
throws LineSearchException
- Specified by:
findStepLength in class LineSearch
- Throws:
LineSearchException