project_square: Project onto a square

Description Usage Arguments Examples

Description

project_square computes the Euclidean projection of a point onto a square.

Usage

1
project_square(x, center, r)

Arguments

x

Point to project

center

Center of the square

r

Half the length of a side

Examples

1
2
3
4
5
6
set.seed(12345)
p <- 2
center <- matrix(rnorm(p),p,1)
r <- runif(1)
x <- matrix(rnorm(p),p,1)
y <- project_square(x,center,r)

splitFeas documentation built on May 2, 2019, 2:52 p.m.