Class OptimizeResult

java.lang.Object
de.labathome.trustconstr.records.OptimizeResult

public class OptimizeResult extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    double
    Barrier parameter at the last iteration.
    double
    Tolerance for the barrier subproblem at the last iteration.
    int
    Total number of the conjugate gradient method iterations.
    Reason for CG subproblem termination at the last iteration: 0 : CG subproblem not evaluated. 1 : Iteration limit was reached. 2 : Reached the trust-region boundary. 3 : Negative curvature detected. 4 : Tolerance was satisfied.
    List of constraint values at the solution.
    double
    Penalty parameter at the last iteration, see `initial_constr_penalty`.
    double
    Maximum constraint violation at the solution.
    long
    Total execution time in nanoseconds.
    double
    Objective function at the solution.
    [n] Gradient of the objective function at the solution.
    List of the Jacobian matrices of the constraints at the solution.
    [n] Gradient of the Lagrangian function at the solution.
    Termination message.
    Optimization method used.
    int
    Total number of iterations.
    int[]
    Number of constraint evaluations for each of the constraints.
    int[]
    Number of Hessian evaluations for each of the constraints.
    int[]
    Number of Jacobian matrix evaluations for each of the constraints.
    int
    Number of the objective function evaluations.
    int
    Number of the objective function Hessian evaluations.
    int
    Number of the objective function gradient evaluations.
    double
    Infinity norm of the Lagrangian gradient at the solution.
    int
    {0, 1, 2, 3}: Termination status: 0 : The maximum number of function evaluations is exceeded. 1 : `gtol` termination condition is satisfied. 2 : `xtol` termination condition is satisfied. 3 : `callback` function requested termination.
    boolean
    Whether the optimizer reports success.
    double
    Radius of the trust region at the last iteration.
    List of the Lagrange multipliers for the constraints at the solution.
    [n] Solution found.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    One-line summary suitable for println(result): success flag, status, method, x, fun, optimality, constraint violation, iteration counters.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • x

      public Matrix x
      [n] Solution found.
    • optimality

      public double optimality
      Infinity norm of the Lagrangian gradient at the solution.
    • constraintViolation

      public double constraintViolation
      Maximum constraint violation at the solution.
    • fun

      public double fun
      Objective function at the solution.
    • grad

      public Matrix grad
      [n] Gradient of the objective function at the solution.
    • lagrangianGrad

      public Matrix lagrangianGrad
      [n] Gradient of the Lagrangian function at the solution.
    • nIter

      public int nIter
      Total number of iterations.
    • numFunctionEval

      public int numFunctionEval
      Number of the objective function evaluations.
    • numJacobianEval

      public int numJacobianEval
      Number of the objective function gradient evaluations.
    • numHessianEval

      public int numHessianEval
      Number of the objective function Hessian evaluations.
    • cgIter

      public int cgIter
      Total number of the conjugate gradient method iterations.
    • method

      public TrustConstrMethod method
      Optimization method used.
    • constr

      public Matrix[] constr
      List of constraint values at the solution.
    • jac

      public Matrix[] jac
      List of the Jacobian matrices of the constraints at the solution.
    • v

      public Matrix[] v
      List of the Lagrange multipliers for the constraints at the solution. For an inequality constraint a positive multiplier means that the upper bound is active, a negative multiplier means that the lower bound is active and if a multiplier is zero it means the constraint is not active.
    • numConstraintEval

      public int[] numConstraintEval
      Number of constraint evaluations for each of the constraints.
    • numConstraintJacobianEval

      public int[] numConstraintJacobianEval
      Number of Jacobian matrix evaluations for each of the constraints.
    • numConstraintHessianEval

      public int[] numConstraintHessianEval
      Number of Hessian evaluations for each of the constraints.
    • trustRadius

      public double trustRadius
      Radius of the trust region at the last iteration.
    • constraintPenalty

      public double constraintPenalty
      Penalty parameter at the last iteration, see `initial_constr_penalty`.
    • barrierTolerance

      public double barrierTolerance
      Tolerance for the barrier subproblem at the last iteration. Only for problems with inequality constraints.
    • barrierParameter

      public double barrierParameter
      Barrier parameter at the last iteration. Only for problems with inequality constraints.
    • executionTime

      public long executionTime
      Total execution time in nanoseconds.
    • message

      public String message
      Termination message.
    • status

      public int status
      {0, 1, 2, 3}: Termination status: 0 : The maximum number of function evaluations is exceeded. 1 : `gtol` termination condition is satisfied. 2 : `xtol` termination condition is satisfied. 3 : `callback` function requested termination.
    • success

      public boolean success
      Whether the optimizer reports success.

      Derived at result construction:

      • status == 1 (gtol satisfied): always true -- gtol-termination requires the constraint violation to also be below gtol.
      • status == 2 (xtol satisfied / trust-radius collapse): true only if the residual constraint violation is below gtol -- distinguishes "converged at an active boundary" from "stuck on an infeasible problem".
      • status == 0 (maxIter exceeded) or status == 3 (callback terminated): false.

      Mirrors scipy's OptimizeResult.success semantics, including the behaviour exercised by scipy test_issue_18882 where a degenerate constraint causes trust-radius collapse with a non-trivial constraint violation -- that outcome reports success=false.

    • cgStopCond

      public PCGStoppingCondition cgStopCond
      Reason for CG subproblem termination at the last iteration: 0 : CG subproblem not evaluated. 1 : Iteration limit was reached. 2 : Reached the trust-region boundary. 3 : Negative curvature detected. 4 : Tolerance was satisfied.
  • Constructor Details

    • OptimizeResult

      public OptimizeResult()
  • Method Details

    • toString

      public String toString()
      One-line summary suitable for println(result): success flag, status, method, x, fun, optimality, constraint violation, iteration counters. Mirrors what scipy's repr(OptimizeResult) shows for the most-asked-about fields.
      Overrides:
      toString in class Object