Interface IterationCallback

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface IterationCallback
Caller-supplied hook invoked once per outer iteration of the trust-constr orchestrator. Mirrors scipy's callback(xk, OptimizeResult-state) argument to minimize(method='trust-constr', callback=...): the caller observes intermediate state and returns true to request early termination, otherwise false to continue.

The callback is fired after the inner stop-criterion has updated State.x, State.fun, State.grad, State.optimality, State.constrViolation, State.trustRadius, and State.nIter for the just-completed iteration. Returning true terminates the SQP / IP loop the same way exhausting maxIter does -- the orchestrator still populates OptimizeResult from whatever state the loop reached.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
  • Method Details

    • shouldTerminate

      boolean shouldTerminate(State state)
      Parameters:
      state - outer-iteration state at the just-completed iteration
      Returns:
      true to request early termination, false to continue