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

Unify exp and retract, log and inverse_retract #167

Merged
merged 22 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
74b66f4
Initial rework to unify exp/retract and log/inverse_retract to “alloc…
kellertuer Sep 7, 2023
8e0937f
bump version, since this is breaking.
kellertuer Sep 7, 2023
c0cf220
remove further parts of the allocating dispatch tree.
kellertuer Sep 7, 2023
2139732
Update Project.toml
kellertuer Sep 8, 2023
b4c69a8
Fix a serious bug in type forward retract.
kellertuer Sep 8, 2023
8bb2f59
fix tests, by actually just being a lit more correct / not even more …
kellertuer Sep 8, 2023
d3e8fed
bump doc dependencies, remove unneeded code.
kellertuer Sep 8, 2023
90792d3
Back to the previous custom retraction.
kellertuer Sep 9, 2023
dbf2a68
Improve documentation.
kellertuer Sep 9, 2023
ef69bcc
remove an unnecessary definition.
kellertuer Sep 10, 2023
7f04555
Merge branch 'kellertuer/unify-exp-retract' of github.com:JuliaManifo…
kellertuer Sep 10, 2023
546c301
Remove a mid point method since it was no longer called?
kellertuer Sep 10, 2023
102f49f
drop support for Julia 1.0
kellertuer Sep 11, 2023
9ac2a34
Update news.md
kellertuer Sep 11, 2023
d603e91
Merge branch 'master' into kellertuer/unify-exp-retract
kellertuer Oct 16, 2023
0cab226
Update docs/src/types.md
kellertuer Oct 16, 2023
3387c62
Acidentally introduced the old retract-dispatch tree additionally to …
kellertuer Oct 16, 2023
4ef907b
Merge branch 'kellertuer/unify-exp-retract' of github.com:JuliaManifo…
kellertuer Oct 16, 2023
5381040
Remove unnecessary code.
kellertuer Oct 16, 2023
0ee777f
Fix docs.
kellertuer Oct 16, 2023
347ad69
Do not import `retract_`, since it no longer exists.
kellertuer Oct 16, 2023
b37bb31
Introduce back half-a-layer-2 for the allocatiing functions.
kellertuer Oct 16, 2023
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
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.14.11"
version = "0.15.0"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ ManifoldsBase = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb"
[compat]
CondaPkg = "0.2"
Documenter = "0.27"
ManifoldsBase = "0.14"
ManifoldsBase = "0.15"
60 changes: 2 additions & 58 deletions src/point_vector_fallbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ macro default_manifold_fallbacks(TM, TP, TV, pfield::Symbol, vfield::Symbol)
m::ExponentialRetraction,
)
retract!(M, q.$pfield, p.$pfield, X.$vfield, m)
return X
return q
end

function ManifoldsBase.vector_transport_along!(
Expand Down Expand Up @@ -249,16 +249,11 @@ macro default_manifold_fallbacks(TM, TP, TV, pfield::Symbol, vfield::Symbol)
)
end
end
# TODO forward retraction / inverse_retraction
for f_postfix in [:polar, :project, :qr, :softmax]
ra = Symbol("retract_$(f_postfix)")
rm = Symbol("retract_$(f_postfix)!")
push!(
block.args,
quote
function ManifoldsBase.$ra(M::$TM, p::$TP, X::$TV, t::Number)
return $TP(ManifoldsBase.$ra(M, p.$pfield, X.$vfield, t))
end
function ManifoldsBase.$rm(M::$TM, q, p::$TP, X::$TV, t::Number)
ManifoldsBase.$rm(M, q.$pfield, p.$pfield, X.$vfield, t)
return q
Expand All @@ -269,16 +264,6 @@ macro default_manifold_fallbacks(TM, TP, TV, pfield::Symbol, vfield::Symbol)
push!(
block.args,
quote
function ManifoldsBase.retract_exp_ode(
M::$TM,
p::$TP,
X::$TV,
t::Number,
m::AbstractRetractionMethod,
B::ManifoldsBase.AbstractBasis,
)
return $TP(ManifoldsBase.retract_exp_ode(M, p.$pfield, X.$vfield, t, m, B))
end
function ManifoldsBase.retract_exp_ode!(
M::$TM,
q::$TP,
Expand All @@ -291,15 +276,6 @@ macro default_manifold_fallbacks(TM, TP, TV, pfield::Symbol, vfield::Symbol)
ManifoldsBase.retract_exp_ode!(M, q.$pfield, p.$pfield, X.$vfield, t, m, B)
return q
end
function ManifoldsBase.retract_pade(
M::$TM,
p::$TP,
X::$TV,
t::Number,
m::PadeRetraction,
)
return $TP(ManifoldsBase.retract_pade(M, p.$pfield, X.$vfield, t, m))
end
function ManifoldsBase.retract_pade!(
M::$TM,
q::$TP,
Expand All @@ -311,15 +287,6 @@ macro default_manifold_fallbacks(TM, TP, TV, pfield::Symbol, vfield::Symbol)
ManifoldsBase.retract_pade!(M, q.$pfield, p.$pfield, X.$vfield, t, m)
return q
end
function ManifoldsBase.retract_embedded(
M::$TM,
p::$TP,
X::$TV,
t::Number,
m::AbstractRetractionMethod,
)
return $TP(ManifoldsBase.retract_embedded(M, p.$pfield, X.$vfield, t, m))
end
function ManifoldsBase.retract_embedded!(
M::$TM,
q::$TP,
Expand All @@ -334,12 +301,8 @@ macro default_manifold_fallbacks(TM, TP, TV, pfield::Symbol, vfield::Symbol)
end,
)
for f_postfix in [:polar, :project, :qr, :softmax]
ra = Symbol("inverse_retract_$(f_postfix)")
rm = Symbol("inverse_retract_$(f_postfix)!")
push!(block.args, quote
function ManifoldsBase.$ra(M::$TM, p::$TP, q::$TP)
return $TV((ManifoldsBase.$ra)(M, p.$pfield, q.$pfield))
end
function ManifoldsBase.$rm(M::$TM, Y::$TV, p::$TP, q::$TP)
ManifoldsBase.$rm(M, Y.$vfield, p.$pfield, q.$pfield)
return Y
Expand All @@ -349,16 +312,6 @@ macro default_manifold_fallbacks(TM, TP, TV, pfield::Symbol, vfield::Symbol)
push!(
block.args,
quote
function ManifoldsBase.inverse_retract_embedded(
M::$TM,
p::$TP,
q::$TP,
m::AbstractInverseRetractionMethod,
)
return $TV(
ManifoldsBase.inverse_retract_embedded(M, p.$pfield, q.$pfield, m),
)
end
function ManifoldsBase.inverse_retract_embedded!(
M::$TM,
X::$TV,
Expand All @@ -375,16 +328,7 @@ macro default_manifold_fallbacks(TM, TP, TV, pfield::Symbol, vfield::Symbol)
)
return X
end
function ManifoldsBase.inverse_retract_nlsolve(
M::$TM,
p::$TP,
q::$TP,
m::NLSolveInverseRetraction,
)
return $TV(
ManifoldsBase.inverse_retract_nlsolve(M, p.$pfield, q.$pfield, m),
)
end

function ManifoldsBase.inverse_retract_nlsolve!(
M::$TM,
X::$TV,
Expand Down
Loading