R/exports.R
quad_over_lin.Rd
\(\sum_{i,j} X_{i,j}^2/y\).
quad_over_lin(x, y)
An Expression, vector, or matrix.
A scalar Expression or numeric constant.
An Expression representing the quadratic over linear function value evaluated at the input.
x <- Variable(3,2) y <- Variable() val <- cbind(c(-1,2,-2), c(-1,2,-2)) prob <- Problem(Minimize(quad_over_lin(x,y)), list(x == val, y <= 2)) result <- solve(prob) result$value #> [1] 9 result$getValue(x) #> [,1] [,2] #> [1,] -1 -1 #> [2,] 2 2 #> [3,] -2 -2 result$getValue(y) #> [1] 2