Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszbaran committed Nov 4, 2023
1 parent 4fcfd91 commit 7fff4cf
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/groups/rotation_translation_action.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ function apply_diff!(
p,
X,
)
return mul!(Y, a.x[2], X)
mul!(Y, a.x[2], X)
return Y

Check warning on line 190 in src/groups/rotation_translation_action.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/rotation_translation_action.jl#L189-L190

Added lines #L189 - L190 were not covered by tests
end
function apply_diff!(
::RotationTranslationActionOnVector{LeftAction},
Expand Down
4 changes: 4 additions & 0 deletions test/groups/group_operation_action.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ using Manifolds:
RightBackwardAction(),
)

Y = similar(X)
adjoint_apply_diff_group!(A_right_fwd, Y, a_pts[1], X, m)
@test Y inverse_translate_diff(G, m, a_pts[1], -X, RightBackwardAction())

@test apply_diff_group(A_right_fwd, a_pts[1], X, m) -m \ X * m
@test apply_diff_group(A_left_back, a_pts[1], X, m) -X
end
Expand Down
24 changes: 24 additions & 0 deletions test/groups/rotation_translation_action.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,30 @@ include("group_utils.jl")
apply_diff_group!(A_left, Y, Identity(G), a_X_pts[1], m_pts[1])
@test Y a_X_pts[1].x[2] * m_pts[1]
end

@testset "apply_diff" begin
@test apply_diff(A_left, Identity(G), m_pts[1], X_pts[1]) X_pts[1]
Y = similar(X_pts[1])
apply_diff!(A_left, Y, Identity(G), m_pts[1], X_pts[1])
@test Y X_pts[1]

@test apply_diff(A_left, a_pts[1], m_pts[1], X_pts[1])
a_pts[1].x[2] * X_pts[1]
Y = similar(X_pts[1])
apply_diff!(A_left, Y, a_pts[1], m_pts[1], X_pts[1])
@test Y a_pts[1].x[2] * X_pts[1]

@test apply_diff(A_right, Identity(G), m_pts[1], X_pts[1]) X_pts[1]
Y = similar(X_pts[1])
apply_diff!(A_right, Y, Identity(G), m_pts[1], X_pts[1])
@test Y X_pts[1]

@test apply_diff(A_right, a_pts[1], m_pts[1], X_pts[1])
a_pts[1].x[2] \ X_pts[1]
Y = similar(X_pts[1])
apply_diff!(A_right, Y, a_pts[1], m_pts[1], X_pts[1])
@test Y a_pts[1].x[2] \ X_pts[1]
end
end
end

Expand Down

0 comments on commit 7fff4cf

Please sign in to comment.