Checking Linear Constraints

Description

Checks if a given matrix or vector satisfies a set of linear constraints. The constraints are specified by a left-hand matrix A and a right-hand vector b such that a matrix or vector x satisfies the constraints if an only if

A x >=
  b.

Usage

checkConstraints(x, A, b, margin = 2L, op = c(">=", "<=", "=="))

Arguments

x
matrix or vector to check.
A
left-hand matrix
b
right-hand vector
margin
which dimension should be checked (1L: rows or 2L: columns).
op
comparison operator to use ('>=', '<=', '='), indicating the type of constraints: inequality (greater than or lower than) or equality.

Value

a logical vector of length nrow(A).