JuliaManifolds / ManifoldsBase.jl

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

Ensure norm succeeds on numerical errors in inner(...) #68

Closed TimQuelch closed 3 years ago

TimQuelch commented 3 years ago

Due to numerical errors the inner product can sometimes return an infinitesimal negative number (e.g. -1e-26). This negative number causes the sqrt to fail with a domain error

This fix ensures that the result of the inner product of X and X is always greater than or equal to zero (which it should be by definition)

kellertuer commented 3 years ago

Following the general idea, that we have nice default implementations, that work (flawlessly) but might not be the most efficient one (for a special manifold, where a specific one is for some reason more efficient), I think this is a very good idea.

codecov[bot] commented 3 years ago

Codecov Report

Merging #68 (8745a12) into master (98e5c87) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #68   +/-   ##
=======================================
  Coverage   99.69%   99.69%           
=======================================
  Files          10       10           
  Lines        1320     1320           
=======================================
  Hits         1316     1316           
  Misses          4        4           
Impacted Files Coverage Δ
src/ManifoldsBase.jl 99.40% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 98e5c87...8745a12. Read the comment docs.

kellertuer commented 3 years ago

Could you just bump the version to 0.10.7? Then we would be good to go (i.e. merge).

TimQuelch commented 3 years ago

I bumped the version. I also force-pushed to reword the commit message to be more correct