Skip to contents

Checks that p has one coordinate per column of X, and warns if any row of X lies on the cut locus of p, where the inverse exponential map is undefined.

Usage

is_valid_torus(X, p)

Arguments

X

A matrix or data frame of torus data in \([0,1)^d\); rows are samples, columns are coordinates.

p

Numeric vector of length ncol(X) giving the base point on the torus.

Value

Logical: TRUE if no row of X falls on the cut locus of p, FALSE otherwise. Stops with an error if p has the wrong length.

Examples

X <- matrix(runif(20), nrow = 10, ncol = 2)
is_valid_torus(X, p = c(0, 0))