powered by
project_halfspace computes the Euclidean projection of a point onto a closed half-space. The function returns the projection onto the set
project_halfspace
project_halfspace(x, a, b)
Point to project
is the normal vector
is the threshold
# NOT RUN { set.seed(12345) p <- 3 a <- matrix(rnorm(p),p,1) a <- a/norm(a,'f') b <- runif(1) x <- matrix(rnorm(p),p,1) y <- project_halfspace(x,a,b) # }
Run the code above in your browser using DataLab