Skip to content

Commit

Permalink
fix compose on semidirect product group
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszbaran committed May 20, 2023
1 parent 5d705a2 commit e6702d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/groups/semidirect_product_group.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,15 @@ function _compose!(G::SemidirectProductGroup, x, p, q)
M = base_manifold(G)
N, H = M.manifolds
A = G.op.action
x_tmp = allocate(x)
np, hp = submanifold_components(G, p)
nq, hq = submanifold_components(G, q)
nx, hx = submanifold_components(G, x)
nx, hx = submanifold_components(G, x_tmp)
compose!(H, hx, hp, hq)
nxtmp = apply(A, hp, nq)
compose!(N, nx, np, nxtmp)
@inbounds _padpoint!(G, x)
copyto!(x, x_tmp)
return x
end

Expand Down
5 changes: 5 additions & 0 deletions test/groups/semidirect_product_group.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ include("group_utils.jl")
@test compose(G, pts[1], e) == pts[1]
@test compose(G, e, e) === e

# test in-place composition
o1 = copy(pts[1])
compose!(G, o1, o1, pts[2])
@test isapprox(G, o1, compose(G, pts[1], pts[2]))

eA = identity_element(G)
@test isapprox(G, eA, e)
@test isapprox(G, e, eA)
Expand Down

0 comments on commit e6702d6

Please sign in to comment.