jvx.numeric
Class PnConjugateGradient
- java.lang.Object
-
- jvx.numeric.PnConjugateGradient
-
- All Implemented Interfaces:
- java.io.Serializable
public class PnConjugateGradient extends java.lang.Object implements java.io.SerializableMinimize functionals using conjugate gradient method.- See Also:
- Serialized Form
- Author:
- Numerical Recipes, changed to Java and adapted by Konrad Polthier
- Version:
- 30.04.06, 1.10 revised (kp) Max number of iterations is now a configurable non-static variable.
00.00.98, 1.00 created (kp)
-
-
Constructor Summary
Constructors Constructor and Description PnConjugateGradient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubledfrprmn(PdVector p, double fTol, PnFunction func)Perform several energy minimization steps using a conjugate gradient method.intgetMaxNumIterations()Get maximal number of allowed iterations indfrprmn.intgetNumIterations()Get number of used iterations in last call ofdfrprmn.booleanisStopped()Get maximal number of allowed iterations indfrprmn.voidsetMaxNumIterations(int num)Set maximal number of allowed iterations indfrprmn.voidsetStopped(boolean bStopped)Set maximal number of allowed iterations indfrprmn.
-
-
-
Method Detail
-
getMaxNumIterations
public int getMaxNumIterations()
Get maximal number of allowed iterations indfrprmn. If max number of iteration is reached then dfrprmn stops and returns.- Since:
- JavaView 3.96.009
- Version:
- 30.04.06, 1.00 created (kp)
-
setMaxNumIterations
public void setMaxNumIterations(int num)
Set maximal number of allowed iterations indfrprmn. If max number of iteration is reached then dfrprmn stops and returns.- Since:
- JavaView 3.96.009
- Version:
- 30.04.06, 1.00 created (kp)
-
getNumIterations
public int getNumIterations()
Get number of used iterations in last call ofdfrprmn. Return -1 if no iteration performed yet.- Version:
- 30.04.06, 1.10 revised (kp) Return value changed to -1 if not run yet.
-
isStopped
public boolean isStopped()
Get maximal number of allowed iterations indfrprmn. If max number of iteration is reached then dfrprmn stops and returns.- Since:
- JavaView 3.96.009
- Version:
- 30.04.06, 1.00 created (kp)
-
setStopped
public void setStopped(boolean bStopped)
Set maximal number of allowed iterations indfrprmn. If max number of iteration is reached then dfrprmn stops and returns.- Since:
- JavaView 3.96.009
- Version:
- 30.04.06, 1.00 created (kp)
-
dfrprmn
public double dfrprmn(PdVector p, double fTol, PnFunction func)
Perform several energy minimization steps using a conjugate gradient method. The set of variables and the energy are given as parameters.Maximal number of steps is bounded by
getMaxNumIterationswhich can be adjusted before calling this methods.If more iterations than
getMaxNumIterationsare needed until the stop criteria is reached then the method stops and returns with a warning. In this case the resulting vector does not represent a minima but the current state of the minimization process, and therefore can be used as initial value for another call of this method.- Parameters:
p- vector with variable data, will be changed.fTol- relative difference of energy used as stop criteriafunc- function to be minimized- Returns:
- function value at minimum
- See Also:
setMaxNumIterations(int)
-
-
"