Commit cd5adf8a authored by Corson N. Areshenkoff's avatar Corson N. Areshenkoff

Add default to exp/log

parent 5a4caa89
......@@ -12,7 +12,9 @@ spd.expmap <- function(x, p){
if (!'s.mat' %in% input.type(x)){
stop('x must be a positive definite matrix')
}
if (!'spd.mat' %in% input.type(p)){
if (is.null(p)) {
p <- diag(rep(1,dim(x)[1]))
} else if (!'spd.mat' %in% input.type(p)){
stop('p must be a positive definite matrix')
}
......
......@@ -6,12 +6,15 @@
#' @param p The point on whose tangent space to project x
#' @return A symmetric matrix.
spd.logmap <- function(x, p){
spd.logmap <- function(x, p = NULL){
if (!'spd.mat' %in% input.type(x)){
stop('x must be a positive definite matrix')
}
if (!'spd.mat' %in% input.type(p)){
if (is.null(p)) {
p <- diag(rep(1,dim(x)[1]))
} else if (!'spd.mat' %in% input.type(p)){
stop('p must be a positive definite matrix')
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment