Skip to content

Commit

Permalink
Merge branch 'kellertuer/adding-aqua' of github.com:JuliaManifolds/Ma…
Browse files Browse the repository at this point in the history
…nopt.jl into kellertuer/adding-aqua
  • Loading branch information
kellertuer committed Apr 13, 2024
2 parents 814e1e1 + 5df8899 commit 89ecf66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
15 changes: 5 additions & 10 deletions src/plans/solver_state.jl
Original file line number Diff line number Diff line change
Expand Up @@ -421,21 +421,16 @@ end
X_init=zero_vector(M, p_init),
once=true,
)
if store_points isa Vector{Symbol}
TPS_tuple = tuple(store_points...)
else
TPS_tuple = Tuple(store_points.parameters)
end
if store_vectors isa Vector{Symbol}
TTS_tuple = tuple(store_vectors...)
else
TTS_tuple = Tuple(store_vectors.parameters)
end
TPS_tuple = _store_to_tuple(store_points)
TTS_tuple = _store_to_tuple(store_vectors)
point_values = NamedTuple{TPS_tuple}(map(_ -> p_init, TPS_tuple))
vector_values = NamedTuple{TTS_tuple}(map(_ -> X_init, TTS_tuple))
return StoreStateAction(store_fields, point_values, vector_values, once; M=M)
end

_store_to_tuple(store::Type{<:Tuple}) = Tuple(store.parameters)
_store_to_tuple(store::Vector{Symbol}) = tuple(store...)

@generated function extract_type_from_namedtuple(::Type{nt}, ::Val{key}) where {nt,key}
for i in 1:length(nt.parameters[1])
if nt.parameters[1][i] === key
Expand Down
6 changes: 3 additions & 3 deletions src/solvers/particle_swarm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ Instead of a cost function `f` you can also provide an [`AbstractManifoldCostObj
* `social_weight`: (`1.4`) a social weight factor
* `stopping_criterion`: ([`StopAfterIteration`](@ref)`(500) | `[`StopWhenChangeLess`](@ref)`(1e-4)`)
a functor inheriting from [`StoppingCriterion`](@ref) indicating when to stop.
* `vector_transport_mthod`: (`default_vector_transport_method(M, eltype(swarm))`) a vector transport method to use.
* `vector_transport_method`: (`default_vector_transport_method(M, eltype(swarm))`) a vector transport method to use.
* `velocity`: a set of tangent vectors (of type `AbstractVector{T}`) representing the velocities of the particles, per default a random tangent vector per initial position
All other keyword arguments are passed to [`decorate_state!`](@ref) for decorators or
Expand Down Expand Up @@ -269,8 +269,8 @@ function particle_swarm(
end

@doc raw"""
patricle_swarm!(M, f, swarm; kwargs...)
patricle_swarm!(M, mco::AbstractManifoldCostObjective, swarm; kwargs..)
particle_swarm!(M, f, swarm; kwargs...)
particle_swarm!(M, mco::AbstractManifoldCostObjective, swarm; kwargs..)
perform the particle swarm optimization algorithm (PSO), starting with the initial `swarm` which is then modified in place.
Expand Down

0 comments on commit 89ecf66

Please sign in to comment.