Skip to content

Commit

Permalink
allocate_result IsExplicitDecorator (#123)
Browse files Browse the repository at this point in the history
* allocate_result IsExplicitDecorator

* add test and bump version
  • Loading branch information
mateuszbaran authored Aug 5, 2022
1 parent dad56f8 commit a2cb5df
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ManifoldsBase"
uuid = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb"
authors = ["Seth Axen <[email protected]>", "Mateusz Baran <[email protected]>", "Ronny Bergmann <[email protected]>", "Antoine Levitt <[email protected]>"]
version = "0.13.17"
version = "0.13.18"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
8 changes: 8 additions & 0 deletions src/decorator_trait.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ function allocate_result(
T = allocate_result_type(get_embedding(M, x[1]), f, x)
return allocate(M, x[1], T, representation_size(M))
end
@inline function allocate_result(
::TraitList{IsExplicitDecorator},
M::AbstractDecoratorManifold,
f,
x...,
)
return allocate_result(decorated_manifold(M), f, x...)
end


# Introduce Deco Trait | automatic foward | fallback
Expand Down
1 change: 1 addition & 0 deletions test/embedded_manifold.jl
Original file line number Diff line number Diff line change
Expand Up @@ -418,5 +418,6 @@ ManifoldsBase.decorated_manifold(::FallbackManifold) = DefaultManifold(3)
# test the explicit fallback to DefaultManifold(3)
@test inner(M, [1, 0, 0], [1, 2, 3], [0, 1, 0]) == 2
@test is_point(M, [1, 0, 0])
@test ManifoldsBase.allocate_result(M, exp, [1.0, 0.0, 2.0]) isa Vector
end
end

2 comments on commit a2cb5df

@kellertuer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/65712

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.13.18 -m "<description of version>" a2cb5dfb03ccfe2fa3e4b542afd5f0932c565d78
git push origin v0.13.18

Please sign in to comment.