L_constraint function

Linear Constraints

Linear Constraints

Linear constraints are typically of the form [REMOVE_ME]Lxrhs[REMOVEME2] Lx \leq rhs [REMOVE_ME_2]

where LL is a m×nm \times n (sparse) matrix of coefficients to the objective variables xx and the right hand side rhsrhs

is a vector of length mm.

L_constraint(L, dir, rhs, names = NULL) ## S3 method for class 'L_constraint' variable.names(object, ...) as.L_constraint(x, ...) is.L_constraint(x) ## S3 method for class 'L_constraint' length(x) ## S3 method for class 'L_constraint' terms(x, ...)

Arguments

  • L: a numeric vector of length nn (a single constraint) or a matrix of dimension m×nm \times n, where nn is the number of objective variables and mm is the number of constraints. Matrices can be of class "simple_triplet_matrix" to allow a sparse representation of constraints.

  • dir: a character vector with the directions of the constraints. Each element must be one of "<=", ">=" or "==".

  • rhs: a numeric vector with the right hand side of the constraints.

  • names: an optional character vector giving the names of xx

    (column names of AA).

  • object: an R object.

  • ...: further arguments passed to or from other methods (currently ignored).

  • x: an R object.

Returns

an object of class "L_constraint" which inherits from "constraint".

Description

Linear constraints are typically of the form

Lxrhs Lx \leq rhs

where LL is a m×nm \times n (sparse) matrix of coefficients to the objective variables xx and the right hand side rhsrhs

is a vector of length mm.

Author(s)

Stefan Theussl

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