Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Deprecate GroupManifold functions in favour of LieGroups.jl #776

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions src/groups/group.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
_dep_warn_group = """
GroupManifold functionality will move to its own package `LieGroups.jl`.
"""

@doc raw"""
AbstractGroupOperation

Expand Down Expand Up @@ -245,6 +249,7 @@
::TraitList{<:IsGroupManifold{O}},
::AbstractDecoratorManifold,
) where {O<:AbstractGroupOperation}
Base.depwarn(_dep_warn_group * "\n`Identity` will move and keep its name.", :Idenity)

Check warning on line 252 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L252

Added line #L252 was not covered by tests
return Identity{O}()
end
Identity(::O) where {O<:AbstractGroupOperation} = Identity(O)
Expand All @@ -264,6 +269,10 @@
identity_element(G::AbstractDecoratorManifold)
@trait_function identity_element(G::AbstractDecoratorManifold)
function identity_element(::TraitList{<:IsGroupManifold}, G::AbstractDecoratorManifold)
Base.depwarn(

Check warning on line 272 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L272

Added line #L272 was not covered by tests
_dep_warn_group * "\n`identity_element` will move and keep its name.",
:identity_element,
)
BG = base_group(G)
q = allocate_result(BG, identity_element)
return identity_element!(BG, q)
Expand Down Expand Up @@ -319,6 +328,10 @@
q;
kwargs...,
)
Base.depwarn(

Check warning on line 331 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L331

Added line #L331 was not covered by tests
_dep_warn_group * "\n`is_identity` will move and keep its name.",
:is_identity,
)
BG = base_group(G)
return isapprox(BG, identity_element(BG), q; kwargs...)
end
Expand Down Expand Up @@ -573,6 +586,11 @@
Y;
n=20,
)
Base.depwarn(

Check warning on line 589 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L589

Added line #L589 was not covered by tests
_dep_warn_group *
"\n`differential_exp_argument_lie_approx` will be removed, cf `differential_exp_argument` instead.",
:differential_exp_argument_lie_approx,
)
tmp = copy(M, p, Y)
a = -1.0
zero_vector!(M, Z, p)
Expand All @@ -598,6 +616,7 @@
inv(::AbstractDecoratorManifold, ::Any...)
@trait_function Base.inv(G::AbstractDecoratorManifold, p)
function Base.inv(::TraitList{<:IsGroupManifold}, G::AbstractDecoratorManifold, p)
Base.depwarn(_dep_warn_group * "\n`inv` is moved and keeps its name.", :inv)

Check warning on line 619 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L619

Added line #L619 was not covered by tests
q = allocate_result(G, inv, p)
BG = base_group(G)
return inv!(BG, q, p)
Expand All @@ -608,6 +627,7 @@
::AbstractDecoratorManifold,
e::Identity{O},
) where {O<:AbstractGroupOperation}
Base.depwarn(_dep_warn_group * "\n`inv` is moved and keeps its name.", :inv)

Check warning on line 630 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L630

Added line #L630 was not covered by tests
return e
end

Expand Down Expand Up @@ -646,6 +666,7 @@

@trait_function inv_diff(G::AbstractDecoratorManifold, p, X)
function inv_diff(::TraitList{<:IsGroupManifold}, G::AbstractDecoratorManifold, p, X)
Base.depwarn(_dep_warn_group * "\n`inv_diff` is renamed to `diff_inv`.", :inv_diff)

Check warning on line 669 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L669

Added line #L669 was not covered by tests
return -adjoint_action(base_group(G), p, X)
end

Expand Down Expand Up @@ -687,27 +708,31 @@

@trait_function compose(G::AbstractDecoratorManifold, p, q)
function compose(::TraitList{<:IsGroupManifold}, G::AbstractDecoratorManifold, p, q)
Base.depwarn(_dep_warn_group * "\n`compose` is moved and keeps its name.", :compose)

Check warning on line 711 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L711

Added line #L711 was not covered by tests
return _compose(base_group(G), p, q)
end
function compose(
::AbstractDecoratorManifold,
::Identity{O},
p,
) where {O<:AbstractGroupOperation}
Base.depwarn(_dep_warn_group * "\n`compose` is moved and keeps its name.", :compose)

Check warning on line 719 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L719

Added line #L719 was not covered by tests
return p
end
function compose(
::AbstractDecoratorManifold,
p,
::Identity{O},
) where {O<:AbstractGroupOperation}
Base.depwarn(_dep_warn_group * "\n`compose` is moved and keeps its name.", :compose)

Check warning on line 727 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L727

Added line #L727 was not covered by tests
return p
end
function compose(
::AbstractDecoratorManifold,
e::Identity{O},
::Identity{O},
) where {O<:AbstractGroupOperation}
Base.depwarn(_dep_warn_group * "\n`compose` is moved and keeps its name.", :compose)

Check warning on line 735 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L735

Added line #L735 was not covered by tests
return e
end

Expand Down Expand Up @@ -780,6 +805,7 @@
::Identity{O},
X,
) where {O<:AbstractGroupOperation}
Base.depwarn(_dep_warn_group * "\n`hat` is moved and keeps its name.", :hat)

Check warning on line 808 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L808

Added line #L808 was not covered by tests
return get_vector_lie(M, X, VeeOrthogonalBasis())
end
function hat!(
Expand Down Expand Up @@ -822,6 +848,7 @@
::Identity{O},
X,
) where {O<:AbstractGroupOperation}
Base.depwarn(_dep_warn_group * "\n`vee` is moved and keeps its name.", :vee)

Check warning on line 851 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L851

Added line #L851 was not covered by tests
return get_coordinates_lie(M, X, VeeOrthogonalBasis())
end
function vee!(
Expand Down Expand Up @@ -884,6 +911,10 @@
q,
conv::ActionDirectionAndSide,
)
Base.depwarn(

Check warning on line 914 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L914

Added line #L914 was not covered by tests
_dep_warn_group * "\n`translate` is discontinued – use `compose` instead.",
:translate,
)
BG = base_group(G)
return compose(BG, _action_order(BG, p, q, conv)...)
end
Expand Down Expand Up @@ -935,6 +966,11 @@
q,
conv::ActionDirectionAndSide,
)
Base.depwarn(

Check warning on line 969 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L969

Added line #L969 was not covered by tests
_dep_warn_group *
"\n`inverse_translate` is discontinued – use `compose` with the `inv` instead.",
:inverse_translate,
)
BG = base_group(G)
return translate(BG, inv(BG, p), q, conv)
end
Expand Down Expand Up @@ -990,6 +1026,11 @@
X,
conv::ActionDirectionAndSide,
)
Base.depwarn(

Check warning on line 1029 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L1029

Added line #L1029 was not covered by tests
_dep_warn_group *
"\n`translate_diff` is discontinued – use `diff_right_compose` and `diff_left_compose`, respectively instead.",
:translate_diff,
)
Y = allocate_result(G, translate_diff, X, p, q)
BG = base_group(G)
translate_diff!(BG, Y, p, q, X, conv)
Expand Down Expand Up @@ -1080,6 +1121,11 @@
X,
conv::ActionDirectionAndSide,
)
Base.depwarn(

Check warning on line 1124 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L1124

Added line #L1124 was not covered by tests
_dep_warn_group *
"\n`inverse_translate_diff` is discontinued – use `diff_right_compose` and `diff_left_compose`, respectively, together with `inv` instead.",
:inverse_translate_diff,
)
BG = base_group(G)
return translate_diff(BG, inv(BG, p), q, X, conv)
end
Expand Down Expand Up @@ -1113,6 +1159,11 @@
other groups it may differ.
"""
function log_inv(G::AbstractManifold, p, q)
Base.depwarn(

Check warning on line 1162 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L1162

Added line #L1162 was not covered by tests
_dep_warn_group *
"\n`log_inv` is discontinued – use `log` on the Lie group instead.",
:log_inv,
)
BG = base_group(G)
return log_lie(BG, compose(BG, inv(BG, p), q))
end
Expand All @@ -1133,6 +1184,11 @@
other groups it may differ.
"""
function exp_inv(G::AbstractManifold, p, X, t::Number=1)
Base.depwarn(

Check warning on line 1187 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L1187

Added line #L1187 was not covered by tests
_dep_warn_group *
"\n`exp_inv` is discontinued – use `exp` on the Lie group instead.",
:log_inv,
)
BG = base_group(G)
return compose(BG, p, exp_lie(BG, t * X))
end
Expand Down Expand Up @@ -1186,6 +1242,11 @@
exp_lie(G::AbstractManifold, X)
@trait_function exp_lie(M::AbstractDecoratorManifold, X)
function exp_lie(::TraitList{<:IsGroupManifold}, G::AbstractDecoratorManifold, X)
Base.depwarn(

Check warning on line 1245 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L1245

Added line #L1245 was not covered by tests
_dep_warn_group *
"\n`exp_lie`` is discontinued – use `exp(G, p, X)` on the Lie group at `p` the `Identity` instead.",
:exp_lie,
)
BG = base_group(G)
q = allocate_result(BG, exp_lie, X)
return exp_lie!(BG, q, X)
Expand Down Expand Up @@ -1225,6 +1286,11 @@
log_lie(::AbstractDecoratorManifold, q)
@trait_function log_lie(G::AbstractDecoratorManifold, q)
function log_lie(::TraitList{<:IsGroupManifold}, G::AbstractDecoratorManifold, q)
Base.depwarn(

Check warning on line 1289 in src/groups/group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/group.jl#L1289

Added line #L1289 was not covered by tests
_dep_warn_group *
"\n`log_lie`` is discontinued – use `log(G, p, q)` on the Lie group at `p` the `Identity` instead.",
:exp_lie,
)
BG = base_group(G)
return _log_lie(BG, q)
end
Expand Down
5 changes: 5 additions & 0 deletions src/groups/power_group.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
PowerGroup(manifold::AbstractPowerManifold)
"""
function PowerGroup(manifold::AbstractPowerManifold)
Base.depwarn(

Check warning on line 36 in src/groups/power_group.jl

View check run for this annotation

Codecov / codecov/patch

src/groups/power_group.jl#L36

Added line #L36 was not covered by tests
_dep_warn_group *
"\n `PowerGroup` will be named to `PowerLiegroup` and its argument will be a Lie group instead of a manifold.",
:PowerGroup,
)
if !is_group_manifold(manifold.manifold)
error("All powered manifold must be or decorate a group.")
end
Expand Down
2 changes: 2 additions & 0 deletions src/manifolds/Rotations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ function Rotations(n::Int; parameter::Symbol=:type)
return Rotations{typeof(size)}(size)
end

# TODO: Remove when removing GroupManifolds, since it is now
# defined 8and also used then in) LIeGroups.jl
@doc raw"""
angles_4d_skew_sym_matrix(A)

Expand Down
Loading