F_constraint function

Function Constraints

Function Constraints

Function (or generally speaking nonlinear) constraints are typically of the form [REMOVE_ME]f(x)b[REMOVEME2] f(x) \leq b [REMOVE_ME_2] where f()f() is a well-defined R function taking the objective variables xx

(typically a numeric vector) as arguments. bb is called the right hand side of the constraints.

F_constraint(F, dir, rhs, J = NULL, names = NULL) ## S3 method for class 'F_constraint' variable.names(object, ...) is.F_constraint(x) as.F_constraint(x, ...) ## S3 method for class '`NULL`' as.F_constraint(x, ...) ## S3 method for class 'NO_constraint' as.F_constraint(x, ...) ## S3 method for class 'constraint' as.F_constraint(x, ...) ## S3 method for class 'F_constraint' terms(x, ...)

Arguments

  • F: a function or a list of functions of length mm. Each function takes nn parameters as input and must return a scalar. Thus, nn is the number of objective variables and mm is the number 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.
  • J: an optional function holding the Jacobian of F.
  • names: an optional character vector giving the names of x.
  • object: an R object.
  • x: object to be tested.
  • ``: further arguments passed to or from other methods (currently ignored).

Returns

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

Description

Function (or generally speaking nonlinear) constraints are typically of the form

f(x)b f(x) \leq b

where f()f() is a well-defined R function taking the objective variables xx

(typically a numeric vector) as arguments. bb is called the right hand side of the constraints.

Author(s)

Stefan Theussl

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