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

public class SQPLogger extends Object
Utility class for formatting SQP iteration logs with dynamic precision and aligned columns.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SQPLogger(double epsilon)
    Constructs a LogFormatter with custom epsilon.
  • Method Summary

    Modifier and Type
    Method
    Description
    static SQPLogger
    Get default logger.
    formatRow(int iter, double alpha, int lsCount, double dxNorm, double dxHdx, double complSlack, double kkt, double viol, double sigma, double penalty, double fx, double funDiff, int hUpdate)
    Format one row.
    Get header line.
    void
    Log header.
    void
    logRow(int funEvalCount, boolean crit2, boolean crit1, boolean crit5, boolean crit0, boolean crit3, boolean crit4)
    Log one row of convergence criteria flags (kept aligned with table layout).
    void
    logRow(int iter, double alpha, int lsCount, double dxNorm, double dxHdx, double complSlack, double kkt, double viol, double sigma, double penalty, double fx, double funDiff, int hUpdate)
    Log one row.
    void
    Set debug printer.
    void
    setEps(double epsilon)
    Updates the formatter precision and formats based on a new epsilon value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SQPLogger

      public SQPLogger(double epsilon)
      Constructs a LogFormatter with custom epsilon.
      Parameters:
      epsilon - convergence threshold
  • Method Details

    • setEps

      public void setEps(double epsilon)
      Updates the formatter precision and formats based on a new epsilon value.
      Parameters:
      epsilon - convergence threshold
    • setDebugPrinter

      public void setDebugPrinter(DebugPrinter debugPrinter)
      Set debug printer.
      Parameters:
      debugPrinter - debug printer
    • header

      public String header()
      Get header line.
      Returns:
      header line
    • formatRow

      public String formatRow(int iter, double alpha, int lsCount, double dxNorm, double dxHdx, double complSlack, double kkt, double viol, double sigma, double penalty, double fx, double funDiff, int hUpdate)
      Format one row.
      Parameters:
      iter - iteration number
      alpha - step length
      lsCount - line search iteration
      dxNorm - || dX ||
      dxHdx - dX H dX
      complSlack - complementary slackness measure, i.e. Sum |yi * gi|
      kkt - Lagrangian norm
      viol - constraints violations
      sigma - solution of the additional variable in QP subproblem
      penalty - penalty
      fx - objective function evaluation
      funDiff - difference f(x_old) - f(x_new) (or other convention)
      hUpdate - Hessian update code (implementation-defined)
      Returns:
      formatted row
    • logHeader

      public void logHeader()
      Log header.
    • logRow

      public void logRow(int funEvalCount, boolean crit2, boolean crit1, boolean crit5, boolean crit0, boolean crit3, boolean crit4)
      Log one row of convergence criteria flags (kept aligned with table layout).
      Parameters:
      funEvalCount - total functions evaluations;
      crit2 - norm criterion
      crit1 - gradient criterion?
      crit5 - criterion?
      crit0 - Lagrangian norm criterion
      crit3 - constraints violations criterion
      crit4 - criterion?
    • logRow

      public void logRow(int iter, double alpha, int lsCount, double dxNorm, double dxHdx, double complSlack, double kkt, double viol, double sigma, double penalty, double fx, double funDiff, int hUpdate)
      Log one row.
      Parameters:
      iter - iteration number
      alpha - step length
      lsCount - line search iteration
      dxNorm - || dX ||
      dxHdx - dX H dX
      complSlack - complementary slackness measure, i.e. Sum |yi * gi|
      kkt - Lagrangian norm
      viol - constraints violations
      sigma - solution of the additional variable in QP subproblem
      penalty - penalty
      fx - objective function evaluation
      funDiff - difference f(x_old) - f(x_new) (or other convention)
      hUpdate - Hessian update code (implementation-defined)
    • defaultLogger

      public static SQPLogger defaultLogger()
      Get default logger.
      Returns:
      default logger