Skip to content

Commit

Permalink
generalize a couple of methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszbaran committed Sep 25, 2023
1 parent 26cee70 commit c90e9a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
11 changes: 11 additions & 0 deletions src/manifolds/FiberBundle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,17 @@ See also [`FiberBundleInverseProductRetraction`](@ref).
"""
struct FiberBundleProductRetraction <: AbstractRetractionMethod end

base_manifold(B::FiberBundle) = base_manifold(B.manifold)

"""
bundle_projection(B::FiberBundle, p::ArrayPartition)
Projection of point `p` from the bundle `M` to the base manifold.
Returns the point on the base manifold `B.manifold` at which the vector part
of `p` is attached.
"""
bundle_projection(B::FiberBundle, p) = submanifold_component(B.manifold, p, Val(1))

function get_basis(M::FiberBundle, p, B::AbstractBasis)
xp1 = submanifold_component(p, Val(1))
base_basis = get_basis(M.manifold, xp1, B)
Expand Down
11 changes: 0 additions & 11 deletions src/manifolds/VectorBundle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,6 @@ function CotangentBundle(M::AbstractManifold, vtm::FiberBundleProductVectorTrans
return VectorBundle(CotangentSpace, M, vtm)
end

base_manifold(B::VectorBundle) = base_manifold(B.manifold)

"""
bundle_projection(B::VectorBundle, p::ArrayPartition)
Projection of point `p` from the bundle `M` to the base manifold.
Returns the point on the base manifold `B.manifold` at which the vector part
of `p` is attached.
"""
bundle_projection(B::VectorBundle, p) = submanifold_component(B.manifold, p, Val(1))

function default_inverse_retraction_method(::TangentBundle)
return FiberBundleInverseProductRetraction()
end
Expand Down

0 comments on commit c90e9a3

Please sign in to comment.