Skip to contents

Checks whether every row \(x\) of X satisfies \(-x_0^2 + x_1^2 + \dots + x_d^2 = -1\) and \(x_0 > 0\), up to a relative tolerance (see manifold_hyperbolic).

Usage

is_in_hyperbolic(X, tol = 1e-06)

Arguments

X

A matrix or data frame of (nominally) hyperbolic data; rows are samples, with d + 1 columns \((x_0, \ldots, x_d)\).

tol

Relative tolerance on the hyperboloid equation, scaled by \(x_0^2\). Defaults to 1e-6.

Value

Logical: TRUE if every row of X lies on the hyperboloid, FALSE otherwise.

Examples

X <- exp_map_hyperbolic(matrix(rnorm(20), nrow = 10, ncol = 2))
is_in_hyperbolic(X)
#> [1] TRUE

is_in_hyperbolic(matrix(runif(30), nrow = 10, ncol = 3))
#> [1] FALSE