checkUnitSphere {multIntTestFunc}R Documentation

Domain check for unit sphere {xRn:x2=1}\{\vec{x} \in R^n : \Vert \vec{x} \Vert_{2} = 1\}

Description

The function checks if a point (one row in the input argument) is inside the unit sphere {xRn:x2=1}\{\vec{x} \in R^n : \Vert \vec{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 nn is automatically inferred from the input matrix and is equal to the number of columns. The function allows for an additional parameter ε0\varepsilon\geq 0 to test {xRn:1εx21+ε}\{\vec{x} \in R^n : 1-\varepsilon \leq \Vert \vec{x} \Vert_2 \leq 1 + \varepsilon\}. WARNING: Due to floating point arithmetic the default value of ε=0\varepsilon=0 will not work properly in most cases.

Usage

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

Author(s)

Klaus Herrmann

Examples

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

[Package multIntTestFunc version 0.2.0 Index]