Skip to content

Commit

Permalink
Merge pull request #29 from gqcollins/master
Browse files Browse the repository at this point in the history
navigate rounding errors in inv_exp_map()
  • Loading branch information
jdtuck committed Oct 12, 2023
2 parents e1e8ada + b0e521d commit 56ded3e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/geometry.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ l2_curvenorm <- function(psi, time=seq(0,1,length.out=ncol(psi))){
}

inv_exp_map<-function(Psi, psi){
theta <- acos(inner_product(Psi,psi))
ip <- inner_product(Psi, psi)
if(ip < -1){
ip = -1
}else if(ip > 1){
ip = 1
}
theta <- acos(ip)

if (theta < 1e-10){
exp_inv = rep(0,length(psi))
Expand Down

0 comments on commit 56ded3e

Please sign in to comment.