The State Decorator Pattern

Features can be added to a solver by decorating it. Decorators wrap a solver state to perform additional operations in the initialization step, before or after the iteration step or when the solver stops. The advantage of the decorator pattern here is, that those additional operations can be implemented generically and hence used with any existing or new solver.

Manopt.dispatch_state_decoratorMethod
dispatch_state_decorator(s::AbstractManoptSolverState)

Indicate internally, whether an AbstractManoptSolverState s is of decorating type, and stores (encapsulates) a state in itself, by default in the field s.state.

Decorators indicate this by returning Val{true} for further dispatch.

The default is Val{false}, so by default a state is not decorated.

source