Class FullHessianUpdateStrategy

java.lang.Object
de.labathome.trustconstr.FullHessianUpdateStrategy
All Implemented Interfaces:
HessianUpdateStrategy, BiFunction<Matrix,Object,Matrix>
Direct Known Subclasses:
BFGS, SR1

public abstract class FullHessianUpdateStrategy extends Object implements HessianUpdateStrategy
Hessian update strategy with full dimensional internal representation.
  • Field Details

    • scale

      protected double scale
      Current scaling factor applied to the Hessian (or its inverse).
    • firstIteration

      protected boolean firstIteration
      true until the first update(Matrix, Matrix) call has been performed.
    • approxType

      protected HessianApproximationType approxType
      Whether B (HESSIAN) or H (INV_HESSIAN) is being approximated.
    • n

      protected long n
      Problem dimension.
    • B

      protected DenseMatrix B
      Hessian approximation (used when approxType == HESSIAN).
    • H

      protected DenseMatrix H
      Inverse-Hessian approximation (used when approxType == INV_HESSIAN).
  • Constructor Details

    • FullHessianUpdateStrategy

      protected FullHessianUpdateStrategy(boolean initialScaleAuto, double initialScale)
      Parameters:
      initialScaleAuto - whether the initial scale is auto-derived
      initialScale - user-specified initial scale; ignored when initialScaleAuto is true
  • Method Details

    • initialize

      public void initialize(long n, HessianApproximationType approxType)
      Description copied from interface: HessianUpdateStrategy
      Initialize internal matrix.

      Allocate internal memory for storing and updating the Hessian or its inverse.

      Specified by:
      initialize in interface HessianUpdateStrategy
      Parameters:
      n - Problem dimension.
      approxType - Selects either the Hessian or the inverse Hessian. When set to 'hess' the Hessian will be stored and updated. When set to 'inv_hess' its inverse will be used instead.
    • autoScale

      protected double autoScale(Matrix deltaX, Matrix deltaG)
      Heuristic scaling factor for the initial Hessian (or inverse-Hessian) approximation, based on Nocedal & Wright (2006), p.143 formula (6.20).
      Parameters:
      deltaX - step in x: x_k - x_{k-1}
      deltaG - step in the gradient: g_k - g_{k-1}
      Returns:
      scaling factor used to multiply the identity initialisation
    • update

      public void update(Matrix deltaX, Matrix deltaG)
      Description copied from interface: HessianUpdateStrategy
      Update internal matrix.

      Update Hessian matrix or its inverse (depending on how 'approx_type' is defined) using information about the last evaluated points.

      Specified by:
      update in interface HessianUpdateStrategy
      Parameters:
      deltaX - The difference between two points the gradient function have been evaluated at: ``delta_x = x2 - x1``.
      deltaG - The difference between the gradients: ``delta_grad = grad(x2) - grad(x1)``.
    • apply

      public Matrix apply(Matrix p, Object args)
      Specified by:
      apply in interface BiFunction<Matrix,Object,Matrix>
    • getMatrix

      public Matrix getMatrix()
      Description copied from interface: HessianUpdateStrategy
      Return current internal matrix.
      Specified by:
      getMatrix in interface HessianUpdateStrategy
      Returns:
      Dense matrix containing either the Hessian or its inverse (depending on how 'approx_type' is defined).