diff --git a/NEWS.md b/NEWS.md index 47f6041d..20db923d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -22,6 +22,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Julia 1.0 is no longer supported. From now on, the earliest supported Julia version is 1.6. +## [0.14.12] 23/09/2023 + +### Changed + +- Introduce a thorough way to allocate tangent vectors for `rand` + ## [0.14.11] 25/08/2023 ### Added diff --git a/docs/src/metamanifolds.md b/docs/src/metamanifolds.md index 41fdcc98..ad80e834 100644 --- a/docs/src/metamanifolds.md +++ b/docs/src/metamanifolds.md @@ -20,26 +20,7 @@ Pages = ["src/ProductManifold.jl"] Order = [:macro, :type, :function] ``` - -## VectorBundle and Vector Fibre - -```@autodocs -Modules = [ManifoldsBase] -Pages = ["VectorBundle.jl"] -Order = [:macro, :type, :function] -Public=true -Private=false -``` - -```@autodocs -Modules = [ManifoldsBase] -Pages = ["VectorFiber.jl"] -Order = [:macro, :type, :function] -Public=true -Private=false -``` - -## Fiber and FiberBundle +## Fiber ```@autodocs Modules = [ManifoldsBase] @@ -47,8 +28,10 @@ Pages = ["Fiber.jl"] Order = [:macro, :type, :function] ``` +## Tangent Space + ```@autodocs Modules = [ManifoldsBase] -Pages = ["FiberBundle.jl"] +Pages = ["TangentSpace.jl"] Order = [:macro, :type, :function] ``` diff --git a/src/Fiber.jl b/src/Fiber.jl index e2856dae..05b3e41e 100644 --- a/src/Fiber.jl +++ b/src/Fiber.jl @@ -2,7 +2,7 @@ """ abstract type FiberType end -An abstract type for fiber types. +An abstract type for fiber types that can be used within [`Fiber`](@ref). """ abstract type FiberType end @@ -13,23 +13,27 @@ abstract type FiberType end TX, } <: AbstractManifold{𝔽} -A fiber of a [`FiberBundle`](@ref) at a point `p` on the manifold. -This is modelled using [`BundleFibers`](@ref) with only a fiber part -and fixing the point-like part to be just `p`. +A fiber of a fiber bundle at a point `p` on the manifold. This fiber itself is also a `manifold`. For vector fibers it's by default flat and hence isometric to the [`Euclidean`](https://juliamanifolds.github.io/Manifolds.jl/latest/manifolds/euclidean.html) manifold. +# Fields + +* `manifold` – +* `point` + + # Constructor - Fiber(fiber_type::FiberType, manifold::AbstractManifold, p) + Fiber(M::AbstractManifold, p, fiber_type::FiberType) A fiber of type `fiber_type` at point `p` from the manifold `manifold`. """ struct Fiber{𝔽,TFiber<:FiberType,TM<:AbstractManifold{𝔽},TX} <: AbstractManifold{𝔽} manifold::TM - fiber_type::TFiber point::TX + fiber_type::TFiber end base_manifold(B::Fiber) = B.manifold diff --git a/src/TangentSpace.jl b/src/TangentSpace.jl index cad5f63e..e137e2fe 100644 --- a/src/TangentSpace.jl +++ b/src/TangentSpace.jl @@ -10,12 +10,12 @@ This is modelled as an alias for [`VectorSpaceFiber`](@ref) corresponding to TangentSpace(M::AbstractManifold, p) -Return the manifold (vector space) representing the tangent space ``T_p\mathcal M`` +Return the manifold (vector space) representing the tangent space ``T_p\mathcal M`` at point `p`, ``p\in\mathcal M``. """ const TangentSpace{𝔽,M} = Fiber{𝔽,TangentSpaceType,M} where {𝔽,M<:AbstractManifold{𝔽}} -TangentSpace(M::AbstractManifold, p) = Fiber(M, TangentSpaceType(), p) +TangentSpace(M::AbstractManifold, p) = Fiber(M, p, TangentSpaceType()) function allocate_result(M::TangentSpace, ::typeof(rand)) return zero_vector(M.manifold, M.point) diff --git a/src/VectorFiber.jl b/src/VectorFiber.jl index 8ca47973..3016e38d 100644 --- a/src/VectorFiber.jl +++ b/src/VectorFiber.jl @@ -1,8 +1,9 @@ """ - VectorSpaceFiber{𝔽,M,TFiber} + VectorSpaceFiber{𝔽,M,TSpaceType} = Fiber{𝔽,TSpaceType,M} + where {𝔽,M<:AbstractManifold{𝔽},TSpaceType<:VectorSpaceType} -Alias for [`Fiber`](@ref) when the fiber is a vector space. +Alias for a [`Fiber`](@ref) when the fiber is a vector space. """ const VectorSpaceFiber{𝔽,M,TSpaceType} = Fiber{𝔽,TSpaceType,M} where {𝔽,M<:AbstractManifold{𝔽},TSpaceType<:VectorSpaceType} diff --git a/src/bases.jl b/src/bases.jl index 28bede55..68e4a7ed 100644 --- a/src/bases.jl +++ b/src/bases.jl @@ -28,14 +28,14 @@ abstract type VectorSpaceType <: FiberType end """ struct TangentSpaceType <: VectorSpaceType end -A type that indicates that a [`VectorBundle`](@ref) is a [`TangentBundle`](@ref). +A type that indicates that a [`Fiber`](@ref) is a [`TangentSpace`](@ref). """ struct TangentSpaceType <: VectorSpaceType end """ struct CotangentSpaceType <: VectorSpaceType end -A type that indicates that a [`VectorBundle`](@ref) is a [`CotangentBundle`](@ref). +A type that indicates that a [`Fiber`](@ref) is a [`CotangentSpace`](@ref). """ struct CotangentSpaceType <: VectorSpaceType end diff --git a/test/fibers.jl b/test/fibers.jl index 41c79b3e..f7d8c6e3 100644 --- a/test/fibers.jl +++ b/test/fibers.jl @@ -64,7 +64,7 @@ include("test_sphere.jl") @test rand(Random.default_rng(), t_p) isa Vector{Float64} @test rand(Random.default_rng(), t_p; vector_at = X) isa Vector{Float64} # generic vector space at - X_p = Fiber(M, TestVectorSpaceType(), p) + X_p = Fiber(M, p, TestVectorSpaceType()) X_ps = sprint(show, "text/plain", X_p) X_ps_test = "VectorSpaceFiber{ℝ, DefaultManifold{ℝ, Tuple{Int64}}, TestVectorSpaceType, Vector{Float64}}\nFiber:\n TestVectorSpaceType()DefaultManifold(3; field = ℝ)\nBase point:\n $(sp)" @test X_ps == X_ps_test