Class SQPLogger
java.lang.Object
org.hipparchus.optim.nonlinear.vector.constrained.SQPLogger
Utility class for formatting SQP iteration logs with dynamic precision and aligned columns.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SQPLoggerGet 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.header()Get header line.voidLog header.voidlogRow(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).voidlogRow(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.voidsetDebugPrinter(DebugPrinter debugPrinter) Set debug printer.voidsetEps(double epsilon) Updates the formatter precision and formats based on a new epsilon value.
-
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
Set debug printer.- Parameters:
debugPrinter- debug printer
-
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 numberalpha- step lengthlsCount- line search iterationdxNorm- || dX ||dxHdx- dX H dXcomplSlack- complementary slackness measure, i.e. Sum |yi * gi|kkt- Lagrangian normviol- constraints violationssigma- solution of the additional variable in QP subproblempenalty- penaltyfx- objective function evaluationfunDiff- 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 criterioncrit1- gradient criterion?crit5- criterion?crit0- Lagrangian norm criterioncrit3- constraints violations criterioncrit4- 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 numberalpha- step lengthlsCount- line search iterationdxNorm- || dX ||dxHdx- dX H dXcomplSlack- complementary slackness measure, i.e. Sum |yi * gi|kkt- Lagrangian normviol- constraints violationssigma- solution of the additional variable in QP subproblempenalty- penaltyfx- objective function evaluationfunDiff- difference f(x_old) - f(x_new) (or other convention)hUpdate- Hessian update code (implementation-defined)
-
defaultLogger
Get default logger.- Returns:
- default logger
-