meshi.optimizers
Class SimpleStepLength

java.lang.Object
  extended by meshi.optimizers.LineSearch
      extended by 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.


Field Summary
private  double[][] coordinates
           
(package private)  int i
           
private  double INFINITY
           
private  double new_e
           
private  double old_e
           
private  double stepSize
           
private  double stepSizeExpansion
           
private  double stepSizeReduction
           
private  double verySmall
           
 
Fields inherited from class meshi.optimizers.LineSearch
energy
 
Constructor Summary
SimpleStepLength(TotalEnergy energy, double stepSize1, double stepSizeReduction, double stepSizeExpansion)
           
 
Method Summary
 double findStepLength(double[][] inputCoordinates)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

SimpleStepLength

public SimpleStepLength(TotalEnergy energy,
                        double stepSize1,
                        double stepSizeReduction,
                        double stepSizeExpansion)
Method Detail

findStepLength

public double findStepLength(double[][] inputCoordinates)
                      throws LineSearchException
Specified by:
findStepLength in class LineSearch
Throws:
LineSearchException