Class QuasiNewtonBFGS_to_UnconstrainedMinimization

java.lang.Object
org.ddogleg.optimization.wrap.QuasiNewtonBFGS_to_UnconstrainedMinimization
All Implemented Interfaces:
Serializable, IterativeOptimization, UnconstrainedMinimization, VerbosePrint

public class QuasiNewtonBFGS_to_UnconstrainedMinimization extends Object implements UnconstrainedMinimization
Wrapper around QuasiNewtonBFGS for UnconstrainedMinimization. For a description of what the line parameters mean see LineSearchMore94.
See Also:
  • Constructor Details

    • QuasiNewtonBFGS_to_UnconstrainedMinimization

      public QuasiNewtonBFGS_to_UnconstrainedMinimization(QuasiNewtonBFGS alg)
  • Method Details

    • setFunction

      public void setFunction(FunctionNtoS function, FunctionNtoN gradient, double minFunctionValue)
      Description copied from interface: UnconstrainedMinimization
      Specifies the function being optimized. A numerical Jacobian will be computed if null is passed in.
      Specified by:
      setFunction in interface UnconstrainedMinimization
      Parameters:
      function - Function being optimized.
      gradient - Partial derivative for each input in the function. If null a numerical gradient will be computed.
      minFunctionValue - Minimum possible value that 'function' can have. E.g. for least squares problems this value should be set to zero.
    • initialize

      public void initialize(double[] initial, double ftol, double gtol)
      Description copied from interface: UnconstrainedMinimization
      Specified by:
      initialize in interface UnconstrainedMinimization
      Parameters:
      initial - Initial parameters or guess.
      ftol - Relative convergence test based on function value. 0 disables test. 0 ≤ ftol < 1, Try 1e-12
      gtol - Absolute convergence test based on gradient. 0 disables test. 0 ≤ gtol. Try 1e-12
    • getParameters

      public double[] getParameters()
      Description copied from interface: UnconstrainedMinimization
      After each iteration this function can be called to get the current best set of parameters.
      Specified by:
      getParameters in interface UnconstrainedMinimization
    • iterate

      public boolean iterate() throws OptimizationException
      Description copied from interface: IterativeOptimization

      Updates the search. If the search has terminated true is returned. After the search has terminated invoke IterativeOptimization.isConverged() to see if a solution has been converged to or if it stopped for some other reason.

      NOTE: The optimization parameters might not be modified after iterate() is called. An internal bookkeeping step might have been done. To see if parameters have changed call IterativeOptimization.isUpdated().

      Specified by:
      iterate in interface IterativeOptimization
      Returns:
      true if it has converged or that no more progress can be made.
      Throws:
      OptimizationException
    • isConverged

      public boolean isConverged()
      Description copied from interface: IterativeOptimization
      Indicates if iteration stopped due to convergence or not.
      Specified by:
      isConverged in interface IterativeOptimization
      Returns:
      True if iteration stopped because it converged.
    • setVerbose

      public void setVerbose(@Nullable @Nullable PrintStream verbose, int level)
      Description copied from interface: IterativeOptimization
      If set to a non-null output then extra information will be printed to the specified stream.
      Specified by:
      setVerbose in interface IterativeOptimization
      Parameters:
      verbose - Stream that is printed to. Set to null to disable
      level - (Future use) Parameter which can be used to specify level of verbose output. Set to zero for now.
    • getFunctionValue

      public double getFunctionValue()
      Description copied from interface: UnconstrainedMinimization
      Returns the value of the objective function being evaluated at the current parameters value. If not supported then an exception is thrown.
      Specified by:
      getFunctionValue in interface UnconstrainedMinimization
      Returns:
      Objective function's value.
    • isUpdated

      public boolean isUpdated()
      Description copied from interface: IterativeOptimization
      True if the parameter(s) being optimized have been updated
      Specified by:
      isUpdated in interface IterativeOptimization
      Returns:
      True if parameters have been updated
    • setVerbose

      public void setVerbose(@Nullable @Nullable PrintStream out, @Nullable @Nullable Set<String> configuration)
      Description copied from interface: VerbosePrint
      If set to a non-null output then extra information will be printed to the specified stream.
      Specified by:
      setVerbose in interface VerbosePrint
      Parameters:
      out - Stream that is printed to. Set to null to disable
      configuration - (Future use) Set which specifies flags that can be used to turn on and off different output