java.lang.Object
org.hipparchus.optim.nonlinear.vector.constrained.BFGSUpdater

public class BFGSUpdater extends Object
BFGS Hessian updater with dynamic damping and robustness improvements.

Manages Hessian updates for SQP solvers by:

  • Checking curvature condition
  • Applying dynamic damping if necessary
  • Skipping update if curvature still fails after damping
  • Soft regularization of diagonal entries on repeated failures
  • Automatic Hessian reset after configurable failures
Since:
4.1
  • Constructor Details

    • BFGSUpdater

      public BFGSUpdater(RealMatrix initialHess, double eps, boolean autoScale, double decompositionEpsilon)
      Creates a new updater.
      Parameters:
      initialHess - initial positive‐definite Hessian matrix
      eps - treshold to apply auto scale sty < sqrt(eps)
      autoScale - true apply auto hessian rescaling
      decompositionEpsilon - tolerance for symmetric matrices decomposition
  • Method Details

    • getHessian

      public RealMatrix getHessian()
      Returns the current Hessian matrix H = L·Lᵀ.
      Returns:
      current Hessian
    • update

      public int update(RealVector s, RealVector y1)
      Updates the Hessian approximation using the BFGS formula.

      If curvature condition fails, applies damping or regularization.

      Parameters:
      s - displacement vector (xk+1 − xk)
      y1 - gradient difference (∇fk+1 − ∇fk)
      Returns:
      type of update:
      • 0: update is done
      • 1: sHs not positive (zero step), Hessian reset to identity
      • 2: sty not positive even after damping (non-finite input), skipped update
      • 3: downdate would lose positive definiteness, Hessian reset to factor*I
    • resetHessian

      public void resetHessian()
      Resets the Hessian approximation to its initial value.
    • resetHessian

      public void resetHessian(double gamma)
      Resets the Hessian approximation with information on the curvature.
      Parameters:
      gamma - scale factor
    • resetHessianFactor

      public void resetHessianFactor()
      Resets the Hessian approximation with information on the curvature for external usage
    • getL

      public RealMatrix getL()
      Returns the current lower-triangular Cholesky factor L.
      Returns:
      current lower-triangular Cholesky factor