public class PnConjugateGradient
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
PnConjugateGradient() |
Modifier and Type | Method and Description |
---|---|
double |
dfrprmn(PdVector p,
double fTol,
PnFunction func)
Perform several energy minimization steps using a conjugate gradient method.
|
int |
getMaxNumIterations()
Get maximal number of allowed iterations in
dfrprmn . |
int |
getNumIterations()
Get number of used iterations in last call of
dfrprmn . |
boolean |
isStopped()
Get maximal number of allowed iterations in
dfrprmn . |
void |
setMaxNumIterations(int num)
Set maximal number of allowed iterations in
dfrprmn . |
void |
setStopped(boolean bStopped)
Set maximal number of allowed iterations in
dfrprmn . |
public int getMaxNumIterations()
dfrprmn
.
If max number of iteration is reached then dfrprmn stops and returns.public void setMaxNumIterations(int num)
dfrprmn
.
If max number of iteration is reached then dfrprmn stops and returns.public int getNumIterations()
dfrprmn
.
Return -1 if no iteration performed yet.public boolean isStopped()
dfrprmn
.
If max number of iteration is reached then dfrprmn stops and returns.public void setStopped(boolean bStopped)
dfrprmn
.
If max number of iteration is reached then dfrprmn stops and returns.public double dfrprmn(PdVector p, double fTol, PnFunction func)
Maximal number of steps is bounded by getMaxNumIterations
which can be adjusted before calling this methods.
If more iterations than getMaxNumIterations
are 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.
p
- vector with variable data, will be changed.fTol
- relative difference of energy used as stop criteriafunc
- function to be minimizedsetMaxNumIterations(int)
"