Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve coverage
Browse files Browse the repository at this point in the history
mateuszbaran committed Oct 28, 2023
1 parent 5eadc7a commit 137a39d
Showing 5 changed files with 24 additions and 1 deletion.
11 changes: 11 additions & 0 deletions ext/ManifoldsTestExt/tests_group.jl
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ using Manifolds:
test_invariance = false,
test_lie_bracket=false,
test_adjoint_action=false,
test_inv_diff=false,
diff_convs = [(), (LeftForwardAction(),), (RightBackwardAction(),)],
)
@@ -41,6 +42,7 @@ function test_group(
test_invariance=false,
test_lie_bracket=false,
test_adjoint_action=false,
test_inv_diff=false,
diff_convs=[(), (LeftForwardAction(),), (RightBackwardAction(),)],
test_log_from_identity=false,
test_exp_from_identity=false,
@@ -300,6 +302,15 @@ function test_group(
end
end

test_inv_diff && Test.@testset "Differential of inverse" begin # COV_EXCL_LINE
Test.@test isapprox(inv_diff(G, e, Xe_pts[1]), -Xe_pts[1]; atol=atol)
Test.@test isapprox(
inv_diff(G, inv(G, g_pts[1]), inv_diff(G, g_pts[1], X_pts[1])),
X_pts[1];
atol=atol,
)
end

test_exp_lie_log && Test.@testset "group exp/log properties" begin
Test.@testset "e = exp(0)" begin
X = log_lie(G, Identity(G))
11 changes: 10 additions & 1 deletion src/groups/power_group.jl
Original file line number Diff line number Diff line change
@@ -133,14 +133,23 @@ function inv_diff!(G::PowerGroup, Y, p, X)
rep_size = representation_size(GM.manifold)
for i in get_iterator(GM)
inv_diff!(
GM,
GM.manifold,
_write(GM, rep_size, Y, i),
_read(GM, rep_size, p, i),
_read(GM, rep_size, X, i),
)
end
return Y
end
function inv_diff!(G::PowerGroupNestedReplacing, Y, p, X)
GM = G.manifold
N = GM.manifold
rep_size = representation_size(N)
for i in get_iterator(GM)
Y[i...] = inv_diff(N, _read(GM, rep_size, p, i), _read(GM, rep_size, X, i))
end
return Y
end

# lower level methods are added instead of top level ones to not have to deal
# with `Identity` disambiguation
1 change: 1 addition & 0 deletions test/groups/circle_group.jl
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@ using Manifolds:
test_invariance=true,
test_lie_bracket=true,
test_adjoint_action=true,
test_inv_diff=true,
)
end

1 change: 1 addition & 0 deletions test/groups/power_group.jl
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@ include("group_utils.jl")
test_exp_from_identity=true,
test_vee_hat_from_identity=true,
test_adjoint_action=true,
test_inv_diff=true,
)

X = log_lie(G, pts[1])
1 change: 1 addition & 0 deletions test/groups/product_group.jl
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@ using RecursiveArrayTools
test_exp_from_identity=true,
test_log_from_identity=true,
test_vee_hat_from_identity=true,
test_inv_diff=true,
)
@test isapprox(
G,

0 comments on commit 137a39d

Please sign in to comment.