testZ: Test if a given point is in Z

View source: R/mappings.R

testZR Documentation

Test if a given point is in Z

Description

Test if a given point is in Z

Usage

testZ(z, pA, eps = 1e-10, bxsize = sqrt(ncol(pA)))

Arguments

z

matrix corresponding to points to be tested

pA

matrix of orthogonal projection onto Ran(A)

eps

numerical precision on the result

bxsize

radius of the sphere enclosing the zonotope

Value

..

Examples

## Identification of the Z set
set.seed(42)
d <- 2; D <- 5

A <- selectA(d, D)
size <- 2 # box size of Y
ntest <- 10000
Z <- size * (2 * matrix(runif(ntest * d), ntest, d) - 1)

inZ <- testZ(Z, t(A))
colors <- rep('black', ntest)
colors[inZ] <- 'green'
plot(Z, col = colors, pch = 20, cex = 0.5)

## Identification of a zone
X <- mapZX(Z[inZ,], A)
inZone1 <- which(abs(X[,1]) < 1)
points((Z[inZ,])[inZone1,], col ='red')


mbinois/RRembo documentation built on Sept. 16, 2023, 10:15 p.m.