checkUnitSphere: Domain check for unit sphere \{\vec{x} \in R^n : \Vert x...

Description Usage Arguments Value Examples

View source: R/domainChecks.R

Description

The function checks if a point (one row in the input argument) is inside the unit sphere \{\vec{x} \in R^n : \Vert x \Vert_2 = 1\} or not. If the input matrix contains entries that are not numeric, i.e., not representing real numbers, the function throws an error. The dimension n is automatically inferred from the input matrix and is equal to the number of columns. The function allows for an additional parameter \varepsilon≥q 0 to test \{\vec{x} \in R^n : 1-\varepsilon ≤q \Vert x \Vert_2 ≤q 1 + \varepsilon\}. WARNING: Due to floating point arithmetic the default value of \varepsilon=0 will not work properly in most cases.

Usage

1
checkUnitSphere(x, eps = 0)

Arguments

x

Matrix with numeric entries. Each row represents one point

eps

Non-negative numeric that allows to test points with an additional tolerance

Value

Vector where each element (TRUE or FALSE) indicates if a point is in the unit sphere

Examples

1
2
x <- matrix(rnorm(30),10,3)
checkUnitSphere(x,eps=0.001)

multIntTestFunc documentation built on Oct. 5, 2021, 5:08 p.m.