constraints function

Constraints - Accessor and Mutator Functions

Constraints - Accessor and Mutator Functions

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

constraints(x) ## S3 method for class 'OP' constraints(x) constraints(x) <- value

Arguments

  • x: an object used to select the method.
  • value: an R object.

Returns

the extracted constraints object.

Examples

## minimize: x + 2 y ## subject to: x + y >= 1 ## x, y >= 0 x <- OP(1:2) constraints(x) <- L_constraint(c(1, 1), ">=", 1) constraints(x)

Author(s)

Stefan Theussl

  • Maintainer: Stefan Theussl
  • License: GPL-3
  • Last published: 2023-04-20