Skip to content

Commit

Permalink
Test a few more defaults on the interface,
Browse files Browse the repository at this point in the history
  • Loading branch information
kellertuer committed Oct 14, 2024
1 parent 29efc35 commit 8d79880
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ Return the manifold stored within the [`LieGroup`](@ref) `G`.
"""
Manifolds.base_manifold(G::LieGroup) = G.manifold

function ManifoldsBase.check_point(
G::LieGroup{𝔽,O}, g; kwargs...
) where {𝔽,O<:AbstractGroupOperation}
return ManifoldsBase.check_point(G.manifold, g; kwargs...)
end
function ManifoldsBase.check_point(
G::LieGroup{𝔽,O}, e::Identity{O}; kwargs...
) where {𝔽,O<:AbstractGroupOperation}
Expand Down Expand Up @@ -532,8 +537,7 @@ This falls back to checking whether `g` is a valid point on `G.manifold`,
unless `g` is an [`Identity`](@ref). Then, it is checked whether it is the
idenity element corresponding to `G`.
"""
ManifoldsBase.is_point(G::LieGroup, g; kwargs...) =
ManifoldsBase.is_point(G.manifold, g; kwargs...)
ManifoldsBase.is_point(G::LieGroup, g; kwargs...)

_doc_is_vector = """
is_vector(G::LieGroup, X; kwargs...)
Expand Down
10 changes: 10 additions & 0 deletions test/test_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,14 @@ begin
@test repr(𝔤) == rs2
@test is_identity(G, Identity(op))
@test !is_identity(G, Identity(op2))
e = Identity(op)
@test compose(G, e, e) == e
@test is_point(G, e)
@test !is_point(G, Identity(op2))
@test_throws DomainError is_point(G, Identity(op2); error=:error)
# Exp log Method Error fallbacks that avoid the stack overflow
g = :none
X = :nonetoo
@test_throws MethodError exp!(G, g, e, X)
@test_throws MethodError log!(G, X, e, g)
end

0 comments on commit 8d79880

Please sign in to comment.