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.Serializable

  Minimize 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
    --- | ---
    `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`.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PnConjugateGradient

          public PnConjugateGradient()

  - ### Method Detail

    - #### getMaxNumIterations

          public int getMaxNumIterations()

      Get maximal number of allowed iterations in `dfrprmn`. 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 in `dfrprmn`. 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 of `dfrprmn`. 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 in `dfrprmn`. 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 in `dfrprmn`. 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 `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.

      Parameters:
        `p` - vector with variable data, will be changed.
        `fTol` - relative difference of energy used as stop criteria
        `func` - function to be minimized
      Returns:
        function value at minimum
      See Also:
        `setMaxNumIterations(int)`

"

The software JavaView? is copyright protected. All Rights Reserved.
"