JuliaManifolds / ManifoldsBase.jl

Basic interface for manifolds in Julia
https://juliamanifolds.github.io/ManifoldsBase.jl/
MIT License
87 stars 8 forks source link

Ambiguities with parametrised Manifolds and `@default_manifold_fallbacks` #109

Closed kellertuer closed 2 years ago

kellertuer commented 2 years ago

I am introducing a StiefelPoint, mainly to be used with Grassmann but of course also usable with Stiefel, if someone wants to.

For that I call

ManifoldsBase.@default_manifold_fallbacks Stiefel StiefelPoint StiefelTVector value value

which increases the ambiguities, especially with vector/coordinates, for example

(get_vector_orthonormal!(M::Stiefel{n, k, ℝ}, X, p, c, N::ManifoldsBase.RealNumbers) where {n, k} in Manifolds at /Users/ronnber/Repositories/Julia/Manifolds.jl/src/manifolds/StiefelEuclideanMetric.jl:84, get_vector_orthonormal!(M::Stiefel, Y::Manifolds.StiefelTVector, p::StiefelPoint, X, B::AbstractNumbers) in Manifolds at /Users/ronnber/Repositories/Julia/ManifoldsBase.jl/src/point_vector_fallbacks.jl:209)

1) Is this also due to the AbstractNumbers in the autogenerated code? How could we fix that? 2) I was thinking it is maybe due to Stiefel being parametrised once and hone it was not?

Anyways, we should check for a way to fix this

edit: It does not seem to be 1) since we do forward ::RealNumbers indeed, so we might need an optional Twhere maybe?

mateuszbaran commented 2 years ago

I think you should just have something like

ManifoldsBase.@default_manifold_fallbacks Stiefel{<:Any, <:Any, ℝ} StiefelPoint StiefelTVector value value

which would eliminate the need to have any where.

kellertuer commented 2 years ago

Thats also fine with me, I could not get the where working anyways.

kellertuer commented 2 years ago

Ah the tipp helped, then we really do not need `where's in the fallbacks, sure (because we never use the variables I wanted to add there) and this can be closed.