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_decorator — Method
dispatch_state_decorator(s::AbstractManoptSolverState)Indicate internally whether an AbstractManoptSolverState s is of decorating type, that is, whether it stores (encapsulates) another 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.
Manopt.is_state_decorator — Method
is_state_decorator(s::AbstractManoptSolverState)Indicate whether an AbstractManoptSolverState s is of decorator type.