Skip to content

Commit 7d28d4e

Browse files
authored
Fix #78 (#79)
* Fix #78 * bump version * getindex ambiguities are fine * added zenodo fix to news
1 parent 293a538 commit 7d28d4e

File tree

9 files changed

+68
-11
lines changed

9 files changed

+68
-11
lines changed

NEWS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable Changes to the Julia package `LieGroups.jl` will be documented in th
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.1.7] 2025-10-28
9+
10+
### Added
11+
12+
* `NestedPowerRepresentation` and `NestedReplacingPowerRepresentation` are now re-exported from `ManifoldsBase.jl`.
13+
* `getindex` access to parts of a point of tangent vector represented by a matrix with `:Rotation` and `:Translation` as indices. For example, when `g` is a point on any variant of the special euclidean group, `g[G, :Translation]` will return the translation part of `g` regardless of whether `G` is the left or right semidirect product even when `g` is a matrix.
14+
15+
### Fixed
16+
17+
* Zenodo metadata.
18+
819
## [0.1.6] 2025-10-10
920

1021
### Fixed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "LieGroups"
22
uuid = "6774de46-80ba-43f8-ba42-e41071ccfc5f"
33
authors = ["Seth Axen <[email protected]>", "Mateusz Baran <[email protected]>", "Ronny Bergmann <[email protected]>", "Yueh-Hua Tu", "Olivier Verdier <[email protected]>"]
4-
version = "0.1.6"
4+
version = "0.1.7"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

