A list of constraints describing the closure of the region where the expression is finite.

domain(object)

Arguments

object

An Expression object.

Value

A list of Constraint objects.

Examples

a <- Variable(name = "a")
dom <- domain(p_norm(a, -0.5))
prob <- Problem(Minimize(a), dom)
result <- solve(prob)
result$value
#> [1] 1.000135e-30

b <- Variable()
dom <- domain(kl_div(a, b))
result <- solve(Problem(Minimize(a + b), dom))
result$getValue(a)
#> [1] 1.000135e-30
result$getValue(b)
#> [1] 1.000135e-30

A <- Variable(2, 2, name = "A")
dom <- domain(lambda_max(A))
A0 <- rbind(c(1,2), c(3,4))
result <- solve(Problem(Minimize(norm2(A - A0)), dom))
#> 'as(<dtCMatrix>, "dgCMatrix")' is deprecated.
#> Use 'as(., "generalMatrix")' instead.
#> See help("Deprecated") and help("Matrix-deprecated").
result$getValue(A)
#>      [,1] [,2]
#> [1,]  1.0  2.5
#> [2,]  2.5  4.0

dom <- domain(log_det(A + diag(rep(1,2))))
prob <- Problem(Minimize(sum(diag(A))), dom)
result <- solve(prob, solver = "SCS")
result$value
#> [1] -1.999987