Skip to content

Commit

Permalink
Tests: adjoint_action
Browse files Browse the repository at this point in the history
- at Identity
- remove some unused adjoint_action! implementations
  • Loading branch information
olivierverdier committed Jul 26, 2024
1 parent 189424b commit 402c49b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
4 changes: 4 additions & 0 deletions ext/ManifoldsTestExt/tests_group.jl
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,10 @@ function test_group(
adjoint_action(G, g_pts[2], adjoint_action(G, g_pts[2], X, RightAction())),
X,
)
# adjoint action at identity
for conv in [LeftAction(), RightAction()]
isapprox(TangentSpace(G, identity_element(G)), adjoint_action(G, e, Xe_pts[1]), Xe_pts[1])
end
if test_mutating
Z = allocate(X)
adjoint_action!(G, Z, g_pts[2], X)
Expand Down
1 change: 0 additions & 1 deletion src/groups/circle_group.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ end
adjoint_action(::RealCircleGroup, p, X) = X
adjoint_action(::RealCircleGroup, p, X, ::ActionDirection) = X

adjoint_action!(::RealCircleGroup, Y, p, X) = copyto!(Y, X)
adjoint_action!(::RealCircleGroup, Y, p, X, ::ActionDirection) = copyto!(Y, X)

for AD in [LeftAction, RightAction]
Expand Down
10 changes: 0 additions & 10 deletions src/groups/group.jl
Original file line number Diff line number Diff line change
Expand Up @@ -467,16 +467,6 @@ end
function adjoint_action!(G::AbstractDecoratorManifold, Y, p, X)
return adjoint_action!(G, Y, p, X, LeftAction())
end
function adjoint_action!(
::TraitList{<:IsGroupManifold},
G::AbstractDecoratorManifold,
Y,
p,
X,
)
BG = base_group(G)
return adjoint_action!(BG, Y, p, X, LeftAction())
end
# fall back method: the right action is defined from the left action
function adjoint_action!(
::TraitList{<:IsGroupManifold},
Expand Down

0 comments on commit 402c49b

Please sign in to comment.