ext/LieGroupsRecursiveArrayToolsExt/special_euclidean_group_RAT_ext.jl

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,35 @@ function ManifoldsBase.exp!(
168168
return g
169169
end
170170

171+
function Base.getindex(
172+
g::ArrayPartition,
173+
G::SpecialEuclideanGroup,
174+
s::Union{Symbol, Int},
175+
)
176+
return submanifold_component(G, g, s)
177+
end
178+
function Base.getindex(
179+
g::ArrayPartition,
180+
G::SpecialEuclideanGroup,
181+
::Colon,
182+
)
183+
return submanifold_components(G, g)
184+
end
185+
function Base.getindex(
186+
g::ArrayPartition,
187+
𝔤::LieAlgebra{ℝ, <:LieGroups.SpecialEuclideanGroupOperation, <:SpecialEuclideanGroup},
188+
s::Union{Symbol, Int},
189+
)
190+
return submanifold_component(𝔤, g, s)
191+
end
192+
function Base.getindex(
193+
g::ArrayPartition,
194+
𝔤::LieAlgebra{ℝ, <:LieGroups.SpecialEuclideanGroupOperation, <:SpecialEuclideanGroup},
195+
::Colon,
196+
)
197+
return submanifold_components(𝔤, g)
198+
end
199+
171200
function LieGroups.identity_element(
172201
G::SpecialEuclideanGroup, ::Type{<:SpecialEuclideanProductPoint{A}}
173202
) where {A <: ArrayPartition}

src/LieGroups.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ include("groups/special_galilean_group.jl")
9393
export AbstractLieGroup
9494
export LieGroup, LieAlgebra
9595
export PowerLieGroup, ProductLieGroup
96+
export NestedPowerRepresentation, NestedReplacingPowerRepresentation
9697
export LeftSemidirectProductLieGroup, RightSemidirectProductLieGroup
9798
export ValidationLieGroup
9899
export DefaultLieAlgebraOrthogonalBasis

src/groups/power_group.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ function ManifoldsBase.exp!(
216216
return h
217217
end
218218

219+
Base.@propagate_inbounds function Base.getindex(
220+
p::AbstractArray, PoG::LieGroup{𝔽, Op, M}, I::Union{Integer, Colon, AbstractVector}...,
221+
) where {𝔽, Op <: PowerGroupOperation, M <: ManifoldsBase.AbstractPowerManifold}
222+
return get_component(base_manifold(PoG), p, I...)
223+
end
224+
219225
function ManifoldsBase.hat!(
220226
Po𝔤::LieAlgebra{𝔽, Op, LieGroup{𝔽, Op, M}}, X, c
221227
) where {𝔽, Op <: PowerGroupOperation, M <: ManifoldsBase.AbstractPowerManifold}

src/groups/special_euclidean_group.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,15 +460,15 @@ Use `:` to access all submanifold components as a unified tuple.
460460

461461
@doc "$(_doc_getindex_SE)"
462462
function Base.getindex(
463-
g::Union{SpecialEuclideanMatrixPoint, SpecialEuclideanProductPoint, Identity},
463+
g::Union{SpecialEuclideanMatrixPoint, SpecialEuclideanProductPoint, Identity, AbstractMatrix},
464464
G::SpecialEuclideanGroup,
465465
s::Union{Symbol, Int},
466466
)
467467
return submanifold_component(G, g, s)
468468
end
469469

470470
function Base.getindex(
471-
g::Union{SpecialEuclideanMatrixPoint, SpecialEuclideanProductPoint, Identity},
471+
g::Union{SpecialEuclideanMatrixPoint, SpecialEuclideanProductPoint, Identity, AbstractMatrix},
472472
G::SpecialEuclideanGroup,
473473
::Colon,
474474
)
@@ -477,7 +477,7 @@ end
477477

478478
@doc "$(_doc_getindex_SE)"
479479
function Base.getindex(
480-
g::Union{SpecialEuclideanMatrixTangentVector, SpecialEuclideanProductTangentVector},
480+
g::Union{SpecialEuclideanMatrixTangentVector, SpecialEuclideanProductTangentVector, AbstractMatrix},
481481
𝔤::LieAlgebra{ℝ, <:SpecialEuclideanGroupOperation, <:SpecialEuclideanGroup},
482482
s::Union{Symbol, Int},
483483
)
@@ -486,7 +486,7 @@ end
486486

487487
@doc "$(_doc_getindex_SE)"
488488
function Base.getindex(
489-
g::Union{SpecialEuclideanMatrixTangentVector, SpecialEuclideanProductTangentVector},
489+
g::Union{SpecialEuclideanMatrixTangentVector, SpecialEuclideanProductTangentVector, AbstractMatrix},
490490
𝔤::LieAlgebra{ℝ, <:SpecialEuclideanGroupOperation, <:SpecialEuclideanGroup},
491491
::Colon,
492492
)

test/groups/test_power_group.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ using LieGroupsTestSuite
2020
pG2 = PowerLieGroup(TranslationGroup(2), NestedPowerRepresentation(), 2)
2121
g, h = [[1.0, 0.0], [0.0, 3.0]], [[0.0, 1.0], [2.0, 0.0]]
2222
X, Y = [[0.0, 0.1], [0.2, 0.0]], [[0.1, 0.2], [0.0, 0.3]]
23+
@testset "convencience access" begin
24+
@test g[pG2, 1] === g[1]
25+
end
26+
2327
properties2 = Dict(
2428
:Name => "The generic nested Power Manifold",
2529
:Points => [g, h],

test/groups/test_special_euclidean_group.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@ using StaticArrays
7272
SpecialEuclideanMatrixTangentVector
7373
@test ManifoldsBase.tangent_vector_type(G, SpecialEuclideanProductPoint) ==
7474
SpecialEuclideanProductTangentVector
75+
76+
# convenience access
77+
@test (pts[1])[G, :Translation] isa AbstractVector
78+
@test (pts[1])[G, :] isa Tuple
79+
@test (pts[1])[G, :Rotation] isa AbstractMatrix
80+
81+
𝔤 = LieAlgebra(G)
82+
83+
@test (vec[1])[𝔤, :Translation] isa AbstractVector
84+
@test (vec[1])[𝔤, :] isa Tuple
85+
@test (vec[1])[𝔤, :Rotation] isa AbstractMatrix
7586
end
7687
#
7788
# Right variant – exchange product cases

test/test_aqua.jl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ using Aqua, LieGroups, Test, LinearAlgebra
66
ambiguities = (
77
broken = false,
88
exclude = [
9-
Base.:+, #temporary ambiguities between Manifolds.Identity and LieGroups.Identity
10-
Base.:-, #temporary ambiguities between Manifolds.Identity and LieGroups.Identity
11-
Base.:*, #temporary ambiguities between Manifolds.Identity and LieGroups.Identity
12-
Base.:/, #temporary ambiguities between Manifolds.Identity and LieGroups.Identity
13-
Base.:\, #temporary ambiguities between Manifolds.Identity and LieGroups.Identity
14-
LinearAlgebra.mul!, #temporary ambiguities between Manifolds.Identity and LieGroups.Identity
9+
getindex, # ambiguities from convenience access methods; they were manually verified as safe
1510
],
1611
),
1712
)

0 commit comments

Comments
 (0)