Learn R Programming

splitFeas (version 0.1.0)

project_cube: Project onto a cube

Description

project_cube computes the Euclidean projection of a point onto a cube.

Usage

project_cube(x, center, r)

Arguments

x

Point to project

center

Center of the square

r

Half the length of a side

Examples

Run this code
# NOT RUN {
set.seed(12345)
p <- 3
center <- matrix(rnorm(p),p,1)
r <- runif(1)
x <- matrix(rnorm(p),p,1)
y <- project_cube(x,center,r)
# }

Run the code above in your browser using DataLab