Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Bounds_Accessor_Mutator

Bounds - Accessor and Mutator Functions


Description

The bounds of a given optimization problem (OP) can be accessed or mutated via the method 'bounds'.

Usage

bounds(x)

## S3 method for class 'OP'
bounds(x)

bounds(x) <- value

Arguments

x

an object of type 'OP' used to select the method.

value

an object derived from 'bound' ('V_bound') or NULL.

Value

the extracted bounds object on get and the altered 'OP' object on set.

Examples

## Not run: 
lp_obj <- L_objective(c(1, 2))
lp_con <- L_constraint(c(1, 1), dir="==", rhs=2)
lp_bound <- V_bound(ui=1:2, ub=c(3, 3))
lp <- OP(objective=lp_obj, constraints=lp_con, bounds=lp_bound, maximum=FALSE)
bounds(lp)
x <- ROI_solve(lp)
x$objval
x$solution
bounds(lp) <- V_bound(ui=1:2, ub=c(1, 1))
y <- ROI_solve(lp)
y$objval
y$solution

## End(Not run)

ROI

R Optimization Infrastructure

v1.0-0
GPL-3
Authors
Kurt Hornik [aut], David Meyer [aut], Florian Schwendinger [aut], Stefan Theussl [aut, cre], Diethelm Wuertz [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.