From 6094c5ee3b4cd81ab373ea36c32b6d48fbaf1609 Mon Sep 17 00:00:00 2001 From: Mateusz Baran Date: Thu, 24 Oct 2024 10:40:54 +0200 Subject: [PATCH] Pointless norm on vector fibers (#209) * Pointless norm on vector fibers * Remove the variant with `p` * improve NEWS * Update NEWS.md Co-authored-by: Ronny Bergmann --------- Co-authored-by: Ronny Bergmann --- NEWS.md | 6 ++++++ Project.toml | 2 +- src/VectorFiber.jl | 4 +++- test/fibers.jl | 10 +++++++++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 28c36aa8..04ca4239 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.15.20] 24/10/2024 + +### Changed + +* `norm` function on `VectorSpaceFiber` (such as `TangentSpace`) now needs to be called without the point. The passed point was already ignored before. + ## [0.15.19] 20/10/2024 ### Changed diff --git a/Project.toml b/Project.toml index deaee651..12d86074 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ManifoldsBase" uuid = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb" authors = ["Seth Axen ", "Mateusz Baran ", "Ronny Bergmann ", "Antoine Levitt "] -version = "0.15.19" +version = "0.15.20" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/src/VectorFiber.jl b/src/VectorFiber.jl index 3016e38d..8ef454cf 100644 --- a/src/VectorFiber.jl +++ b/src/VectorFiber.jl @@ -8,4 +8,6 @@ Alias for a [`Fiber`](@ref) when the fiber is a vector space. const VectorSpaceFiber{𝔽,M,TSpaceType} = Fiber{𝔽,TSpaceType,M} where {𝔽,M<:AbstractManifold{𝔽},TSpaceType<:VectorSpaceType} -LinearAlgebra.norm(M::VectorSpaceFiber, p, X) = norm(M.manifold, M.point, X) +LinearAlgebra.norm(M::VectorSpaceFiber, X) = norm(M.manifold, M.point, X) +# disambiguation +LinearAlgebra.norm(M::VectorSpaceFiber, X::Real) = norm(M.manifold, M.point, X) diff --git a/test/fibers.jl b/test/fibers.jl index 046efc08..945ff0e0 100644 --- a/test/fibers.jl +++ b/test/fibers.jl @@ -47,7 +47,8 @@ using ManifoldsBaseTestUtils @test isapprox(t_p, log(t_p, X, Y), [0.0, 2.0, -2.0]) @test isapprox(t_p, X, log(t_p, X, Y), [0.0, 2.0, -2.0]) @test inner(t_p, X, X, X) ≈ 1.0 - @test norm(t_p, X, X) ≈ 1.0 + @test norm(t_p, X) ≈ 1.0 + @test norm(t_p, X) ≈ 1.0 @test parallel_transport_to(t_p, X, Y, X) ≈ Y @test vector_transport_to(t_p, X, Y, X) ≈ Y @test vector_transport_to(t_p, X, Y, X, ProjectionTransport()) ≈ Y @@ -78,6 +79,13 @@ using ManifoldsBaseTestUtils get_vector!(t_p, Z1, p, X1c, basis) @test isapprox(Z1, X) end + + @testset "scalar fiber" begin + Ms = DefaultManifold() + p = 1.0 + t_p = TangentSpace(Ms, p) + @test norm(t_p, 2.0) == 2.0 + end end @testset "Weingarten Map" begin