Skip to content

Commit

Permalink
navigate rounding errors in inv_exp_map()
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin Quinn Collins committed Oct 12, 2023
1 parent e1e8ada commit b0e521d
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 b0e521d

Please sign in to comment.