Actions
An action is a callable structure, usually with the signature (problem, state, iterate), that performs something. Consider them elementary building blocks, for example a single debug output action, that can be combined into larger “things acting”. They share a common supertype in Manopt.jl.
Access functions
Manopt.AbstractStateAction — Type
AbstractStateActionA common Type for AbstractStateActions that might be triggered in decorators, for example within the DebugSolverState or within the RecordSolverState.
Manopt.StoreStateAction — Type
StoreStateAction <: AbstractStateActionInternal storage for AbstractStateActions to store a tuple of fields from an AbstractManoptSolverState.
This functor possesses the usual interface of functions called during an iteration and acts on (p, s, k), where p is an AbstractManoptProblem, s is an AbstractManoptSolverState and k is the current iteration.
Fields
values: a dictionary to store interim values based on certainSymbolskeys: aVectorofSymbols to refer to fields ofAbstractManoptSolverStatepoint_values: aNamedTupleof mutable values of points on a manifold to be stored inStoreStateAction. Manifold is later determined byAbstractManoptProblempassed toupdate_storage!.point_init: aNamedTupleof boolean values indicating whether a point inpoint_valueswith matching key has been already initialized to a value. When it is false, it corresponds to a general value not being stored for the key present in the vectorkeys.vector_values: aNamedTupleof mutable values of tangent vectors on a manifold to be stored inStoreStateAction. Manifold is later determined byAbstractManoptProblempassed toupdate_storage!. It is not specified at which point the vectors are tangent but for storage it should not matter.vector_init: aNamedTupleof boolean values indicating whether a tangent vector invector_valueswith matching key has been already initialized to a value. When it is false, it corresponds to a general value not being stored for the key present in the vectorkeys.once: whether to update the internal values only once per iterationlast_stored: the last iteration in which thisAbstractStateActionwas called (to determineonce)
To handle the general storage, use get_storage and has_storage with keys as Symbols. For the point storage use PointStorageKey. For tangent vector storage use VectorStorageKey. Point and tangent storage have been optimized to be more efficient.
Constructors
StoreStateAction(s::Vector{Symbol})This is equivalent to providing s to the keyword store_fields, except that here no manifold is necessary for the construction.
StoreStateAction(M::AbstractManifold; kwargs...)Keyword arguments
store_fields=Symbol[],store_points=Tuple{},store_vectors=Tuple{}: vectors of symbols (or tuple types) each referring to fields of the state (lower case symbols) or semantic ones (upper case).p_init=maybe_wrap_variable(rand(M)),X_init=zero_vector(M, p_init): used to initialize the point and vector storage; change these if you use other types (than the default) for your points/vectors onM. The wrapping makes sure thatp_initis not a number but a (mutable) array.once=true: whether to update internal storage only once per iteration or on every update call.
Manopt.get_storage — Method
get_storage(a::AbstractStateAction, key::Symbol)Return the internal value of the AbstractStateAction a at the Symbol key. Return nothing if the key does not exist.
Manopt.get_storage — Method
get_storage(a::AbstractStateAction, ::PointStorageKey{key}) where {key}Return the internal value of the AbstractStateAction a at the Symbol key that represents a point.
Manopt.get_storage — Method
get_storage(a::AbstractStateAction, ::VectorStorageKey{key}) where {key}Return the internal value of the AbstractStateAction a at the Symbol key that represents a vector.
Manopt.has_storage — Method
has_storage(a::AbstractStateAction, key::Symbol)Return whether the AbstractStateAction a has a value stored at the Symbol key.
Manopt.has_storage — Method
has_storage(a::AbstractStateAction, ::PointStorageKey{key}) where {key}Return whether the AbstractStateAction a has a point value stored at the Symbol key.
Manopt.has_storage — Method
has_storage(a::AbstractStateAction, ::VectorStorageKey{key}) where {key}Return whether the AbstractStateAction a has a tangent vector value stored at the Symbol key.
Manopt.update_storage! — Method
update_storage!(a::AbstractStateAction, amp::AbstractManoptProblem, s::AbstractManoptSolverState)Update the AbstractStateAction a internal values to the ones given on the AbstractManoptSolverState s. Optimized using the information from amp.
Manopt.update_storage! — Method
update_storage!(a::AbstractStateAction, d::Dict{Symbol,<:Any})Update the AbstractStateAction a internal values to the ones given in the dictionary d. The values are merged, where the values from d are preferred.
Internal functions
Manopt.PointStorageKey — Type
struct PointStorageKey{key} endRefer to point storage of StoreStateAction in get_storage and has_storage functions.
Manopt.VectorStorageKey — Type
struct VectorStorageKey{key} endRefer to tangent storage of StoreStateAction in get_storage and has_storage functions.
Manopt._storage_copy_point — Method
_storage_copy_point(M::AbstractManifold, p)Make a copy of point p from manifold M for storage in StoreStateAction.
Manopt._storage_copy_vector — Method
_storage_copy_vector(M::AbstractManifold, X)Make a copy of tangent vector X from manifold M for storage in StoreStateAction.