Learn R Programming

splitFeas (version 0.1.0)

project_halfspace: Projection onto a halfspace

Description

project_halfspace computes the Euclidean projection of a point onto a closed half-space. The function returns the projection onto the set

Usage

project_halfspace(x, a, b)

Arguments

x

Point to project

a

is the normal vector

b

is the threshold

Examples

Run this code
# 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