cct.math
Class DFPMin

java.lang.Object
  extended by cct.math.DFPMin
All Implemented Interfaces:
MinimizerInterface

public class DFPMin
extends java.lang.Object
implements MinimizerInterface

Title:

Description:

The Broyden-Fletcher-Goldfarb-Shanno variant of Davidon-Fletcher-Powell minimization. Adopted from the Numerical Recipes in C

Copyright: Copyright (c) 2006

Company: ANU


Field Summary
(package private) static java.util.ArrayList completionMessages
           
(package private)  boolean debug
           
(package private)  double EPS
           
(package private)  float fret
           
(package private)  float gTol
           
(package private)  int iter
           
(package private)  int ITMAX
           
(package private)  float MAXGRAD
           
(package private)  boolean maxGradConvergence
           
(package private)  float MAXGRMS
           
(package private)  boolean maxGRMSConvergence
           
(package private)  MinimizeProgressInterface minimizationProgress
           
(package private)  double STPMX
           
(package private)  double TOLX
           
 
Constructor Summary
DFPMin()
           
 
Method Summary
 void enableMaxGradConvergence(boolean enable)
           
 void enableMaxGRMSConvergence(boolean enable)
           
(package private)  void freeAll()
           
 int getActualIterNum()
           
 java.lang.String getExitCodeDescription(int code)
           
 float[] getGradients()
           
 float getMaxGradientConv()
           
 int getMaxIterations()
           
 float getMaxRMSGradientConv()
           
 java.lang.String getName()
           
(package private)  double getRMS(int n, float[] v)
           
(package private)  float gradNorm(int n, float[] g)
           
 boolean isMaxGradConvergence()
           
 boolean isMaxRMSGradConvergence()
           
static void main(java.lang.String[] args)
           
(package private)  float maxGrad(int n, float[] g)
           
 int minimizeFunction(int n, float[] p, MinimizedFunctionInterface func)
          Given a starting point p[1..n] that is a vector of length n, the Broyden-Fletcher-Goldfarb- Shanno variant of Davidon-Fletcher-Powell minimization is performed on a function func, using its gradient as calculated by a routine dfunc.
 void setGTolerance(float gtol)
           
 void setMaxGradientConv(float maxgrad)
           
 void setMaximumStep(double step)
           
 void setMaxIterations(int iter)
           
 void setMaxRMSGradientConv(float maxgrms)
           
 void setMinimizeProgressInterface(MinimizeProgressInterface mpi)
           
 boolean useGradients()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

completionMessages

static final java.util.ArrayList completionMessages

ITMAX

int ITMAX

EPS

double EPS

TOLX

double TOLX

MAXGRAD

float MAXGRAD

MAXGRMS

float MAXGRMS

STPMX

double STPMX

iter

int iter

fret

float fret

gTol

float gTol

maxGradConvergence

boolean maxGradConvergence

maxGRMSConvergence

boolean maxGRMSConvergence

debug

boolean debug

minimizationProgress

MinimizeProgressInterface minimizationProgress
Constructor Detail

DFPMin

public DFPMin()
Method Detail

setGTolerance

public void setGTolerance(float gtol)

getActualIterNum

public int getActualIterNum()

setMaximumStep

public void setMaximumStep(double step)

minimizeFunction

public int minimizeFunction(int n,
                            float[] p,
                            MinimizedFunctionInterface func)
Given a starting point p[1..n] that is a vector of length n, the Broyden-Fletcher-Goldfarb- Shanno variant of Davidon-Fletcher-Powell minimization is performed on a function func, using its gradient as calculated by a routine dfunc. The convergence requirement on zeroing the gradient is input as gtol. Returned quantities are p[1..n] (the location of the minimum), iter (the number of iterations that were performed), and fret (the minimum value of the function). The routine lnsrch is called to perform approximate line minimizations.

Specified by:
minimizeFunction in interface MinimizerInterface
Parameters:
n - int
p - float[]
gtol - float
iter - int
fret - float
func - MinimizedFunctionInterface

freeAll

void freeAll()

gradNorm

float gradNorm(int n,
               float[] g)

maxGrad

float maxGrad(int n,
              float[] g)

getRMS

double getRMS(int n,
              float[] v)

main

public static void main(java.lang.String[] args)

enableMaxGradConvergence

public void enableMaxGradConvergence(boolean enable)
Specified by:
enableMaxGradConvergence in interface MinimizerInterface

enableMaxGRMSConvergence

public void enableMaxGRMSConvergence(boolean enable)
Specified by:
enableMaxGRMSConvergence in interface MinimizerInterface

getExitCodeDescription

public java.lang.String getExitCodeDescription(int code)
Specified by:
getExitCodeDescription in interface MinimizerInterface

getGradients

public float[] getGradients()
Specified by:
getGradients in interface MinimizerInterface

getMaxGradientConv

public float getMaxGradientConv()
Specified by:
getMaxGradientConv in interface MinimizerInterface

getMaxRMSGradientConv

public float getMaxRMSGradientConv()
Specified by:
getMaxRMSGradientConv in interface MinimizerInterface

getMaxIterations

public int getMaxIterations()
Specified by:
getMaxIterations in interface MinimizerInterface

getName

public java.lang.String getName()
Specified by:
getName in interface MinimizerInterface

isMaxGradConvergence

public boolean isMaxGradConvergence()
Specified by:
isMaxGradConvergence in interface MinimizerInterface

isMaxRMSGradConvergence

public boolean isMaxRMSGradConvergence()
Specified by:
isMaxRMSGradConvergence in interface MinimizerInterface

setMaxGradientConv

public void setMaxGradientConv(float maxgrad)
Specified by:
setMaxGradientConv in interface MinimizerInterface

setMaxRMSGradientConv

public void setMaxRMSGradientConv(float maxgrms)
Specified by:
setMaxRMSGradientConv in interface MinimizerInterface

setMaxIterations

public void setMaxIterations(int iter)
Specified by:
setMaxIterations in interface MinimizerInterface

useGradients

public boolean useGradients()
Specified by:
useGradients in interface MinimizerInterface

setMinimizeProgressInterface

public void setMinimizeProgressInterface(MinimizeProgressInterface mpi)
Specified by:
setMinimizeProgressInterface in interface MinimizerInterface