From 561b0b5b4033cb3e28e85d432c30d5ee404f4bc6 Mon Sep 17 00:00:00 2001 From: Mateusz Baran Date: Wed, 11 Oct 2023 12:50:14 +0200 Subject: [PATCH] some updates --- ext/ManifoldsTestExt/tests_general.jl | 3 +- src/Manifolds.jl | 2 +- src/atlases.jl | 4 +- src/manifolds/Fiber.jl | 70 ----------------- src/manifolds/FiberBundle.jl | 109 ++++++++++++-------------- src/manifolds/VectorBundle.jl | 19 ++--- test/manifolds/euclidean.jl | 8 +- test/manifolds/sphere.jl | 2 +- test/manifolds/vector_bundle.jl | 13 +-- test/metric.jl | 12 +-- 10 files changed, 77 insertions(+), 165 deletions(-) diff --git a/ext/ManifoldsTestExt/tests_general.jl b/ext/ManifoldsTestExt/tests_general.jl index 23824aaf67..8ff647d8cd 100644 --- a/ext/ManifoldsTestExt/tests_general.jl +++ b/ext/ManifoldsTestExt/tests_general.jl @@ -810,7 +810,8 @@ function test_manifold( Test.@testset "tangent vector distributions" begin for tvd in tvector_distributions supp = Manifolds.support(tvd) - Test.@test supp isa Manifolds.FVectorSupport{<:TangentSpace{ℝ,typeof(M)}} + Test.@test supp isa + Manifolds.FVectorSupport{<:TangentSpace{number_system(M),typeof(M)}} for _ in 1:10 randtv = rand(tvd) atol = rand_tvector_atol_multiplier * find_eps(randtv) diff --git a/src/Manifolds.jl b/src/Manifolds.jl index 7fdaa69cc9..9516743e77 100644 --- a/src/Manifolds.jl +++ b/src/Manifolds.jl @@ -672,7 +672,7 @@ export AbstractDecoratorManifold export IsIsometricEmbeddedManifold, IsEmbeddedManifold, IsEmbeddedSubmanifold export IsDefaultMetric, IsDefaultConnection, IsMetricManifold, IsConnectionManifold export ValidationManifold, ValidationMPoint, ValidationTVector, ValidationCoTVector -export CotangentBundle, CotangentSpace, FVector +export FiberBundle, CotangentBundle, CotangentSpace, FVector export AbstractPowerManifold, AbstractPowerRepresentation, ArrayPowerRepresentation, diff --git a/src/atlases.jl b/src/atlases.jl index 5bb5f1ce4b..a9ebc7a0ae 100644 --- a/src/atlases.jl +++ b/src/atlases.jl @@ -380,7 +380,7 @@ struct InducedBasis{𝔽,VST<:VectorSpaceType,TA<:AbstractAtlas,TI} <: AbstractB end """ - induced_basis(::AbstractManifold, A::AbstractAtlas, i, VST::VectorSpaceType = TangentSpace) + induced_basis(::AbstractManifold, A::AbstractAtlas, i, VST::VectorSpaceType = TangentSpaceType()) Get the basis induced by chart with index `i` from an [`AbstractAtlas`](@ref) `A` of vector space of type `vs`. Returns an object of type [`InducedBasis`](@ref). @@ -417,7 +417,7 @@ function dual_basis( ::Any, B::InducedBasis{𝔽,CotangentSpaceType}, ) where {𝔽} - return induced_basis(M, B.A, B.i, TangentSpace) + return induced_basis(M, B.A, B.i, TangentSpaceType()) end function ManifoldsBase._get_coordinates(M::AbstractManifold, p, X, B::InducedBasis) diff --git a/src/manifolds/Fiber.jl b/src/manifolds/Fiber.jl index 069a3fac15..8b13789179 100644 --- a/src/manifolds/Fiber.jl +++ b/src/manifolds/Fiber.jl @@ -1,71 +1 @@ -""" - BundleFibers(fiber::FiberType, M::AbstractManifold) - -Type representing a family of fibers of a fiber bundle over `M` -with fiber of type `fiber`. In contrast with `FiberBundle`, operations -on `BundleFibers` expect point-like and fiber-like parts to be -passed separately instead of being bundled together. It can be thought of -as a representation of fibers from a fiber bundle but without -storing the point at which a fiber is attached (which is specified -separately in various functions). -""" -struct BundleFibers{TF<:FiberType,TM<:AbstractManifold} - fiber::TF - manifold::TM -end - -""" - allocate_result(B::BundleFibers, f, x...) - -Allocates an array for the result of function `f` that is -an element of the fiber space of type `B.fiber` on manifold `B.manifold` -and arguments `x...` for implementing the non-modifying operation -using the modifying operation. -""" -@inline function allocate_result(B::BundleFibers, f::TF, x...) where {TF} - if length(x) == 0 - # TODO: this may be incorrect when point and tangent vector representation are - # different for the manifold but there is no easy and generic way around that - return allocate_result(B.manifold, f) - else - T = allocate_result_type(B, f, x) - return allocate(x[1], T) - end -end - -""" - allocate_result_type(B::BundleFibers, f, args::NTuple{N,Any}) where N - -Return type of element of the array that will represent the result of -function `f` for representing an operation with result in the fiber `fiber` -for manifold `M` on given arguments (passed at a tuple). -""" -@inline function allocate_result_type( - ::BundleFibers, - f::TF, - args::NTuple{N,Any}, -) where {TF,N} - return typeof(mapreduce(eti -> one(number_eltype(eti)), +, args)) -end - -base_manifold(B::BundleFibers) = base_manifold(B.manifold) - -function fiber_dimension(B::BundleFibers) - return fiber_dimension(B.manifold, B.fiber) -end - -function Base.show(io::IO, fiber::BundleFibers) - return print(io, "BundleFibers($(fiber.fiber), $(fiber.manifold))") -end - -""" - zero_vector(B::BundleFibers, p) - -Compute the zero vector from the vector space of type `B.fiber` at point `p` -from manifold `B.manifold`. -""" -function zero_vector(B::BundleFibers, p) - X = allocate_result(B, zero_vector, p) - return zero_vector!(B, X, p) -end diff --git a/src/manifolds/FiberBundle.jl b/src/manifolds/FiberBundle.jl index 4f43a1ce92..c90507036c 100644 --- a/src/manifolds/FiberBundle.jl +++ b/src/manifolds/FiberBundle.jl @@ -67,17 +67,9 @@ struct FiberBundle{ } <: AbstractManifold{𝔽} type::TF manifold::TM - fiber::BundleFibers{TF,TM} vector_transport::TVT end -function FiberBundle( - fiber::TVS, - M::TM, - vtm::FiberBundleProductVectorTransport, -) where {TVS<:FiberType,TM<:AbstractManifold{𝔽}} where {𝔽} - return FiberBundle{𝔽,TVS,TM,typeof(vtm)}(fiber, M, BundleFibers(fiber, M), vtm) -end function FiberBundle(fiber::FiberType, M::AbstractManifold) vtmm = vector_bundle_transport(fiber, M) vtbm = FiberBundleProductVectorTransport(vtmm, vtmm) @@ -157,6 +149,16 @@ Return the manifold the [`FiberBundle`](@ref)s is build on. """ base_manifold(B::FiberBundle) = base_manifold(B.manifold) +@doc raw""" + bundle_transport_to(B::FiberBundle, p, X, q) + +Given a fiber bundle ``B=F \mathcal M``, points ``p, q\in\mathcal M``, an element ``X`` of +the fiber over ``p``, transport ``X`` to fiber over ``q``. + +Exact meaning of the operation depends on the fiber bundle, or may even be undefined. +""" +bundle_transport_to(B::FiberBundle, p, X, q) + """ bundle_projection(B::FiberBundle, p) @@ -167,32 +169,21 @@ 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)) + xp1, xp2 = submanifold_components(M, p) base_basis = get_basis(M.manifold, xp1, B) - fiber_basis = get_basis(M.fiber, xp1, B) + F = Fiber(M.manifold, xp1, M.type) + fiber_basis = get_basis(F, xp2, B) return CachedBasis(B, FiberBundleBasisData(base_basis, fiber_basis)) end function get_basis(M::FiberBundle, p, B::CachedBasis) return invoke(get_basis, Tuple{AbstractManifold,Any,CachedBasis}, M, p, B) end -function get_basis(M::FiberBundle, p, B::DiagonalizingOrthonormalBasis) - xp1 = submanifold_component(p, Val(1)) - bv1 = DiagonalizingOrthonormalBasis(submanifold_component(B.frame_direction, Val(1))) - b1 = get_basis(M.manifold, xp1, bv1) - bv2 = DiagonalizingOrthonormalBasis(submanifold_component(B.frame_direction, Val(2))) - b2 = get_basis(M.fiber, xp1, bv2) - return CachedBasis(B, FiberBundleBasisData(b1, b2)) -end - function get_coordinates(M::FiberBundle, p, X, B::AbstractBasis) px, Vx = submanifold_components(M.manifold, p) VXM, VXF = submanifold_components(M.manifold, X) - n = manifold_dimension(M.manifold) - return vcat( - get_coordinates(M.manifold, px, VXM, B), - get_coordinates(M.fiber, px, VXF, B), - ) + F = Fiber(M.manifold, xp1, M.type) + return vcat(get_coordinates(M.manifold, px, VXM, B), get_coordinates(F, Vx, VXF, B)) end function get_coordinates!(M::FiberBundle, Y, p, X, B::AbstractBasis) @@ -200,7 +191,8 @@ function get_coordinates!(M::FiberBundle, Y, p, X, B::AbstractBasis) VXM, VXF = submanifold_components(M.manifold, X) n = manifold_dimension(M.manifold) get_coordinates!(M.manifold, view(Y, 1:n), px, VXM, B) - get_coordinates!(M.fiber, view(Y, (n + 1):length(Y)), px, VXF, B) + F = Fiber(M.manifold, px, M.type) + get_coordinates!(F, view(Y, (n + 1):length(Y)), Vx, VXF, B) return Y end @@ -212,9 +204,10 @@ function get_coordinates( ) where {𝔽} px, Vx = submanifold_components(M.manifold, p) VXM, VXF = submanifold_components(M.manifold, X) + F = Fiber(M.manifold, xp1, M.type) return vcat( get_coordinates(M.manifold, px, VXM, B.data.base_basis), - get_coordinates(M.fiber, px, VXF, B.data.fiber_basis), + get_coordinates(F, Vx, VXF, B.data.fiber_basis), ) end @@ -228,16 +221,19 @@ function get_coordinates!( px, Vx = submanifold_components(M.manifold, p) VXM, VXF = submanifold_components(M.manifold, X) n = manifold_dimension(M.manifold) + F = Fiber(M.manifold, xp1, M.type) get_coordinates!(M.manifold, view(Y, 1:n), px, VXM, B.data.base_basis) - get_coordinates!(M.fiber, view(Y, (n + 1):length(Y)), px, VXF, B.data.fiber_basis) + get_coordinates!(F, view(Y, (n + 1):length(Y)), Vx, VXF, B.data.fiber_basis) return Y end function get_vector!(M::FiberBundle, Y, p, X, B::AbstractBasis) n = manifold_dimension(M.manifold) - xp1 = submanifold_component(p, Val(1)) - get_vector!(M.manifold, submanifold_component(Y, Val(1)), xp1, X[1:n], B) - get_vector!(M.fiber, submanifold_component(Y, Val(2)), xp1, X[(n + 1):end], B) + xp1, xp2 = submanifold_components(M, p) + Yp1, Yp2 = submanifold_components(M, Y) + F = Fiber(M.manifold, xp1, M.type) + get_vector!(M.manifold, Yp1, xp1, X[1:n], B) + get_vector!(F, Yp2, xp2, X[(n + 1):end], B) return Y end @@ -249,44 +245,30 @@ function get_vector!( B::CachedBasis{𝔽,<:AbstractBasis{𝔽},<:FiberBundleBasisData}, ) where {𝔽} n = manifold_dimension(M.manifold) - xp1 = submanifold_component(p, Val(1)) - get_vector!( - M.manifold, - submanifold_component(Y, Val(1)), - xp1, - X[1:n], - B.data.base_basis, - ) - get_vector!( - M.fiber, - submanifold_component(Y, Val(2)), - xp1, - X[(n + 1):end], - B.data.fiber_basis, - ) + xp1, xp2 = submanifold_components(M, p) + Yp1, Yp2 = submanifold_components(M, Y) + F = Fiber(M.manifold, M.type, xp1) + get_vector!(M.manifold, Yp1, xp1, X[1:n], B.data.base_basis) + get_vector!(F, Yp2, xp2, X[(n + 1):end], B.data.fiber_basis) return Y end -function get_vectors(M::BundleFibers, p, B::CachedBasis) - return get_vectors(M.manifold, p, B) -end - function _isapprox(B::FiberBundle, p, q; kwargs...) xp, Vp = submanifold_components(B.manifold, p) xq, Vq = submanifold_components(B.manifold, q) return isapprox(B.manifold, xp, xq; kwargs...) && - isapprox(FiberAtPoint(B.fiber, xp), Vp, Vq; kwargs...) + isapprox(Fiber(B.manifold, xp, B.type), Vp, Vq; kwargs...) end function _isapprox(B::FiberBundle, p, X, Y; kwargs...) px, Vx = submanifold_components(B.manifold, p) VXM, VXF = submanifold_components(B.manifold, X) VYM, VYF = submanifold_components(B.manifold, Y) return isapprox(B.manifold, VXM, VYM; kwargs...) && - isapprox(FiberAtPoint(B.fiber, px), VXF, VYF; kwargs...) + isapprox(Fiber(B.manifold, px, B.type), Vx, VXF, VYF; kwargs...) end function manifold_dimension(B::FiberBundle) - return manifold_dimension(B.manifold) + fiber_dimension(B.fiber) + return manifold_dimension(B.manifold) + fiber_dimension(B.manifold, B.type) end function Random.rand!(M::FiberBundle, pX; vector_at=nothing) @@ -296,11 +278,11 @@ function Random.rand!(rng::AbstractRNG, M::FiberBundle, pX; vector_at=nothing) pXM, pXF = submanifold_components(M.manifold, pX) if vector_at === nothing rand!(rng, M.manifold, pXM) - rand!(rng, FiberAtPoint(M.fiber, pXM), pXF) + rand!(rng, Fiber(M.manifold, pXM, M.type), pXF) else vector_atM, vector_atF = submanifold_components(M.manifold, vector_at) rand!(rng, M.manifold, pXM; vector_at=vector_atM) - rand!(rng, FiberAtPoint(M.fiber, pXM), pXF; vector_at=vector_atF) + rand!(rng, Fiber(M.manifold, pXM, M.type), pXF; vector_at=vector_atF) end return pX end @@ -339,10 +321,11 @@ end function get_vector(M::FiberBundle, p, X, B::AbstractBasis) n = manifold_dimension(M.manifold) - xp1 = submanifold_component(p, Val(1)) + xp1, xp2 = submanifold_components(M, p) + F = Fiber(M.manifold, xp1, M.type) return ArrayPartition( get_vector(M.manifold, xp1, X[1:n], B), - get_vector(M.fiber, xp1, X[(n + 1):end], B), + get_vector(F, xp2, X[(n + 1):end], B), ) end function get_vector( @@ -352,10 +335,11 @@ function get_vector( B::CachedBasis{𝔽,<:AbstractBasis{𝔽},<:FiberBundleBasisData}, ) where {𝔽} n = manifold_dimension(M.manifold) - xp1 = submanifold_component(p, Val(1)) + xp1, xp2 = submanifold_components(M, p) + F = Fiber(M.manifold, M.type, xp1) return ArrayPartition( get_vector(M.manifold, xp1, X[1:n], B.data.base_basis), - get_vector(M.fiber, xp1, X[(n + 1):end], B.data.fiber_basis), + get_vector(F, xp2, X[(n + 1):end], B.data.fiber_basis), ) end @@ -364,14 +348,15 @@ function get_vectors( p::ArrayPartition, B::CachedBasis{𝔽,<:AbstractBasis{𝔽},<:FiberBundleBasisData}, ) where {𝔽} - xp1 = submanifold_component(p, Val(1)) + xp1, xp2 = submanifold_components(M, p) zero_m = zero_vector(M.manifold, xp1) zero_f = zero_vector(M.fiber, xp1) vs = typeof(ArrayPartition(zero_m, zero_f))[] + F = Fiber(M.manifold, M.type, xp1) for bv in get_vectors(M.manifold, xp1, B.data.base_basis) push!(vs, ArrayPartition(bv, zero_f)) end - for bv in get_vectors(M.fiber, xp1, B.data.fiber_basis) + for bv in get_vectors(F, xp2, B.data.fiber_basis) push!(vs, ArrayPartition(zero_m, bv)) end return vs @@ -413,6 +398,10 @@ component, respectively. end end +function Base.show(io::IO, B::FiberBundle) + return print(io, "FiberBundle($(B.type), $(B.manifold), $(B.vector_transport))") +end + @inline function Base.view(x::ArrayPartition, M::FiberBundle, s::Symbol) (s === :point) && return x.x[1] (s === :vector || s === :fiber) && return x.x[2] diff --git a/src/manifolds/VectorBundle.jl b/src/manifolds/VectorBundle.jl index 66d524020f..3f15b25e15 100644 --- a/src/manifolds/VectorBundle.jl +++ b/src/manifolds/VectorBundle.jl @@ -64,6 +64,10 @@ function CotangentBundle(M::AbstractManifold, vtm::FiberBundleProductVectorTrans return VectorBundle(CotangentSpaceType(), M, vtm) end +function bundle_transport_to!(B::TangentBundle, Y, p, X, q) + return vector_transport_to!(B.manifold, Y, p, X, q, B.vector_transport.method_fiber) +end + function default_inverse_retraction_method(::TangentBundle) return FiberBundleInverseProductRetraction() end @@ -146,7 +150,7 @@ function inverse_retract_product!(B::VectorBundle, X, p, q) py, Vy = submanifold_components(B.manifold, q) VXM, VXF = submanifold_components(B.manifold, X) log!(B.manifold, VXM, px, py) - vector_transport_to!(B.fiber, VXF, py, Vy, px, B.vector_transport.method_fiber) + bundle_transport_to!(B, VXF, py, Vy, px) copyto!(VXF, VXF - Vx) return X end @@ -212,16 +216,6 @@ function project!(B::VectorBundle, Y, p, X) return Y end -""" - project(B::BundleFibers, p, X) - -Project vector `X` from the vector space of type `B.fiber` at point `p`. -""" -function project(B::BundleFibers, p, X) - Y = allocate_result(B, project, p, X) - return project!(B, Y, p, X) -end - function _retract(M::VectorBundle, p, X, t::Number, ::FiberBundleProductRetraction) return retract_product(M, p, X, t) end @@ -296,9 +290,6 @@ function retract_sasaki!(B::TangentBundle, q, p, X, t::Number, m::SasakiRetracti return q end -function Base.show(io::IO, vb::VectorBundle) - return print(io, "VectorBundle($(vb.type.fiber), $(vb.manifold))") -end Base.show(io::IO, vb::TangentBundle) = print(io, "TangentBundle($(vb.manifold))") function vector_transport_direction(M::VectorBundle, p, X, d) diff --git a/test/manifolds/euclidean.jl b/test/manifolds/euclidean.jl index 8e7742f94c..b263d31195 100644 --- a/test/manifolds/euclidean.jl +++ b/test/manifolds/euclidean.jl @@ -24,7 +24,7 @@ using FiniteDifferences @test is_flat(Ec) p = zeros(3) A = Manifolds.RetractionAtlas() - B = induced_basis(EM, A, p, TangentSpace) + B = induced_basis(EM, A, p, TangentSpaceType()) @test det_local_metric(EM, p, B) == one(eltype(p)) @test log_local_metric_density(EM, p, B) == zero(eltype(p)) @test project!(E, p, p) == p @@ -264,7 +264,7 @@ using FiniteDifferences p = zeros(2) A = Manifolds.get_default_atlas(M) i = Manifolds.get_chart_index(M, A, p) - B = Manifolds.induced_basis(M, A, i, TangentSpace) + B = Manifolds.induced_basis(M, A, i, TangentSpaceType()) C1 = christoffel_symbols_first(M, p, B) @test size(C1) == (2, 2, 2) @test norm(C1) ≈ 0.0 atol = 1e-13 @@ -294,7 +294,7 @@ using FiniteDifferences p = zeros(3) M = DefaultManifold() TpM = TangentSpace(M, p) - B = induced_basis(M, Manifolds.get_default_atlas(M), p, TangentSpace) + B = induced_basis(M, Manifolds.get_default_atlas(M), p, TangentSpaceType()) MM = MetricManifold(M, EuclideanMetric()) @test local_metric(MM, p, B) == Diagonal(ones(3)) @test inverse_local_metric(MM, p, B) == Diagonal(ones(3)) @@ -302,7 +302,7 @@ using FiniteDifferences DB1 = dual_basis(MM, p, B) @test DB1 isa InducedBasis @test DB1.vs isa ManifoldsBase.CotangentSpaceType - DB2 = induced_basis(M, Manifolds.get_default_atlas(M), p, CotangentSpace) + DB2 = induced_basis(M, Manifolds.get_default_atlas(M), p, CotangentSpaceType()) @test DB2 isa InducedBasis @test DB2.vs isa ManifoldsBase.CotangentSpaceType DDB = dual_basis(MM, p, DB2) diff --git a/test/manifolds/sphere.jl b/test/manifolds/sphere.jl index ffb9585744..4ef5e70340 100644 --- a/test/manifolds/sphere.jl +++ b/test/manifolds/sphere.jl @@ -203,7 +203,7 @@ using ManifoldsBase: TFVector p3 ./= norm(p3) X2 = log(M, p, p2) X3 = log(M, p, p3) - B = induced_basis(M, A, i, TangentSpace) + B = induced_basis(M, A, i, TangentSpaceType()) X2B = get_coordinates(M, p, X2, B) X3B = get_coordinates(M, p, X3, B) diff --git a/test/manifolds/vector_bundle.jl b/test/manifolds/vector_bundle.jl index 2857bf0072..3bb0d7f97b 100644 --- a/test/manifolds/vector_bundle.jl +++ b/test/manifolds/vector_bundle.jl @@ -46,8 +46,8 @@ struct TestVectorSpaceType <: VectorSpaceType end Manifolds.FiberBundleProductVectorTransport CTB = CotangentBundle(M) @test sprint(show, CTB) == "CotangentBundle(Sphere(2, ℝ))" - @test sprint(show, VectorBundle(TestVectorSpaceType(), M)) == - "VectorBundle(TestVectorSpaceType(), Sphere(2, ℝ))" + @test sprint(show, FiberBundle(TestVectorSpaceType(), M)) == + "FiberBundle(TestVectorSpaceType(), Sphere(2, ℝ), Manifolds.FiberBundleProductVectorTransport{ParallelTransport, ParallelTransport}(ParallelTransport(), ParallelTransport()))" @test Manifolds.fiber_dimension(M, ManifoldsBase.CotangentSpaceType()) == 2 @test base_manifold(TangentBundle(M)) == M @@ -171,19 +171,20 @@ struct TestVectorSpaceType <: VectorSpaceType end VectorBundle{ℝ,Manifolds.CotangentSpaceType,Sphere{2,ℝ}} @testset "tensor product" begin - TT = Manifolds.TensorProductType(TangentSpace, TangentSpace) - @test sprint(show, TT) == "TensorProductType(TangentSpace, TangentSpace)" + TT = Manifolds.TensorProductType(TangentSpaceType(), TangentSpaceType()) + @test sprint(show, TT) == + "TensorProductType(TangentSpaceType(), TangentSpaceType())" @test vector_space_dimension(VectorSpaceFiber(TT, Sphere(2), [1.0, 0.0, 0.0])) == 4 @test vector_space_dimension( VectorSpaceFiber(TT, Sphere(3), [1.0, 0.0, 0.0, 0.0]), ) == 9 @test base_manifold(VectorSpaceFiber(TT, Sphere(2), [1.0, 0.0, 0.0])) == M @test sprint(show, VectorSpaceFiber(TT, Sphere(2), [1.0, 0.0, 0.0])) == - "VectorSpaceFiber(TensorProductType(TangentSpace, TangentSpace), Sphere(2, ℝ))" + "VectorSpaceFiber(TensorProductType(TangentSpaceType(), TangentSpaceType()), Sphere(2, ℝ))" end @testset "Error messages" begin - vbf = VectorSpaceFiber(TestVectorSpaceType(), Euclidean(3), [1.0, 0.0, 0.0]) + vbf = Fiber(TestVectorSpaceType(), Euclidean(3), [1.0, 0.0, 0.0]) @test_throws MethodError inner(vbf, [1, 2, 3], [1, 2, 3], [1, 2, 3]) @test_throws MethodError project!(vbf, [1, 2, 3], [1, 2, 3], [1, 2, 3]) @test_throws MethodError zero_vector!(vbf, [1, 2, 3], [1, 2, 3]) diff --git a/test/metric.jl b/test/metric.jl index dba1badf06..778d4e79ee 100644 --- a/test/metric.jl +++ b/test/metric.jl @@ -295,7 +295,7 @@ Manifolds.inner(::MetricManifold{ℝ,<:AbstractManifold{ℝ},Issue539Metric}, p, p = [3, 4] i = get_chart_index(M, A, p) - B = induced_basis(M, A, i, TangentSpace) + B = induced_basis(M, A, i, TangentSpaceType()) @test_throws MethodError local_metric(M, p, B) end @testset "scaled Euclidean metric" begin @@ -317,7 +317,7 @@ Manifolds.inner(::MetricManifold{ℝ,<:AbstractManifold{ℝ},Issue539Metric}, p, @test metric(M) === g i_zeros = get_chart_index(M, A, zeros(3)) - B_i_zeros = induced_basis(M, A, i_zeros, TangentSpace) + B_i_zeros = induced_basis(M, A, i_zeros, TangentSpaceType()) @test_throws MethodError local_metric_jacobian(E, zeros(3), B_i_zeros) @test_throws MethodError christoffel_symbols_second_jacobian(E, zeros(3), B_i_zeros) @@ -325,7 +325,7 @@ Manifolds.inner(::MetricManifold{ℝ,<:AbstractManifold{ℝ},Issue539Metric}, p, p, X, Y = vtype(randn(n)), vtype(randn(n)), vtype(randn(n)) chart_p = get_chart_index(M, A, p) - B_chart_p = induced_basis(M, A, chart_p, TangentSpace) + B_chart_p = induced_basis(M, A, chart_p, TangentSpaceType()) @test check_point(M, p) == check_point(E, p) @test check_vector(M, p, X) == check_vector(E, p, X) @@ -404,7 +404,7 @@ Manifolds.inner(::MetricManifold{ℝ,<:AbstractManifold{ℝ},Issue539Metric}, p, for vtype in (Vector, MVector{n}) p = vtype([θ, ϕ]) chart_p = get_chart_index(M, A, p) - B_p = induced_basis(M, A, chart_p, TangentSpace) + B_p = induced_basis(M, A, chart_p, TangentSpaceType()) G = Diagonal(vtype([1, sin(θ)^2])) .* r^2 invG = Diagonal(vtype([1, 1 / sin(θ)^2])) ./ r^2 X, Y = normalize(randn(n)), normalize(randn(n)) @@ -511,7 +511,7 @@ Manifolds.inner(::MetricManifold{ℝ,<:AbstractManifold{ℝ},Issue539Metric}, p, X = [0.5, 0.7, 0.11] chart_p = get_chart_index(M, A, p) - B_p = induced_basis(M, A, chart_p, TangentSpace) + B_p = induced_basis(M, A, chart_p, TangentSpaceType()) fX = ManifoldsBase.TFVector(X, B_p) fY = ManifoldsBase.TFVector(Y, B_p) @@ -550,7 +550,7 @@ Manifolds.inner(::MetricManifold{ℝ,<:AbstractManifold{ℝ},Issue539Metric}, p, A = Manifolds.get_default_atlas(MM2) chart_p = get_chart_index(MM2, A, p) - B_p = induced_basis(MM2, A, chart_p, TangentSpace) + B_p = induced_basis(MM2, A, chart_p, TangentSpaceType()) @test_throws MethodError local_metric(MM2, p, B_p) @test_throws MethodError local_metric_jacobian(MM2, p, B_p) @test_throws MethodError christoffel_symbols_second_jacobian(MM2, p, B_p)