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

Elementwise distance #136

Open
mateuszbaran opened this issue Feb 7, 2022 · 2 comments
Open

Elementwise distance #136

mateuszbaran opened this issue Feb 7, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@mateuszbaran
Copy link
Member

A function for calculating elementwise distance between points might be useful. Something like this for example:

function elementwise_distance(M::AbstractPowerManifold, p, q)
    dists = similar(p, number_eltype(p), power_dimensions(M))
    return elementwise_distance!(M, dists, p, q)
end

function elementwise_distance!(M::AbstractPowerManifold, dists, p, q)
    rep_size = representation_size(M.manifold)
    for i in get_iterator(M)
        dists[i...] = distance(M.manifold, _read(M, rep_size, p, i), _read(M, rep_size, q, i))
    end
    return dists
end
@mateuszbaran mateuszbaran added the enhancement New feature or request label Feb 7, 2022
@kellertuer
Copy link
Member

This could indeed just be added to ManifoldsBase?

@mateuszbaran
Copy link
Member Author

Yes, I'd also say that this should be in ManifoldsBase.jl.

@kellertuer kellertuer transferred this issue from JuliaManifolds/Manifolds.jl Nov 14, 2022
@kellertuer kellertuer mentioned this issue Oct 22, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants