ManifoldsBase.jl
ManifoldsBase.jl copied to clipboard
[WIP] Rework of allocations
This is my semi-broken attempt at improving out allocation methods. I'm not sure if this is worth pursuing -- very little is simplified and other places get more complicated. It also shows how most currently existing methods of allocate_result are poorly design in some way but fixing it is a really tedious task.
Would it then maybe be reasonable to think of a new way to do the allocation? The main challenge I think is – in the example of the log – to allocate a tangent vector when no tangent vectors are among the input parameters?
I have not yet given it so much of thoughts, but in general found the current approach ok to work with.
That's one challenge. There is also the problem of embedded manifolds where we have to differentiate between ambient space representation and embedded manifold representation (where we have AnotherPlaneManifold that violates the principle that AbstractEmbeddedManifolds have the same representation as their embeddings), and for example power manifold is annoying as usual, because we should access arguments of allocation functions in different ways depending on whether it's coefficients-like, point-like or vector-like.
Of course, the current approach doesn't solve all of these problems but they are relatively niche and it's not that hard to patch an issue when it's actually encountered. I wanted to see how complicated this rework would be so I tried it but it doesn't seem to be worth the trouble.
Ok, is there still a doable way to reduce the current ambiguities?
Sort of yes, it just requires solving them one by one: writing a new method, and then making a test which is sometimes not straightforward.